6 Replies Latest reply on Oct 13, 2006 7:09 AM by fkelly

    Version Problem - Jboss 3.2.5 and jboss 4.0.2

    dineshg

      Hi all,

      I have developed a very small session bean which has a function and will return a string.
      i am using ant 1.6.5 for building the .ear file
      I successfully made the ear and deployed it over JBoss 3.2.5 and it deployed successfully
      And when i tried to deploy the same ear in JBoss 4.0.2 it has shown me error at the deployment time itself.

      Here is the Log File
      [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/E:/dinesh/jboss-4.0.2/server/default/deploy/Test.ear -> file:/E:/dinesh/jboss-4.0.2/server/default/deploy/Test.ear
      2006-10-02 17:52:42,000 INFO [STDOUT] Error found: java.lang.ClassCastException
      2006-10-02 17:52:43,593 INFO [STDOUT] java.lang.ClassCastException
      2006-10-02 17:52:43,593 INFO [STDOUT] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      2006-10-02 17:52:43,593 INFO [STDOUT] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      2006-10-02 17:52:43,593 INFO [STDOUT] at TestBean1.TestServlet.doGet(TestServlet.java:26)
      2006-10-02 17:52:43,593 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      2006-10-02 17:52:43,593 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-02 17:52:43,593 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2006-10-02 17:52:43,609 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
      2006-10-02 17:52:43,609 INFO [STDOUT] java.lang.NullPointerException
      2006-10-02 17:52:43,609 INFO [STDOUT] at TestBean1.TestServlet.doGet(TestServlet.java:46)
      2006-10-02 17:52:43,609 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      2006-10-02 17:52:43,609 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2006-10-02 17:52:43,609 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2006-10-02 17:52:43,609 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)

      Thnk U

        • 1. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
          peterj

          What are you passing to the PortableRemoteObject.narrow method? It should be the the remote home interface.

          • 2. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
            dineshg

            I passed the remote home interface, TestHome here.
            Here is the code

            RemoteHome Code

            package TestBean1;
            
            import javax.ejb.*;
            import java.rmi.*;
            
            public interface TestHome extends EJBHome
            {
             public TestBean1.Test create() throws RemoteException,CreateException;
            
            }
            


            Remote Interface Code

            package TestBean1;
            
            import javax.ejb.*;
            import java.rmi.*;
            
            public interface Test extends EJBObject
            {
             public String getValue()throws RemoteException;
            
            }
            


            EJB Bean Class
            package TestBean1;
            
            import javax.ejb.*;
            import javax.sql.*;
            import javax.naming.*;
            import javax.rmi.PortableRemoteObject;
            import java.sql.*;
            public class TestEJB implements SessionBean
            {
             public void ejbCreate()throws CreateException {
            
             }
            
             public String getValue(){
             System.out.println("################## INSIDE #######################");
            
             return "TEST BEAN123 from testEJB";
             }
            
             public void ejbRemove()throws EJBException{}
             public void ejbActivate()throws EJBException{}
             public void ejbPassivate()throws EJBException{}
             public void setSessionContext(SessionContext sc)throws EJBException{}
            }
            


            Here is the ejb-jar.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

            <ejb-jar>
            Test Bean Jar
            <display-name>Test jar </display-name>
            <enterprise-beans>

            <display-name>TestEJB</display-name>
            <ejb-name>TestEJB</ejb-name>
            TestBean1.TestHome
            TestBean1.Test
            <ejb-class>TestBean1.TestEJB</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>



            <assembly-descriptor>

            </assembly-descriptor>

            </enterprise-beans>
            </ejb-jar>

            • 3. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
              sreeharips

              refer this page from your home directory
              jboss-4.0.2\readme.html

              which contains.. the solution for

              Configuration Issues

              • 4. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
                dineshg

                Hi all,

                i have solved the problem.i have changed the two files of jboss-4.0.2 - conf/jboss-service.xml and deploy/ear-deployer.xml file as said in the readme file given by jboss.

                Thank You for ur reply

                • 5. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
                  fkelly

                   

                  "dineshg" wrote:
                  Hi all,

                  i have solved the problem.i have changed the two files of jboss-4.0.2 - conf/jboss-service.xml and deploy/ear-deployer.xml file as said in the readme file given by jboss.

                  Thank You for ur reply



                  Please post details of the changes you put into the above files or a reference to where you found the solution in the readme file.

                  Thanks

                  • 6. Re: Version Problem - Jboss 3.2.5 and jboss 4.0.2
                    fkelly

                     

                    "fkelly" wrote:
                    "dineshg" wrote:
                    Hi all,

                    i have solved the problem.i have changed the two files of jboss-4.0.2 - conf/jboss-service.xml and deploy/ear-deployer.xml file as said in the readme file given by jboss.

                    Thank You for ur reply



                    Please post details of the changes you put into the above files or a reference to where you found the solution in the readme file.

                    Thanks


                    Got it. Thanks

                    CallByValue must be set to true in both files. This works in 4.0.3SP1

                    Is mise