[jboss-jira] [JBoss JIRA] (WFLY-803) "NullPointerException" in RemotingConnectionEJBReceiver constructor if misconfigured

David Lloyd (JIRA) issues at jboss.org
Mon Apr 21 18:56:33 EDT 2014


     [ https://issues.jboss.org/browse/WFLY-803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Lloyd updated WFLY-803:
-----------------------------

    Description: 
While experimenting with EJB remote access, I got confused with the proper configuration ;-). This resulted in a NullPointerException in one of your EJB client classes, and I think this should be handled by a meaningful error message.

I performed a lookup for "ejb:Stateless/StatelessEJB//GeometricModelBean!de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelRemote" => this means I want to use the JNDI lookup.

But in "jndi.properties", I used this: "jboss.naming.client.ejb.context=true" => This should probably activate "jboss-remote naming", and the lookup should be done for "Stateless/StatelessEJB//GeometricModelBean...". (no "ejb:" prefix).

Instead of an error message, this resulted in this console output, followed by an exception:

{noformat}
Feb 05, 2013 10:43:57 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA
Feb 05, 2013 10:43:57 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA
Feb 05, 2013 10:43:57 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.14.GA
Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext at 28ad5a, receiver=Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante]} on channel Channel ID b93e696f (outbound) of Remoting connection 00411379 to localhost/127.0.0.1:4447
Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000015: Initial module availability report for Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante] wasn't received during the receiver context association
Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.16.Final
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:420)
	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:271)
	at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)
	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:156)
	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
	at sun.proxy.$Proxy0.computeCuboidVolume(Unknown Source)
	at de.fhw.komponentenarchitekturen.knauf.stateless.standaloneclient.GeometricModelApplicationClient.main(GeometricModelApplicationClient.java:38)
{noformat}

I will attach a sample. This is an Eclipse project. But i can also be run standalone: just modify "StatelessStandaloneClient\startclient.bat" to match your path to "jboss-client.jar" and start it (you need Java 1.7 for this). You don't even have to deploy the EAR app on the server to see the error. But if you want to do so: it is also part of the attachment: "Stateless.ear".



  was:
While experimenting with EJB remote access, I got confused with the proper configuration ;-). This resulted in a NullPointerException in one of your EJB client classes, and I think this should be handled by a meaningful error message.

I performed a lookup for "ejb:Stateless/StatelessEJB//GeometricModelBean!de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelRemote" => this means I want to use the JNDI lookup.

But in "jndi.properties", I used this: "jboss.naming.client.ejb.context=true" => This should probably activate "jboss-remote naming", and the lookup should be done for "Stateless/StatelessEJB//GeometricModelBean...". (no "ejb:" prefix).

Instead of an error message, this resulted in this console output, followed by an exception:

Feb 05, 2013 10:43:57 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA
Feb 05, 2013 10:43:57 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA
Feb 05, 2013 10:43:57 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.14.GA
Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext at 28ad5a, receiver=Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante]} on channel Channel ID b93e696f (outbound) of Remoting connection 00411379 to localhost/127.0.0.1:4447
Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000015: Initial module availability report for Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante] wasn't received during the receiver context association
Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.16.Final
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:420)
	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:271)
	at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)
	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:156)
	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
	at sun.proxy.$Proxy0.computeCuboidVolume(Unknown Source)
	at de.fhw.komponentenarchitekturen.knauf.stateless.standaloneclient.GeometricModelApplicationClient.main(GeometricModelApplicationClient.java:38)

I will attach a sample. This is an Eclipse project. But i can also be run standalone: just modify "StatelessStandaloneClient\startclient.bat" to match your path to "jboss-client.jar" and start it (you need Java 1.7 for this). You don't even have to deploy the EAR app on the server to see the error. But if you want to do so: it is also part of the attachment: "Stateless.ear".




    
> "NullPointerException" in RemotingConnectionEJBReceiver constructor if misconfigured
> ------------------------------------------------------------------------------------
>
>                 Key: WFLY-803
>                 URL: https://issues.jboss.org/browse/WFLY-803
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: EJB
>         Environment: Tested with 7.2.0 Alpha snapshot of 2013-02-05
> Sample project is build with Java 1.7
>            Reporter: Wolfgang Knauf
>            Assignee: David Lloyd
>            Priority: Minor
>         Attachments: StatelessStandaloneClient.zip
>
>
> While experimenting with EJB remote access, I got confused with the proper configuration ;-). This resulted in a NullPointerException in one of your EJB client classes, and I think this should be handled by a meaningful error message.
> I performed a lookup for "ejb:Stateless/StatelessEJB//GeometricModelBean!de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelRemote" => this means I want to use the JNDI lookup.
> But in "jndi.properties", I used this: "jboss.naming.client.ejb.context=true" => This should probably activate "jboss-remote naming", and the lookup should be done for "Stateless/StatelessEJB//GeometricModelBean...". (no "ejb:" prefix).
> Instead of an error message, this resulted in this console output, followed by an exception:
> {noformat}
> Feb 05, 2013 10:43:57 PM org.xnio.Xnio <clinit>
> INFO: XNIO Version 3.0.7.GA
> Feb 05, 2013 10:43:57 PM org.xnio.nio.NioXnio <clinit>
> INFO: XNIO NIO Implementation Version 3.0.7.GA
> Feb 05, 2013 10:43:57 PM org.jboss.remoting3.EndpointImpl <clinit>
> INFO: JBoss Remoting version 3.2.14.GA
> Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
> INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
> Feb 05, 2013 10:43:58 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
> INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext at 28ad5a, receiver=Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante]} on channel Channel ID b93e696f (outbound) of Remoting connection 00411379 to localhost/127.0.0.1:4447
> Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
> INFO: EJBCLIENT000015: Initial module availability report for Remoting connection EJB receiver [connection=Remoting connection <c751fd>,channel=jboss.ejb,nodename=turbotante] wasn't received during the receiver context association
> Feb 05, 2013 10:44:03 PM org.jboss.ejb.client.EJBClient <clinit>
> INFO: JBoss EJB Client version 1.0.16.Final
> 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:420)
> 	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:271)
> 	at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)
> 	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:156)
> 	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
> 	at sun.proxy.$Proxy0.computeCuboidVolume(Unknown Source)
> 	at de.fhw.komponentenarchitekturen.knauf.stateless.standaloneclient.GeometricModelApplicationClient.main(GeometricModelApplicationClient.java:38)
> {noformat}
> I will attach a sample. This is an Eclipse project. But i can also be run standalone: just modify "StatelessStandaloneClient\startclient.bat" to match your path to "jboss-client.jar" and start it (you need Java 1.7 for this). You don't even have to deploy the EAR app on the server to see the error. But if you want to do so: it is also part of the attachment: "Stateless.ear".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list