5 Replies Latest reply on Jul 9, 2003 4:49 AM by Keith Pemberton

    Just can't make it work...

    Keith Pemberton Newbie

      I have one entity bean (BlogEJB) and one session bean (BlogAdderEJB) that I am trying to use for a simple blogging site. I have tried to access the body content of one of the entries out of the database using the session bean calling the entity beans findByPrimayKey method. All of my files that i am working with are attached to this post. I must be overlooking something somewhere because I keep getting a "METHOD IS NOT FOUND" exception on the method that I am calling from the session bean which is supposed to call the entity bean. Your help is very much apprecaited. I have been racking my brains on this one for a solid week now.

      Keith

        • 1. Re: Just can't make it work...
          Keith Pemberton Newbie

          Here are some more of the files

          • 2. Re: Just can't make it work...
            Keith Pemberton Newbie

            And the rest of the files

            • 3. Re: Just can't make it work...
              Raja Master

              where are u getting the exception? In the session bean or in the TestClient? Can you post the stack trace?

              Also, one other thing. do u have the same VM Version on the TestClient and the one running Jboss. It doesnt really matter but just curious!!

              -Raj

              • 4. Re: Just can't make it work...
                Keith Pemberton Newbie

                I am getting the exception when I run the test client. The exception, though, is coming when I try to run the getBlogBody() method on BlogAdderRemote interface. Here is the stack trace from running the TestClient:

                java.lang.IllegalStateException: METHOD IS NOT FOUND
                at org.jboss.invocation.MarshalledInvocation.getMethod(MarshalledInvocation.java:239)
                at org.jboss.ejb.Container.invoke(Container.java:673)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                at sun.rmi.transport.Transport$1.run(Transport.java:148)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                at java.lang.Thread.run(Thread.java:534)
                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
                at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
                at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:87)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
                at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
                at $Proxy1.getBlogBody(Unknown Source)
                at TestClient.main(TestClient.java:21)

                What bothers me is the second line from the bottom that says $Proxy1.getBlogBody(Unknown Source). Why is it an unknown source? I am just passing an Integer value to the method. I am using the same VM version for both JBoss and the test client. I am trying to run the TestClient under NetBeans. You help is much appreciated! I have tried the CabinEJB and TravelAgentEJB from the Oreilly Enterprise JavaBeans book and they work just fine. I have followed their model as closely as I can (with obvious changes to meet the requirements of my bean classes) but I still can't get this to work.

                Keith

                • 5. Re: Just can't make it work...
                  Keith Pemberton Newbie

                  I finally was able to get this thing to work. I had some wierd caching problem going on where the wrong version of the BlogAdderHomeRemote interface was being loaded. I didn't figure this out, though, until I had completely redone all the class files and DDs. I had changed the name of the BlogAdderRemote interface to just BlogAdder and tried deploying in JBoss. Well, it kept throwing an exception on deployment saying that the return type from the create() method in BlogAdderHomeRemote needed to be cast as BlogAdderRemote. I thought that was odd because I hadn't deployed a BlogAdderRemote class in the jar file inwhich I was trying to deploy and neither did I want a BlogAdderRemote class. I finally gave up on the name of BlogAdder* and switch it to Blogger*. This fixed all the problems after of course changing the DDs to reflect the new name. Thanks to anyone who looked at my code. I hope to be able to help some of you out as well someday...

                  Keith