13 Replies Latest reply on Aug 6, 2013 8:43 PM by ybxiang.china

    JBAS014775  deploying ejb from jboss4 to Jboss6

    lili2013

      Hello

       

      I am trying to migrate my Jboss server from Jboss 4.1 to JBoss 6.1 version.

      It seems my datasource can work now after add <datasource> in standalone.xml, I can see it in my Jboss Management/Status/Subsystems/Datasources and there is no error about it when jboss was starting.

      When I deploy a ejb jar,  the following stacktrace are shown, I cannot get any idea about it.

      --------------------------------------------------------------------------------------

      14:58:54,102 INFO  [org.jboss.modules] (main) JBoss Modules version 1.2.0.Final-redhat-1
      14:58:54,757 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1
      14:58:54,835 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015899: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) starting
      14:58:57,159 INFO  [org.xnio] (MSC service thread 1-3) XNIO Version 3.0.7.GA-redhat-1
      14:58:57,190 INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.0.7.GA-redhat-1
      14:58:57,190 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
      14:58:57,253 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remotingversion 3.2.16.GA-redhat-1
      14:58:57,346 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem
      14:58:57,346 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem
      14:58:57,362 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2]
      14:58:57,377 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.
      14:58:57,377 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 46)JBAS015537: Activating WebServices Extension
      14:58:57,892 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service
      14:58:58,079 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013170:Current PicketBox version=4.0.17.Final-redhat-1
      14:58:58,141 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
      14:58:58,157 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.17.Final-redhat-1)
      14:58:58,485 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
      14:58:58,656 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version5.1)
      14:58:58,672 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.1.3.Final-redhat-3
      14:58:59,280 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC servicethread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
      14:58:59,280 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC servicethread 1-4) JBAS010400: Bound data source [java:jboss/datasources/MySqlDS]
      14:58:59,327 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/127.0.0.1:8080
      14:58:59,342 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-/127.0.0.1:8080
      14:58:59,639 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread1-4) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-eap\standalone\deployments
      14:58:59,654 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "TestDefault.ear" (runtime-name: "TestDefault.ear")
      14:58:59,685 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100:Listening on 127.0.0.1:9999
      14:58:59,685 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100:Listening on 127.0.0.1:4447
      14:59:00,200 WARN  [org.jboss.metadata.parser.jboss.JBossAppMetaDataParser] (MSC service thread 1-3) loader-repository element in jboss-app.xml is deprecated and has been ignored
      14:59:02,087 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "null" (runtime-name: "TestDefault.war")
      14:59:02,087 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "null" (runtime-name: "EJB_TestDefault.jar")
      14:59:02,274 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean name
      d TestDefault_ProxyBean in deployment unit subdeployment "EJB_TestDefault.jar" of deployment "TestDefault.ear" are as follows:

              java:global/TestDefault/EJB_TestDefault/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalHome
              java:app/EJB_TestDefault/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalHome
              java:module/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalHome
              java:global/TestDefault/EJB_TestDefault/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalComponent
              java:app/EJB_TestDefault/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalComponent
              java:module/TestDefault_ProxyBean!com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalComponent

      14:59:02,727 INFO  [org.jboss.web] (ServerService Thread Pool -- 53) JBAS018210: Register web context: /test_default
      14:59:03,101 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "TestDefault.ear" (runtime-name : "TestDefault.ear")
      14:59:03,101 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
      JBAS014775:    New missing/unsatisfied dependencies:
            service jboss.naming.context.java.jboss.resources.jboss.datasources.MySqlDS (missing) dependents: [service jboss.naming.context.java.comp.TestDefault.EJB_TestDefault.TestDefault_ProxyBean.env.jboss.datasources.MySqlDS]


      14:59:03,148 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
      14:59:03,148 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
      14:59:03,148 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) started (with errors) in 10808ms - Started 2
      48 of 317 services (5 services failed or missing dependencies, 62 services are passive or on-demand)

      ------------------------------------------------------------------------------------------------------

      jboss.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

      <jboss>

      <enterprise-beans>

      <session>

      <ejb-name>TestDefault_ProxyBean</ejb-name>

      <local-jndi-name>ejb/TestDefault/ProxyBean</local-jndi-name>

      <resource-ref>

           <res-ref-name>jboss/datasources/MySqlDS</res-ref-name>

           <jndi-name>java:jboss/datasources/MySqlDS</jndi-name>

          </resource-ref>

      </session>

      </enterprise-beans>

      </jboss>

      ------------------------------------------------------------------------------------------------------

      jndi.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <jndiConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:noNamespaceSchemaLocation="./jndi.xsd">

      <jndiList>

        <jndi key="ejb_TestProxyBean"

         jndiName="java:comp/env/ejb/Test/ProxyBean" envRef="Env" />

        <jndi key="DS_Test"

         jndiName="java:comp/env/jboss/datasources/MySqlDS" envRef="Env" />

      </jndiList>

      <environments>

        <environment name="Env">

         <property key="javax.naming.Context.INITIAL_CONTEXT_FACTORY"

         value="org.jnp.interfaces.NamingContextFactory" />

         <property key="javax.naming.Context.PROVIDER_URL"

          value="localhost:1199" />

         <property key="javax.naming.Context.URL_PKG_PREFIXES"

          value="org.jboss.naming:org.jnp.interfaces" />

        </environment>

      </environments>

      </jndiConf>

      ------------------------------------------------------------------------------------------------------

      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 id="ejb-jar_ID">

      <display-name>EJB_TestDefault</display-name>

      <enterprise-beans>

               <session id="TestDefault_ProxyBean">

                  <display-name>TestDefault_ProxyBean</display-name>

                  <ejb-name>TestDefault_ProxyBean</ejb-name>

                  <local-home>com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalHome</local-home>

                  <local>com.jri.junc.sample2.bf.coop.sg.ejb.StatelessLocalComponent</local>

                  <ejb-class>com.jri.junc.sample2.bf.bc.businesslogic.ProxyBean</ejb-class>

                  <session-type>Stateless</session-type>

                  <transaction-type>Container</transaction-type>

                  <resource-ref id="ResourceRef_1128482369700">

                   <description></description>

                   <res-ref-name>jboss/datasources/MySqlDS</res-ref-name>

                   <res-type>javax.sql.DataSource</res-type>

                   <res-auth>Container</res-auth>

                   <res-sharing-scope>Shareable</res-sharing-scope>

                  </resource-ref>

               </session>

            </enterprise-beans>

      </ejb-jar>

      ------------------------------------------------------------------------------------------------------

      application.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">

      <application id="TestDefault">

      <display-name>TestDefault</display-name>

      <module id="EJB_Test.jar">

        <ejb>EJB_TestDefault.jar</ejb>

      </module>

      <module id="TestDefault.war">

        <web>

         <web-uri>TestDefault.war</web-uri>

         <context-root>test_default</context-root>

        </web>

      </module>

      </application>

      ------------------------------------------------------------------------------------------------------

      I appreciate any guidance.Thanks.

      Regards

      Bates

        • 1. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
          lili2013

          I am new to Jboss, I have spent three days on it.

          I tried to change some JNDI in jboss.xml and ejb-jar.xml, but still failed, and strangely, the stacktraces are the same completely.

          What should I do? I appreciate for any guidance

          Thanks in advance.

          • 2. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
            ybxiang.china

            why NOT just migrate it to JBoss AS 7 ?

             

            JBoss AS 6 is too fat!

            • 3. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
              ybxiang.china

              EJB3 is only suppored since JBoss AS 4.2.3.

              So, I think you must rewrite your EJBs.

              (Please forget EJB V1 or EJB V2.)

              • 4. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                lili2013

                Thank you for your suggestion. I will try AS7 or write EJB3.Thank you very much.

                • 5. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                  ybxiang.china

                  "Enterprise JavaBeans 3.1" is a very good book, written by JBoss guys.

                   

                  EJB3 is very very simple when compared with EJB v2.

                   

                  I think you had better remove jboss.xml and ejb-jar.xml if possible (I really hate them).

                  Annotations are enough for most EJB definitions.

                  • 6. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                    lili2013

                    Thank you for your suggestion about this book, I will read it, thank you very much.

                    • 7. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                      sfcoy

                      You're already running JBossAS 7.2, aka EAP 6.1.0:

                           14:58:54,835 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015899: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) starting

                       

                      xiang yingbing makes some good suggestions, but for many people this is expensive and impractical.

                       

                      In your case, you just need to fix a couple of things to get your datasource access working.

                       

                      You need to replace jboss.xml with the new jboss-ejb3.xml file. It has a similar structure, but you should make sure that it conforms to the schema ($JBOSS_HOME/docs/schema/jboss-ejb3-2_0.xsd).

                       

                       

                      In addition to this you don't appear to know the relationship between a res-ref-name and JNDI.

                      The res-ref-name "jboss/datasources/MySqlDS" corresponds to the ENC JNDI name "java:comp/env/jboss/datasources/MySqlDS" which is a name that is local to the component.

                      ENC JNDI names such as this must be mapped to the global JNDI name configured in the server "java:jboss/datasources/MySqlDS" in your jboss-ejb3.xml file.

                       

                      In any event, the content of your jboss.xml just needs to be moved to a corresponding jboss-ejb3.xml file.

                      • 8. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                        lili2013

                        Thank you for your suggestion, I will try it, thank you very much.

                        • 9. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                          lili2013

                          Hi,

                           

                          I'm new to that, I just think res-ref-name is the name by which  JNDI is referenced in applications.  Would you mind telling me the reason that you think [The res-ref-name "jboss/datasources/MySqlDS" corresponds to the ENC JNDI name "java:comp/env/jboss/datasources/MySqlDS" which is a name that is local to the component.]?  The JNDI following res-ref-name "jboss/datasources/MySqlDS"  is "java:jboss/datasources/MySqlDS", so I feel it is a little strange that you think it is local. (jndi.ini)<jndiName="java:comp/env/jboss/datasources/MySqlDS" envRef="Env" /> is not a jndiName, it's a referent name in my application. I am sorry for forgetingt saying it.

                           

                          It seems that jboss-ejb3.xml  is very like ejb-jar.xml. Does it mean both jboss.xml and ejb-jar.xml need to move into jboss-ejb3.xml? I have been looking for samples about joss-ejb3.xml(sessioin bean)  for days, but still cannot find it. I appreciate for suggesion.

                           

                          Any suggestions are appreciated,Thanks in advance.

                          • 10. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                            sfcoy

                            Have a look at my answer to Message-driven bean activation-config and JNDI and see if that helps your understanding.

                            1 of 1 people found this helpful
                            • 11. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                              ybxiang.china

                              Poor guy, .

                              If I were forced by my boss to migrate EJB1 or EJB2 to EJB3, I would rather rewrite all in EJB3 or leave the company.

                              I hate to read too old codes. I like new project and new technologies.

                              • 12. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                                nickarls

                                Old code can be re-written, too. I think a programmer than can do good rewrites is actually more valuable to a company than the "I only code on EE8"-type programmers that will leave the company as soon as it's no longer fun ;-)

                                 

                                But new projects are nice, I'll give you that.

                                • 13. Re: JBAS014775  deploying ejb from jboss4 to Jboss6
                                  ybxiang.china

                                  Actually, I worked for 2 company long time:

                                  (1) Nokia Siments Networks: 5 years.

                                         In 2008 beginning, my boss told me: do NOT rewrite the DAO classes( which were written in 2003 and filled with SQL).

                                        Two months later, I replaced them with my new-invented light-weight OR-Mapping tool (quitely). Hibernate was powerfull but too fat.

                                        

                                        At the end of that year, I left this company. They are still using that tool those years.

                                   

                                  (2) Alcatel-Lucent ShangHai Bell: 3 years (Now, I am still here)

                                   

                                   

                                  Only one exception:

                                  Genband: 8 months (I really hate to read old codes written 10 years ago, especially there are no detailed documents.).