axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg <jo...@linnenkohl.org>
Subject Lookup for an EJB on a JBoss AS 7 from an Axis2 Webservice runs into a javax.naming.NameNotFoundException
Date Fri, 02 Aug 2013 08:50:04 GMT
 Hello,
 first of all I'm new on this mailing list but I'm working for several 
 years with Axis2.
 But now after reading some books and articles I've a problem with the 
 collaboration of Axis2 and JBoss AS7.
 Our situation: we run a bunch of Webservices based on Tomcat 
 7.0.22/Axis2 1.5.4. Now for one web service
 the business logic has changed and the service has to connect to an 
 remote ejb running on a JBoss AS 7.1.1.
 The code:
 very simple: first of all I created a little standalone client for this 
 remote ejb and everything works fine.
 Then I placed the code in the webservice, and the jndi lookup failed.

 The code:

    public void doIt()
    {
          // SOME OTHER STUFF

          String ejburl = "ejb:"
                         + "app-ejb"
                         + "/" + "app-ejb-1.0"
                         + "/" + "/" + "AppImpl" + "!"
                         + "app.App";

         Properties clientProp = new Properties();
         
 clientProp.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", 
 "false");
         clientProp.put("remote.connections", "default");
         clientProp.put("remote.connection.default.port", "4447");
         clientProp.put("remote.connection.default.host", "localhost");
         clientProp.put("remote.connection.default.username", "myuser");
         clientProp.put("remote.connection.default.password", "mypwd");
         
 clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS",

 "false");

         try {
           org.jboss.ejb.client.EJBClientConfiguration cc
                = new 
 org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration(clientProp);
           
 org.jboss.ejb.client.ContextSelector<org.jboss.ejb.client.EJBClientContext> 
 selector
                       = new 
 org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector(cc);
           org.jboss.ejb.client.EJBClientContext.setSelector(selector);

           Hashtable<String, Object> jndiProps = new Hashtable<String, 
 Object>();
           jndiProps.put(Context.URL_PKG_PREFIXES, 
 "org.jboss.ejb.client.naming");
           javax.naming.Context context = new 
 javax.naming.InitialContext(jndiProps);

           logInfo( "try lookup with "+ejburl );
           java.lang.Object obj = context.lookup( ejburl );

         } catch( Exception e ) {
         }

      }

 The error:
 when doIt() is called, it goes to context.lookup() and then throws the 
 exception:
 javax.naming.NameNotFoundException: Name ejb:app-ejb is not bound in 
 this Context
 On the other side I find in the JBoss log:
 09:51:55,663 ERROR [org.jboss.remoting.remote.connection] (Remoting 
 "localhost" read-1) JBREM000200: Remote connection failed: 
 java.io.IOException: Received an invalid message length of -2140864253
 So something goes to the JBoss but nothing what he expects.
 Since this code runs in a standalone program it seems that the Axis2 
 System changes the protocol message. Maybe I've to do some configuration 
 stuff?
 Does anyone has experience in this area? So I will be grateful for some 
 hints.

 Best wishes

 Jörg





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message