2 Replies Latest reply on May 13, 2009 4:55 AM by Carlo de Wolf

    Problem in calling methods on EJB3 app from client

    llper llpah Newbie

      Hi,

      I'm trying to configure my jboss for a simple ejb3 module which is called from a java client.
      I'm using jboss 5.0.1.GA
      These are the config files involved:

      jbossweb.sar\server.xml:

      ...
      <Service name="jboss.web">
      
       <!-- A HTTP/1.1 Connector on port 8080 -->
       <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
       connectionTimeout="20000" redirectPort="8443"
       />
      
       <!-- Add this option to the connector to avoid problems with
       .NET clients that don't implement HTTP/1.1 correctly
       restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
       -->
      
       <!-- A AJP 1.3 Connector on port 8009 -->
       <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
       redirectPort="8443" />
      
       <!-- SSL/TLS Connector configuration using the admin devl guide keystore -->
       <Connector protocol="HTTP/1.1" SSLEnabled="true"
       port="8443" address="${jboss.bind.address}"
       scheme="https" secure="true" clientAuth="false"
       keystoreFile="${jboss.server.home.dir}/ssl/server.keystore"
       keystorePass="123456" sslProtocol = "TLS"
       />
      ...
      


      jboss.xml in [ejb3project]/META-INF:
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>forms.FormManager</ejb-name>
       <remote-binding>
       <jndi-name>forms.FormManager/remote</jndi-name>
       <client-bind-url>socket://${jboss.bind.address}:4446</client-bind-url>
       </remote-binding>
       <remote-binding>
       <jndi-name>forms.FormManager/http/private</jndi-name>
       <client-bind-url>
       http://${jboss.bind.address}:8080/unified-invoker/PrivateEjb3ServerInvokerServlet/?return-exception=true
       </client-bind-url>
       </remote-binding>
       <remote-binding>
       <jndi-name>forms.FormManager/http/public</jndi-name>
       <client-bind-url>
       https://${public.firewall.address}:8080/unified-invoker/PublicEjb3ServerInvokerServlet/?return-exception=true
       </client-bind-url>
       </remote-binding>
       </session>
       </enterprise-beans>
      </jboss>
      

      As you can see, I've also a configuration used to deploy ejb3 over Http.

      The client does the lookup in the following way:
      InitialContext ctx = new InitialContext();
      formManager = (FormManager) ctx.lookup(FormManager.JNDI_NAME);
      

      with:
      public static final String JNDI_NAME = "forms.FormManager/remote";
      java.naming.provider.url=192.168.1.116:1099
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      What is wrong? I've tried several ports instead of 4446 and I do not get best results an exception in StalessContainer.java:445.
      Unfortunately I've not found the source of StalessContainer.java, to look at it myself...

      somebody could help?






        • 1. Re: Problem in calling methods on EJB3 app from client
          llper llpah Newbie

          Sorry, port was not 4446 but ejb.deployer.port=3873.

          Here the stacktrace:

          java.lang.NullPointerException
           at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:445)
           at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
           at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
           at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
           at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
           at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
           at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
           at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
           at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
           at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
           at org.jboss.remoting.Client.invoke(Client.java:1634)
           at org.jboss.remoting.Client.invoke(Client.java:548)
           at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
           at $Proxy77.invoke(Unknown Source)
           at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
           at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
           at $Proxy68.persistEntity(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at bsh.Reflect.invokeMethod(Unknown Source)
           at bsh.Reflect.invokeObjectMethod(Unknown Source)
           at bsh.Name.invokeMethod(Unknown Source)
           at bsh.BSHMethodInvocation.eval(Unknown Source)
           at bsh.BSHPrimaryExpression.eval(Unknown Source)
           at bsh.BSHPrimaryExpression.eval(Unknown Source)
           at bsh.Interpreter.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
           at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
           at $Proxy77.invoke(Unknown Source)
           at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
           at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
           at $Proxy68.persistEntity(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflbsh % ect.Method.invoke(Unknown Source)
           at bsh.Reflect.invokeMethod(Unknown Source)
           at bsh.Reflect.invokeObjectMethod(Unknown Source)
           at bsh.Name.invokeMethod(Unknown Source)
           at bsh.BSHMethodInvocation.eval(Unknown Source)
           at bsh.BSHPrimaryExpression.eval(Unknown Source)
           at bsh.BSHPrimaryExpression.eval(Unknown Source)
           at bsh.Interpreter.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
          
          
          Thanks for any help


          • 2. Re: Problem in calling methods on EJB3 app from client
            Carlo de Wolf Master

            That piece of source is here: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/ejb3/tags/jboss-ejb3-core-1.0.0/src/main/java/org/jboss/ejb3/stateless/StatelessContainer.java?annotate=83287

            Apparently the business method called can't be found in the AOP Advisor.

            Could you try again using AS 5.1.0.CR1?
            If it fails there open up a Jira in https://jira.jboss.org/jira/browse/EJBTHREE.

            If possible attach source code which exhibits the problem.