Bug 920710 - Entity EJB Locators don't work with map-based EJB client configuration
Summary: Entity EJB Locators don't work with map-based EJB client configuration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: EAP 6.1.1
Assignee: Jaikiran Pai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-12 15:19 UTC by Jan Martiska
Modified: 2013-10-23 23:02 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-16 20:25:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker EJBCLIENT-70 0 Major Resolved EJB client context identifier not attached to proxies returned by calls to finder methods and getEJBHome method 2014-08-01 06:42:17 UTC

Description Jan Martiska 2013-03-12 15:19:46 UTC
If you use EJB2 entity beans together with map-based remote EJB client configuration [EJBCLIENT-34], it seems not possible to locate entities using their EJB Home and then use them.

How to reproduce:
- Take org.jboss.as.test.integration.ejb.remote.entity.bmp.BMPRemoteEntityBeanTestCase from basic integration testsuite
- Change it so that it will use a map-based configuration instead of jboss-ejb-client.properties, for example change getHome and getProps methods like this, and add getProps method:

    private BMPHome getHome() throws NamingException {
        return (BMPHome) new InitialContext(getProps()).lookup(
                "ejb:"+APP_NAME+"/"+MODULE_NAME+"/SimpleBMP!org.jboss.as.test.integration.ejb.remote.entity.bmp.BMPHome");
    }

    private DataStore getDataStore() throws NamingException {
        return (DataStore) new InitialContext(getProps()).lookup(
                "ejb:"+APP_NAME+"/"+MODULE_NAME+"/DataStoreBean!org.jboss.as.test.integration.ejb.remote.entity.bmp.DataStore");
    }

    private Properties getProps() {
        System.setProperty("jboss.ejb.client.properties.skip.classloader.scan", "true");
        Properties props = new Properties();
        props.put("org.jboss.ejb.client.scoped.context", true);
        props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
        props.put("endpoint.name", "client");
        props.put("remote.connections", "main");
        props.put("remote.connection.main.host", "localhost");
        props.put("remote.connection.main.port", "4447");
        props.put("remote.connection.main.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS","false");
        props.put("remote.connection.main.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT","false");
        props.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
        return props;
    }

- Run the testcase.

Out of the 9 tests in this testcase, 5 will fail. Those are the ones which access an entity through BMPHome.findByPrimaryKey. Calling this correctly returns a Proxy for remote EJB EntityEJBLocator, but any calls on this proxy will fail with:

java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:ejb-remote-test, moduleName:ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@12ca1922

When the testcase uses a jboss-ejb-client.properties file, everything works.

Comment 1 JBoss JIRA Server 2013-03-19 12:19:34 UTC
jaikiran pai <jpai> made a comment on jira EJBCLIENT-70

Pull requests sent

Comment 2 Jan Martiska 2013-08-27 12:58:09 UTC
This is fixed in 6.1.0, but has never gotten past the NEW state. I checked the behavior and indeed it seems to work now.
Setting to VERIFIED in 6.1.0.GA.


Note You need to log in before you can comment on or make changes to this bug.