6 Replies Latest reply on Mar 14, 2006 9:35 AM by kamal sharma

    Fibo tutorial

    kamal sharma Newbie


      Well I am very new to EJB.

      I have followed the steps exactly as in the tutorial.
      Everything is working fine, including the deployment of the EAR file.

      The only problem is that whenever I try to go to the servlet thro' the browser and press Compute it returns the null value in the output.

      I try to debug the program, but it halts at the home.create() stmt in the servlet.

      Can anybody help me with this.


        • 1. Re: Fibo tutorial
          kamal sharma Newbie

          Hiello Everyone,

          With debugging little more, I have found out that this part has problem:

          Context context=new InitialContext();
          Object ref=context.lookup("java:/comp/env/ejb/Fibo");
          home= (FiboHome) PortableRemoteObject.narrow(ref,FiboHome.class);

          The code throws an Exception while executing this.

          The printstacktrace is as follows:
          11:37:35,756 ERROR [STDERR] java.lang.ClassCastException
          11:37:35,758 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
          11:37:35,759 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
          11:37:35,760 ERROR [STDERR] at tutorial.web.ComputeServlet.init(ComputeServlet.java:45)
          11:37:35,761 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
          11:37:35,762 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
          11:37:35,763 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
          11:37:35,764 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
          11:37:35,765 ERROR [STDERR] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
          11:37:35,766 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
          11:37:35,767 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
          11:37:35,767 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
          11:37:35,768 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
          11:37:35,768 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
          11:37:35,769 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
          11:37:35,770 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
          11:37:35,770 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
          11:37:35,771 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
          11:37:35,773 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
          11:37:35,773 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
          11:37:35,775 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy53
          11:37:35,776 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
          11:37:35,777 ERROR [STDERR] ... 18 more

          Could anyone help me now.


          • 2. Re: Fibo tutorial
            Samu Geevarghese Newbie

            If you look in the package explorer and look at the src directory, class names etc. do you see exclamation marks (warning signs) in the project. You should remove those errors.

            You can match them up with the final source code displayed after the instructions, you should be missing some of the import statements.

            I did it the second time, all over again - going through each step. Also, be sure to check the section that mentions packaging of FiboEBJ-client.jar - please see my previous question on this. It is not really clear.

            Even after doing all this I see the directory listing page, instead of seeing the fibo .html page. Let me know if you are able to get it working

            • 3. Re: Fibo tutorial
              kamal sharma Newbie

              Ya my thing started to work,

              The only thing I did was to remove the Client.jar from the EAR file.

              And everything is working fine.

              Tell me if u are having any problem.


              • 4. Re: Fibo tutorial
                Samu Geevarghese Newbie


                Good to know, you have everything working :)

                I currently see the following page instead of the fibo page:



                • 5. Re: Fibo tutorial
                  Samu Geevarghese Newbie

                  I have fixed it - XDoclet configurations. Had an extra / in the **/*Servlet . .


                  • 6. Re: Fibo tutorial
                    kamal sharma Newbie

                    Good You finally have it working.

                    I think XDoclet was automatically generated na.

                    Also, Did you have the Client.jar in the EAR file or did you remove it.

                    Keep in touch.