JBoss 7.2 Client JAR
millsp Feb 6, 2013 6:46 AMWe were having some problems a while ago with making remote EJB calls into JBoss 7.2, using the client jar.
Broadly you seem to be able to set up remote EJB calls in two ways : setting Java Properties, or using -Djboss.ejb.client.properties to specify a properties file.
Our test case is fine using -Djboss.ejb.client.properties, but consistently gets a null pointer calling create() on a home interface, when we’re setting the properties programmatically.
This still happens with the latest 7.2 source which we took down and built it the other night; it didn’t happen at JBoss EJB Client version 1.0.5.Final (the 7.1.1 client jar), but happens with 1.0.14.Final and (most recently) 1.0.16.Final, in case this is of any help.
Our application relies on setting the properties internally, it is not really an option to create a properties file as the application starts over JNLP, and the content will be different for each environment on each customer site.
It is also possible that I need to set the properties differently for the 7.2 client, in which case advice would be gratefully appreciated. This is what the client is doing :
Properties contextProps = new Properties();
contextProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory" );
contextProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
contextProps.put(Context.SECURITY_PRINCIPAL, usr );
contextProps.put(Context.SECURITY_CREDENTIALS, pwd );
contextProps.put(Context.PROVIDER_URL, "remote://" + url );
InitialContext ic = new InitialContext( contextProps );
CPLoginSessionHome lohome = (CPLoginSessionHome) PortableRemoteObject.narrow(ic.lookup( LOGIN_SLSB_REMOTE_JNDI ), CPLoginSessionHome.class);
CPLoginSessionRemote lormt = (CPLoginSessionRemote) lohome.create();
... and the following error is thrown on the last line :
java.lang.NullPointerException
at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:102)
at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:90)
at org.jboss.ejb.client.EJBClientContext.registerConnection(EJBClientContext.java:401)
at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getContext(RemoteNamingEjbClientContextSelector.java:60)
at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:46)
at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:15)
at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:252)
at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:262)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:154)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:122)
at $Proxy0.create(Unknown Source)
at com.cedar.cp.model.client.CPModelClientLoop.main(CPModelClientLoop.java:105)
The code works OK with the 7.1.0 and 7.1.1 client jars.
Would it be possible to raise a bug for this please, and to get it fixed in the final release or 7.2, or very shortly thereafter ? I can supply an EAR/client test programs on demand.
Thanks –
Phil