5 Replies Latest reply on Apr 20, 2010 10:23 AM by hemil shah

    JBOSS 5.1.0 + Tomcat 5.5

    hemil shah Newbie

      Hi,

       

      I have following environments -

       

      Client side -

       

      Tomcat 5.5

      Compiled and running with JDK/JRE 1.5

       

      Server side -

      JBOSS 5.1.0 running with JRE 1.6

      Code compiled with JDK 1.5

       

      Now, client on Tomcat makes a remote  EJB(EJB 3.0) call on JBOSS server. The client is able to lookup the EJB bean  on JBOSS server but when i typecast the looked up bean object to Remote interface, it gives ClassCastException.

       

      I would like to understand if there is anything wrong in my environment and if there is then what should i do to make it successful. Truly, i cannot make any change on client so whatever change i will be able to do is on server.

       

      Please suggest.

       

      Thanks.

      Regards,

      Hemil

        • 1. Re: JBOSS 5.1.0 + Tomcat 5.5
          Peter Johnson Master

          Please post the code making the lookup and the cast. Also post the full log entry, or console output, containing the stack trace.

           

          Also, where is the remote interface located on the Tomcat system?

          • 2. Re: JBOSS 5.1.0 + Tomcat 5.5
            hemil shah Newbie

            Hi,

             

            Here is some code snippet performing the lookup

             

            public static NotifyResponseTO sendNotification(NotifyTO notifyTO) throws NotificationException {
              NotificationServiceBeanRemote notificationHandler = (NotificationServiceBeanRemote)ServiceLocator.serviceLookUp("NotificationServiceEAR/NotificationServiceBean/remote");
            }

             

            This is where casting is occuring.

             

            Unfortunately i wont be able to generate the full stace trace presently. The remote interface NotificationServiceRemote is on the client side (Tomcat server)  and this is where the lookup is also happening.

             

            The exception begins with trace -

             

            Java.lang.ClassCastException:javax.naming.Reference.

             

            Thanks.

            Regards,

            Hemil

            • 3. Re: JBOSS 5.1.0 + Tomcat 5.5
              hemil shah Newbie

              Hi,

               

              I changed JBOSS version to jboss 5.0.1 GA to make the JVM 1.5 across both JBOSS and Tomcat system. But still i get the below exception -

               

              2010-04-19 12:44:29,027 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Could not complete request>
              java.lang.ClassCastException: javax.naming.Reference
              at com.notification.util.NotificationServiceUtil.sendNotification(NotificationServiceUtil.java:12)
              at service.planning.UserRegistration.UserRegistrationImpl.save(UserRegistrationImpl.java:425)
              at controllers.SaveDataController.handle(SaveDataController.java:93)
              at org.springframework.web.servlet.mvc.AbstractCommandController.handleRequestInternal(AbstractCommandController.java:81)
              at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
              at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
              at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:743)
              at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:681)
              at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:395)
              at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:359)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at validators.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:24)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
              at java.lang.Thread.run(Thread.java:595)

               

              Please let me know the way forward to resolve this issue.

               

              Thanks.

              Regards,

              Hemil

              • 4. Re: JBOSS 5.1.0 + Tomcat 5.5
                hemil shah Newbie

                Hello anyone,

                 

                does it require to perform steps mentioned in the document http://docs.jboss.org/jbossas/admindevel326/html/ch9.chapt.html

                 

                to perform jboss and tomcat integration.

                 

                Please let me know the steps required o integrate jboss and tomcat server. Presently i am able to integrate if both the server are installed on the same system, but  if both are on the different system, then it gives me above exception.

                 

                M feeling really tired now.

                 

                Awaiting response !!!

                 

                Regards,

                Hemil

                • 5. Re: JBOSS 5.1.0 + Tomcat 5.5
                  hemil shah Newbie

                  Finally, the issue got resolved. !!!

                   

                  All i did was added all jboss related client jars (found under Manifest.mf file of jbossall-client.jar)on Tomcat server and finally EJB communication started between Tomcat and JBOSS server.

                   

                  More information can be found from the following URL. Very useful for all those facing the same issue.

                   

                  http://forums.sun.com/thread.jspa?threadID=619429

                   

                  If there is any better solution, please let me know.

                   

                  Thanks.

                  Regards,

                  Hemil