[jboss-jira] [JBoss JIRA] (AS7-3830) Remote JNDI call does not bind stateful beans

jaikiran pai (JIRA) jira-events at lists.jboss.org
Wed Feb 22 03:42:36 EST 2012


    [ https://issues.jboss.org/browse/AS7-3830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669820#comment-12669820 ] 

jaikiran pai commented on AS7-3830:
-----------------------------------

{quote}
I believe the fix should be done in the getReference method of the RemoteViewManagedReferenceFactory to set the TCCL to point to the view class' classloader before trying to create a session for stateful beans. I'll have to take a look at this tomorrow.
{quote}

I thought about this a bit more and my proposed solution of setting the TCCL to point to view class' classloader in that method is _not_ right. Doing that can result in an incorrect TCCL being setup if the lookup is happening from another application deployed on the same server instance.

The right fix for this is to make sure that the remote naming lookup (which doesn't really run in a specific deployment context) uses the default EJB client context available on the server. The fix has been done and a pull request has been sent for this change https://github.com/jbossas/jboss-as/pull/1571

                
> Remote JNDI call does not bind stateful beans
> ---------------------------------------------
>
>                 Key: AS7-3830
>                 URL: https://issues.jboss.org/browse/AS7-3830
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: EJB, Naming
>    Affects Versions: 7.1.0.Final
>            Reporter: Ondřej Chaloupka
>            Assignee: jaikiran pai
>              Labels: eap6_LA
>             Fix For: 7.1.1.Final
>
>
> It seems that current ejb remote client is not able to find stateful bean. Exception is thrown instead:
> {code}
> javax.naming.NamingException: java.lang.IllegalStateException: No EJB client context is available [Root exception is java.lang.RuntimeException: java.lang.IllegalStateException: No EJB client context is available]
> 	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:135)
> 	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:74)
> 	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)
> 	at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:124)
> 	at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:70)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: No EJB client context is available
> 	at org.jboss.as.ejb3.remote.RemoteViewManagedReferenceFactory.getReference(RemoteViewManagedReferenceFactory.java:91)
> 	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:133)
> 	... 7 more
> Caused by: java.lang.IllegalStateException: No EJB client context is available
> 	at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:233)
> 	at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:160)
> 	at org.jboss.as.ejb3.remote.RemoteViewManagedReferenceFactory.getReference(RemoteViewManagedReferenceFactory.java:89)
> 	... 8 more
> {code}
> Please, check my test whether definition of remote context does not contain a mistake. But finding singleton and stateless beans works fine.
> https://github.com/ochaloup/jboss-as/blob/ejb-remote-call/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/naming/remote/ejb/RemoteNamingEjbTestCase.java

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jboss-jira mailing list