1 2 3 Previous Next 32 Replies Latest reply on Jul 21, 2006 5:56 AM by mad11max

    Fibo Tutorial on JBoss 4.0.2

    rhino Newbie

      I started out by trying the Fibo Tutorial on JBoss 4.0.2 using the JBoss/Eclipse IDE

      Every thing seemed to work well. The EAR file deployed ok and I was able to get the initial web page in my browser that has the input box and buttons. However, when I click the compute button, things didn't work and I got a message indicating there was a problem with the application "context"

      In the code, I traced this to the following lines in the Servlet:

      Context context = new InitialContext();
      Object ref = context.lookup("java:comp/env/ejb/Fibo");

      Despite much time and hair pulling, I installed JBoss 3.2.7 and then redeployed my EAR file.

      Guess what? Everything worked perfectly as it should have.

      The only thing I can figure out is that either JBoss 4.0.2 still has some issues, or else there is some additional configuration parameters that must be set in the Fibo application to make it work on JBoss 4.0.2

      Does anyone have a clue about this problem?

      Thanks.

        • 1. Re: Fibo Tutorial on JBoss 4.0.2
          Michael Dawson Newbie

          Check on this:

          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=63994

          Apparently having the Interface in more than one place confuses it.

          Good Luck,

          -Mike

          • 2. Re: Fibo Tutorial on JBoss 4.0.2
            rhino Newbie

            Thanks Mike.

            If I understand the other poster (you directed me in the link above) his problem was a result of having duplicate copies of the interface(s) class files packaged both in the EJB.jar and Web.war files.

            The Fibo tutorial specifies that the interface class files should be packaged in FiboEJB.jar and the FiboEJB-client.jar. The FiboEJB-client.jar is then packaged in the FiboWeb.war file. As a result, the interface(s) class files are packaged in two places in the final FiboApp.ear file.

            This is how I originally packaged the files.

            However, I do not believe it is the source of the problem.

            I tried not packaging the FiboEJB-client.jar(which has the second copy of the interfaces) in the FiboWeb.war file and found that the Fibo application still worked on JBoss 3.2.7 but not on JBoss 4.0.2.

            Below is the error message displayed in the browser when I click on the "Compute" button which causes the servlet to "try" to get a context with the following lines of code:

            Context context = new InitialContext();
            Object ref = context.lookup("java:comp/env/ejb/Fibo");


            This is the Error Message displayed in the browser:

            javax.servlet.ServletException: Lookup of java:comp/env/ failed
            tutorial.web.ComputeServlet.init(ComputeServlet.java:72)
            org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
            org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
            org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
            org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
            org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
            org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            java.lang.Thread.run(Thread.java:534)

            • 3. Re: Fibo Tutorial on JBoss 4.0.2
              - - Newbie

              Hi,
              I do get the same error, while trying the Fibo Tutorial. My Configuration is Jboss 4.0.2, Java 1.5, latest Jboss-Ide from the online ressource.
              What does the Erorr mean anyway?
              Does it mean, that the JNDI Service can not locate my ComputeServlet???

              Cheers Mathias

              • 4. Re: Fibo Tutorial on JBoss 4.0.2
                - - Newbie

                PS : I deployed the same FiboApp.Ear on a Jboss 4.01 and it worked!
                So the error seems to be Jboss 4.02 related.
                Cheers
                Mathias

                • 5. Re: Fibo Tutorial on JBoss 4.0.2
                  Mik clon Newbie

                  The same for me App working fine on 4.0.1 and not anymore on 4.0.2 It's seems that version 4.0.2 has intruduced some new bugs.... it's a shame.

                  • 6. Re: Fibo Tutorial on JBoss 4.0.2
                    joe yan Newbie

                    I worked on jboss 3.2.7,but i have to change
                    context.lookup("java:comp/evn/ejb/Fibo");
                    to
                    context.lookup("ejb/Fibo");
                    ,who can tell me the reason.
                    Jboss 4.0.2 not work.
                    thanks.
                    Joe

                    • 7. Re: Fibo Tutorial on JBoss 4.0.2
                      Andriniaina Rakotomalala Newbie

                      Has somebody found a solution for 4.0.2 ?

                      • 8. Re: Fibo Tutorial on JBoss 4.0.2
                        Frédéric EECKHOUT Newbie

                        Hi,

                        I'm using JBoss 4.0.2 and the last JBoss-IDE for Eclipse.
                        And this Fibo Tutorial doesn't work :
                        The EJB and Webapps deploy, but when I post to Fibo servlet, it gives me this exception :

                        root cause
                        java.lang.ClassCastException
                        com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
                        javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
                        ...

                        What can I do ?
                        Thanks

                        Fred

                        • 9. Re: Fibo Tutorial on JBoss 4.0.2
                          Frédéric EECKHOUT Newbie

                          This happen only with 4.0.2 !
                          Is there a BUG ? or what do we have to change ?

                          Thanks
                          Fred

                          • 10. Re: Fibo Tutorial on JBoss 4.0.2
                            Stephane Some Newbie

                            I have the same problem here with 4.0.2.

                            --
                            Stephan

                            • 11. Re: Fibo Tutorial on JBoss 4.0.2
                              Frédéric EECKHOUT Newbie

                              The solution I know, and what I have done, is to use the version 4.0.1 !

                              Good luck ;-)

                              Fred.

                              • 12. Re: Fibo Tutorial on JBoss 4.0.2
                                a a Newbie

                                Very strange. I'm running jboss 4.0.2.
                                First I have tried to implement the tutorial by myself.. and guess what! i stuck at he same look up problem.

                                Then after hours of debugging, I just downloaded the tutorial example and imported it in the workspace. It worked!

                                I just dont know what to do, I have checked everything, it is almoast exatly the same project, but it doesnt work =(((

                                May be jboss-people can give us some tips.

                                • 13. Re: Fibo Tutorial on JBoss 3.7
                                  werewr wewrer Newbie

                                  cannot get it to work even in 3.2.x

                                  • 14. Re: Fibo Tutorial on JBoss 4.0.2
                                    werewr wewrer Newbie

                                    error: javax.servlet.ServletException: Lookup of java:/comp/env/ failed
                                    open source: jboss 3.2.x eclipse
                                    j2ee1.4 and eclipse 3.0

                                    jboss web.xml
                                    <ejb-ref>
                                    <ejb-ref-name>ejb/Fibo</ejb-ref-name>
                                    <jndi-name>ejb/Fibo</jndi-name>
                                    </ejb-ref>

                                    web.xml

                                    <servlet-name>Compute</servlet-name>
                                    <display-name>Computation servlet</display-name>
                                    <![CDATA[Servlet that compute fibonacci suite]]>
                                    <servlet-class>tutorial.web.ComputeServlet</servlet-class>



                                    <servlet-mapping>
                                    <servlet-name>Compute</servlet-name>
                                    <url-pattern>/Compute</url-pattern>
                                    </servlet-mapping>
                                    <ejb-ref >
                                    <![CDATA[Reference to the Fibo EJB]]>
                                    <ejb-ref-name>ejb/Fibo</ejb-ref-name>
                                    <ejb-ref-type>Session</ejb-ref-type>
                                    tutorial.interfaces.FiboHome
                                    tutorial.interfaces.Fibo
                                    </ejb-ref>

                                    1 2 3 Previous Next