EJB 3: Access bean session from application client

I am having problems accessing a session with a bean state (SFSB) from an application client. I am using JBoss 5.0.1.GA. The application client and EJB are both packaged in an EAR that is being deployed, and I have other application clients that work without problems. So far, I have used the stateless beans (SLSB) session, but as I understand it, the differences between SLSB and SFSB should not affect how they can be accessed from the application client.

Class structure / interfaces:

@Local public interface A {...}

@Stateless public class ABean implements A {...}

@Remote public interface B {...}

@Stateful public class BBean implements B {
    @EJB private A anInstanceOfA;

    @PostConstruct private void init() {
        this.anInstanceOfA.someMethod();
    }
}

"appclient-launcher", " JBoss 5" . "BBean" , someMethod() () ABean init(). InvalidStateException ( " : null" ) ( ). bean bean, ( , , , ). , SFSB - ( JSF managed-bean) .

- ? SFSB ?

. [# JBAS-4317] , , JBoss 5.0.0.Beta3, , .

+5
2

, , beans, beans, , :

-, EAR, JAAS. JBoss login-config.xml, :

<application-policy name="My-SD">
    <authentication>
        <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
            <module-option name="unauthenticatedIdentity">guest</module-option>
            <module-option name="dsJndiName">java:/myDS</module-option>
            <module-option name="principalsQuery">SELECT PASSWORD FROM LOGIN WHERE LOGIN = ? AND STATUS > 0</module-option>
            <module-option name="rolesQuery">SELECT ROLE, 'Roles' FROM USER_ROLE WHERE LOGIN = ?</module-option>
        </login-module>
    </authentication>
</application-policy>

- jboss-web.xml, jboss.xml EJB, - (EJB ).

SFSB, jboss.xml EJB-. JBoss , , , , , , SFSB.

+1

EJB 3.0 Core Specification, 12.4. :

Lifecycle .

,
- martin

0

All Articles