2 Replies Latest reply on Oct 8, 2007 4:48 PM by tjclifford

    java.lang.RuntimeException: Could not resolve beanClass met

    khosro_question

      Hi,
      When i run the program with ant ,it works.
      But when i run from NetBeans IDE i got the following error in :
      dao.createCabin(cabin_1);
      I copy and paste the files in IDE.

      The error is:

      Exception in thread "main" java.lang.RuntimeException: Could not resolve beanClass method from proxy call
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:248)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
      at org.jboss.remoting.Client.invoke(Client.java:1550)
      at org.jboss.remoting.Client.invoke(Client.java:530)
      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:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
      at $Proxy0.findCabin1(Unknown Source)
      at src.client.Client.main(Client.java:49)
      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:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
      at $Proxy0.findCabin1(Unknown Source)
      at src.client.Client.main(Client.java:49)

        • 1. Re:  java.lang.RuntimeException: Could not resolve beanClass
          tjclifford

          I'm getting the same error also, but with ex05_1, trying client_1.

          It gives me the error when trying to run the line:

          dao.updateCabin(cabin_2);

          there have been posts suggesting that the cause was the remote methods
          throwing exceptions that are not (subclasses of or...) RemoteException,
          but trying that did not work for me. This was at:
          http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg115960.htm//www.mail-archive.com/jboss-user@lists.sourceforge.net/msg115960.htm

          Also saw posts where suggesting adding a Home or LocalHome interface
          would take care of it, at:
          http://jira.jboss.com/jira/browse/EJBTHREE-1058

          but adding Home and/or LocalHome interfaces did no good. I still got
          the error when trying to run updateCabin().

          I'll keep searching and post anything I find here.......

          • 2. Re:  java.lang.RuntimeException: Could not resolve beanClass
            tjclifford

            The book sample ex05_1 has 4 clients.

            Client 1 tries to run updateCabin() within, I believe, a transaction-scoped
            context.

            Client 2 tries to also update the record, but it does it with a
            TransactionPersistenceContextBean, which specifies:

            @PersistenceContext(unitName="titan",
            type=PersistenceContextType.TRANSACTION)
            private EntityManager manager;

            rather than:

            @PersistenceContext(unitName="titan") private EntityManager manager;

            that TravelAgentBean uses.

            TravelAgentBean tries to use manager.merge() in its' updateCabin()
            method, while TransactionPersistenceContextBean uses an
            updateBedCount(int) method, which calls cabin.updateBedCount(int),
            apparently bypassing the manager altogether (?).

            I'm still learning this stuff, obviously; I'm not sure of the differences
            between using and not using an EntityManager; it does have to do with
            JTA, it seems.

            I'll have to go further in the book to see where it takes me....