9 Replies Latest reply on Nov 3, 2005 8:46 AM by adrian.brock

    Problem with JBoss 4.0.3

      Dear All,

      I have an EAR application containg an ejb module and a war module.
      The war module contains a simple servlet that calls a simple stateteless ejb to perform the hello method.
      The application has been created and compiled using th JBoss-4.0.3 libraries.
      The same EAR application works fine if deployed in the JBoss-4.0.1SP1 container. If I deploy the application in the JBoss-4.0.3 container it doesn't work and I have the following message:
      Is someone able to answer this problem?

      Many thanks,
      Giordano


      17:30:24,515 INFO [STDOUT] -- Initializing bean access.
      17:30:24,609 INFO [STDOUT] -- Succeeded initializing bean access through Home i
      nterface.
      17:30:24,609 INFO [STDOUT] -- Execution time: 94 ms.
      17:30:24,609 INFO [STDOUT] -- Calling create()
      17:30:24,687 ERROR [LogInterceptor] EJBException in method: public abstract test
      servlet2.MySaluto testservlet2.MySalutoHome.create() throws javax.ejb.CreateExce
      ption,java.rmi.RemoteException:
      javax.ejb.EJBException: Invalid invocation, check your deployment packaging, met
      hod=public abstract testservlet2.MySaluto testservlet2.MySalutoHome.create() thr
      ows javax.ejb.CreateException,java.rmi.RemoteException
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHo
      me(StatelessSessionContainer.java:161)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
      keHome(CachedConnectionInterceptor.java:180)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(
      StatelessSessionInstanceInterceptor.java:83)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractIntercep
      tor.java:90)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValida
      tionInterceptor.java:41)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:110)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:335)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
      va:146)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      21)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
      actoryFinderInterceptor.java:93)
      at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.ja
      va:613)
      at org.jboss.ejb.Container.invoke(Container.java:894)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(Loca
      lInvoker.java:155)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)

      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerIntercepto
      r.java:179)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
      a:165)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
      java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:5
      5)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      at $Proxy54.create(Unknown Source)
      at testservlet2.MySalutoTestClient1.create(MySalutoTestClient1.java:91)
      at testservlet2.Servlet1.init(Servlet1.java:22)
      at javax.servlet.GenericServlet.init(GenericServlet.java:211)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
      java:1091)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.jav
      a:750)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:130)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      17:30:24,687 INFO [STDOUT] -- Failed : create()
      17:30:24,687 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exce
      ption is:
      javax.ejb.EJBException: Invalid invocation, check your deployment packag
      ing, method=public abstract testservlet2.MySaluto testservlet2.MySalutoHome.crea
      te() throws javax.ejb.CreateException,java.rmi.RemoteException
      17:30:24,687 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleEx
      ception(LogInterceptor.java:352)
      17:30:24,687 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
      me(LogInterceptor.java:125)
      17:30:24,687 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
      ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      17:30:24,687 INFO [STDOUT] at org.jboss.ejb.SessionContainer.internalInvoke
      Home(SessionContainer.java:613)
      17:30:24,687 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java
      :894)
      17:30:24,687 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(
      Native Method)
      17:30:24,687 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(N
      ativeMethodAccessorImpl.java:39)
      17:30:24,687 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invo
      ke(DelegatingMethodAccessorImpl.java:25)
      17:30:24,687 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:5
      85)
      17:30:24,687 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.
      invoke(ReflectedDispatcher.java:141)
      17:30:24,687 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invoc
      ation.java:80)
      17:30:24,687 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocat
      ion.java:72)
      17:30:24,687 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invo
      ke(AbstractMBeanInvoker.java:245)
      17:30:24,687 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
      eanServerImpl.java:644)
      17:30:24,687 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker$MBean
      ServerAction.invoke(LocalInvoker.java:155)
      17:30:24,687 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invok
      e(LocalInvoker.java:104)
      17:30:24,687 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invok
      eLocal(InvokerInterceptor.java:179)
      17:30:24,687 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invok
      e(InvokerInterceptor.java:165)
      17:30:24,687 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke
      (TransactionInterceptor.java:46)
      17:30:24,687 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(Se
      curityInterceptor.java:55)
      17:30:24,687 INFO [STDOUT] at org.jboss.proxy.ejb.HomeInterceptor.invoke(Ho
      meInterceptor.java:169)
      17:30:24,687 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(Client
      Container.java:86)
      17:30:24,687 INFO [STDOUT] at $Proxy54.create(Unknown Source)
      17:30:24,687 INFO [STDOUT] at testservlet2.MySalutoTestClient1.create(MySal
      utoTestClient1.java:91)
      17:30:24,687 INFO [STDOUT] at testservlet2.Servlet1.init(Servlet1.java:22)
      17:30:24,687 INFO [STDOUT] at javax.servlet.GenericServlet.init(GenericServ
      let.java:211)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.load
      Servlet(StandardWrapper.java:1091)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.allo
      cate(StandardWrapper.java:750)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve
      .invoke(StandardWrapperValve.java:130)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve
      .invoke(StandardContextValve.java:178)
      17:30:24,687 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipal
      Valve.invoke(CustomPrincipalValve.java:39)
      17:30:24,687 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssocia
      tionValve.invoke(SecurityAssociationValve.java:159)
      17:30:24,687 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValv
      e.invoke(JaccContextValve.java:59)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.in
      voke(StandardHostValve.java:126)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.i
      nvoke(ErrorReportValve.java:105)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.
      invoke(StandardEngineValve.java:107)
      17:30:24,687 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.s
      ervice(CoyoteAdapter.java:148)
      17:30:24,687 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.proc
      ess(Http11Processor.java:856)
      17:30:24,687 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http1
      1ConnectionHandler.processConnection(Http11Protocol.java:744)
      17:30:24,687 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.pr
      ocessSocket(PoolTcpEndpoint.java:527)
      17:30:24,687 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerT
      hread.run(MasterSlaveWorkerThread.java:112)
      17:30:24,687 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      17:30:24,703 INFO [STDOUT] Caused by: javax.ejb.EJBException: Invalid invocatio
      n, check your deployment packaging, method=public abstract testservlet2.MySaluto
      testservlet2.MySalutoHome.create() throws javax.ejb.CreateException,java.rmi.Re
      moteException
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$Conta
      inerInterceptor.invokeHome(StatelessSessionContainer.java:161)
      17:30:24,703 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:180)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.StatelessSessionInstanc
      eInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:83)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractInterceptor.inv
      okeHome(AbstractInterceptor.java:90)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationIntercept
      or.invokeHome(CallValidationInterceptor.java:41)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:110)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:335)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      Home(TxInterceptorCMT.java:146)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      okeHome(SecurityInterceptor.java:130)
      17:30:24,703 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
      me(LogInterceptor.java:121)
      17:30:24,703 INFO [STDOUT] ... 40 more
      17:30:24,703 INFO [STDOUT] -- Return value from create(): null.
      17:30:24,828 INFO [STDOUT] Error in hello(): Remote interface reference is null
      . It must be created by calling one of the Home interface methods first.

        • 1. Re: Problem with JBoss 4.0.3
          pmlogan

          I'm receiving the same error when executing the create on a local. My remote invocation seems to be working just fine. Both local and home
          interfaces are created by Xdoclet, so I can't see why one would work
          and not the other. In JBoss 4.0.3, the UseJBossWebLoader flag was
          switched from true to false as default. When the flag is true, all works
          fine. When the flag is false with 4.0.3, only the remote EJB calls work.
          I'm running with an exploaded ear which includes an exploaded war.

          Please post your findings when you have success. I will also do so.

          • 2. Re: Problem with JBoss 4.0.3
            adellechiaie

            I've the same situation, an exploded ear with an exploded war and an exploded jar.
            The same application is working on JBoss 4.0.2, we're going to go in production.
            If I use the 4.0.3 server out of the box (with the UseJBossWebLoader = false) my application doesn't work, if I switch UseJBossWebLoader = true it works.
            The application has a web layer using a command that through an action class calls a SLSB that has only remote interfaces.
            This SLSB (called webLayer) uses some SLSBs that have only local interfaces. This "local" SLSBs use a class called DBAgent that obtains a JDBC connection from a resource pool, uses for getting or setting data in the database and then "closes" the connection releasing it to the pool.
            The problem I have is that I get an NoClassDefFoundError exception when an "internal" SLSB is trying to access a DBAgent.
            What I have to do???? I'd like to understand...
            Ciao

            • 3. Re: Problem with JBoss 4.0.3
              starksm64
              • 4. Re: Problem with JBoss 4.0.3
                erik777

                I get the just of what it's doing, but I don't understand why I can't call-by-value.

                I have only been able to successfully get call-by-value to work inside the same JBoss instance when one isolated app calls another isolated app. I have yet to be able to get an unisolated app to be able to make a call by value to another unisolated app in the same JVM, or for an unisolated app to call an isolated app. Because of the latter use case, I have a lot of unisolated apps because they need to call apps that need to call apps that ultimately can't be isolated either because they are using a hiberante 2 sar or because they contain an MDB which seems to have a bug preventing isolation.

                In the most recent case, I'm trying to resolve a class cast exception on the home interface (see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=71799). So, I set

                <attribute name="CallByValue">true</attribute>
                for the NamingService in jboss-service.xml. That causes the invalid invocation exception. If i'm asking it to use call by value for all naming lookups, then why is it throwing an exception caused by an attempt to pass by reference between two class loaders?

                I read somewhere that even if you provide a URL, JBoss detects that it is an intra-JBoss instance call, and converts it to a call by reference. Is there a way to disable this behavior? It would be nice to be able to control when it passes by reference and when it passes by value, and the URL is the most convenient way I can think of to do this. If you don't provide a URL, then clearly you want to pass by reference, or at least invoke locally.


                • 5. Re: Problem with JBoss 4.0.3

                  Dear all,

                  until JBoss-4.0.1SP1 release the UseJBossWebLoader flag was set to true by default and all worked fine. Starting from JBoss-4.0.2 release the UseJBossWebLoader flag is set to false by default. I set it to true and all works fine!

                  Bye,
                  Giordano

                  • 6. Re: Problem with JBoss 4.0.3
                    erik777

                    LOL! That's what I discovered yesterday. I can definately confirm it.

                    • 7. Re: Problem with JBoss 4.0.3
                      starksm64

                      The call-by-value settings disable any optimization attempts. The various class loading configurations map as described in the following class loading links. If these do not describe why there are class cast issues describe why.

                      http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases
                      http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration

                      • 8. Re: Problem with JBoss 4.0.3

                        Dear All,

                        at this point my question is:

                        can I deploy and run an EAR application (with a web module and an ejb module as I wrote above) without problems with the UseJBossWebLoader flag set to false? Or this flag has always to be set to true?

                        Thanks and bye,
                        Giordano

                        • 9. Re: Problem with JBoss 4.0.3