1 Reply Latest reply: Mar 6, 2012 7:22 AM by Sebastian Bayerlein RSS

JBoss AS 7.1: Remote JNDI-Call won't do any action in server bean

Sebastian Bayerlein Newbie

Hello,

 

I deployed a simple EJB on a JBoss AS 7.1CR1.

 

The logfile of the JBoss contains the information, that the bean is available with JNDI entry

java:app/jboss.migration.example.Asterix/Asterix!com.xxxxx.example.ejb.client.AsterixHome

 

My Java-Client-Code won't return after doing the following lookup:

String lookupString = "ejb:app/jboss.migration.example.Asterix/Asterix!com.xxxxx.example.ejb.client.AsterixHome";


final Hashtable<String, String> jndiProperties = new Hashtable<String, String>();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL, "127.0.0.1:4447");


InitialContext context = null;
try
{
          context = new InitialContext(jndiProperties);
          AsterixHome ejbHome = (AsterixHome) context.lookup(lookupString);

          Method creator = ejbHome.getClass().getMethod( "create", new Class[ 0 ] );
       Asterix ejbObject = ( Asterix ) creator.invoke( ejbHome, new Object[ 0 ] );
          ...

 

The only output in the client log is the following:

09:09:41,133        DEBUG logging:48 - Logging Provider: org.jboss.logging.Log4jLoggerProvider
09:09:41,169         INFO client:43 - JBoss EJB Client version 1.0.0.Beta11
Proxy for remote EJB StatelessEJBLocator{appName='global', moduleName='jboss.migration.ejb.dummy.generator', distinctName='jboss.migration.e
xample.Asterix', beanName='Asterix', view='interface com.elaxy.example.ejb.client.Asterix'}
09:09:41,211        DEBUG ConfigBasedEJBClientContextSelector:175 - Looking for jboss-ejb-client.properties using classloader sun.misc.Launc
her$AppClassLoader@77ad77ad
09:09:41,212        DEBUG ConfigBasedEJBClientContextSelector:179 - Found jboss-ejb-client.properties using classloader sun.misc.Launcher$Ap
pClassLoader@77ad77ad
09:09:41,214        DEBUG ConfigBasedEJBClientContextSelector:398 - remote.connection.default.connect.options. has the following options {}
09:09:41,214        TRACE ConfigBasedEJBClientContextSelector:428 - Options {} have been merged with defaults {} to form {}
09:09:41,215        DEBUG ConfigBasedEJBClientContextSelector:398 - endpoint.create.options. has the following options {}
09:09:41,216        TRACE ConfigBasedEJBClientContextSelector:428 - Options {} have been merged with defaults {org.xnio.Options.THREAD_DAEMO
N=>true} to form {org.xnio.Options.THREAD_DAEMON=>true}
09:09:41,226         INFO xnio:63 - XNIO Version 3.0.0.CR7
09:09:41,239         INFO nio:55 - XNIO NIO Implementation Version 3.0.0.CR7
09:09:41,244        TRACE nio:76 - Starting up with selector provider sun.nio.ch.WindowsSelectorProvider
09:09:41,246        TRACE nio:114 - Using default selector type for temporary selectors.
09:09:41,271         INFO remoting:69 - JBoss Remoting version 3.2.0.CR8
09:09:44,328        TRACE nio:547 - CAS org.xnio.nio.NioXnioWorker@7ff07ff0 00000001 -> 00000002
09:09:44,329        TRACE nio:547 - CAS org.xnio.nio.NioXnioWorker@7ff07ff0 00000002 -> 00000003
09:09:44,330        TRACE nio:84 - Starting worker thread Thread[Remoting "config-based-ejb-client-endpoint" read-1,5,main]
09:09:44,332        DEBUG nio:88 - Started channel thread 'Remoting "config-based-ejb-client-endpoint" read-1', selector sun.nio.ch.WindowsS
electorImpl@556f556f
09:09:44,333        TRACE selector:152 - Beginning select on sun.nio.ch.WindowsSelectorImpl@556f556f
09:09:44,333        TRACE nio:84 - Starting worker thread Thread[Remoting "config-based-ejb-client-endpoint" write-1,5,main]
09:09:44,334        DEBUG nio:88 - Started channel thread 'Remoting "config-based-ejb-client-endpoint" write-1', selector sun.nio.ch.Windows
SelectorImpl@7f917f91
09:09:44,334        TRACE selector:152 - Beginning select on sun.nio.ch.WindowsSelectorImpl@7f917f91
09:09:44,340        TRACE endpoint:131 - Completed open of endpoint "config-based-ejb-client-endpoint" <3c383c38>
09:09:44,341        DEBUG ConfigBasedEJBClientContextSelector:398 - remote.connectionprovider.create.options. has the following options {}
09:09:44,341        TRACE ConfigBasedEJBClientContextSelector:428 - Options {} have been merged with defaults {} to form {}
09:09:44,342        TRACE endpoint:185 - Allocated tick to 1 of endpoint "config-based-ejb-client-endpoint" <3c383c38> (opened Connection pr
ovider for remote)
09:09:44,358        TRACE endpoint:434 - Adding connection provider registration named 'remote': Remoting remote connection provider 4516451
6 for endpoint "config-based-ejb-client-endpoint" <3c383c38>
09:09:44,366        TRACE endpoint:185 - Allocated tick to 2 of endpoint "config-based-ejb-client-endpoint" <3c383c38> (opened Connection to
 /127.0.0.1:4447)
09:09:44,376        TRACE remote:97 - Attempting to connect to "/127.0.0.1:4447" with options {}
09:09:44,789        TRACE nio:82 - Adding channel java.nio.channels.SocketChannel[unconnected local=/0:0:0:0:0:0:0:0:62569] to Thread[Remoti
ng "config-based-ejb-client-endpoint" read-1,5,main] for XNIO channel TCP socket channel (NIO) <14161416> (other thread)
09:09:44,791        TRACE selector:163 - Selected on sun.nio.ch.WindowsSelectorImpl@556f556f
09:09:44,791        TRACE nio:204 - Running task org.xnio.nio.WorkerThread$SynchTask@39503950
09:09:44,791        TRACE selector:152 - Beginning select on sun.nio.ch.WindowsSelectorImpl@556f556f
09:09:44,792        TRACE nio:83 - Adding channel java.nio.channels.SocketChannel[unconnected local=/0:0:0:0:0:0:0:0:62569] to Thread[Remoti
ng "config-based-ejb-client-endpoint" write-1,5,main] for XNIO channel TCP socket channel (NIO) <14161416> (other thread)
09:09:44,792        TRACE selector:163 - Selected on sun.nio.ch.WindowsSelectorImpl@7f917f91
09:09:44,792        TRACE nio:204 - Running task org.xnio.nio.WorkerThread$SynchTask@55825582
09:09:44,792        TRACE selector:152 - Beginning select on sun.nio.ch.WindowsSelectorImpl@7f917f91
09:09:44,797        TRACE listener:318 - Setting channel listener to Connection finisher for java.nio.channels.SocketChannel[connection-pend
ing local=/0:0:0:0:0:0:0:0:62569 remote=/127.0.0.1:4447]
09:09:44,799        TRACE nio:351 - Setting operations of key sun.nio.ch.SelectionKeyImpl@39593959 of java.nio.channels.SocketChannel[connec
tion-pending local=/0:0:0:0:0:0:0:0:62569 remote=/127.0.0.1:4447] to 08 (other thread)

 

Can someone tell me, why the invokation won't return? When canceling the lookup-client, I get the following server-log:

15:10:39,423 ERROR [org.jboss.remoting.remote] (Remoting "ltp-cob-00-0026" read-1) JBREM000200: Remote connection failed: java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen

 

That's the config for the ejb (ejb-jar.xml):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "ejb-jar_1_1.dtd">
<ejb-jar id="ejb-jar_Asterix">
          <enterprise-beans>
                    <session id="Session_Asterix">
                              <description><![CDATA[An EJB named Asterix]]></description>
                              <display-name>Asterix</display-name>
                              <ejb-name>Asterix</ejb-name>
                              <home>com.elaxy.example.ejb.client.AsterixHome</home>
                              <remote>com.elaxy.example.ejb.client.Asterix</remote>
                              <ejb-class>com.elaxy.example.ejb.server.AsterixSession</ejb-class>
                              <session-type>Stateless</session-type>
                              <transaction-type>Container</transaction-type>
                    </session>
          </enterprise-beans>
</ejb-jar>