7 Replies Latest reply on Dec 21, 2010 11:56 AM by Roger Lee

    -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1

    Roger Lee Apprentice

      Final part of moving a "live" JBoss 4.2.3 Seam App to JBoss 6.0.0.20101110-CR1.

       

      I've deployed my WeEatWell-ds.xml in

       

      jboss-6.0.0.20101110-CR1\server\default\deploy

       

      and access it via;

       

      <persistence-unit name="WeEatWellEntityManagerFactory">

      <provider>org.hibernate.ejb.HibernatePersistence</provider>

       

      <jta-data-source>java:/WeEatWellDatasource</jta-data-source>

       

       

      <properties>      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

           <property name="hibernate.hbm2ddl.auto" value="update"/>

           <property name="hibernate.jdbc.batch_size" value="20"/>

           <property name="hibernate.show_sql" value="true"/>

           <property name="hibernate.format_sql" value="true"/>

           <property name="jboss.entity.manager.factory.jndi.name" value="java:/WeEatWellEntityManagerFactory"/>

      </properties>

       

       

      In my EJB I have;

       

      @PersistenceContext(unitName = "WeEatWellEntityManagerFactory"

      private EntityManager entityManager;

       

       

      However I get;

       

      21:46:08,254 INFO  [service] Removing bootstrap log handlers
      21:46:08,343 ERROR [org.jboss.profileservice.bootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeployment
      Exception: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "jboss.web.deployment:war=/WeEatWell" is missing the following dependencies:
          Dependency "persistence.unit:unitName=WeEatWell.ear/WeEatWell.jar#WeEatWell" (should be in state "Create", but is actually in st
      ate "** NOT FOUND Depends on 'persistence.unit:unitName=WeEatWell.ear/WeEatWell.jar#WeEatWell' **")

      DEPLOYMENTS IN ERROR:
        Deployment "persistence.unit:unitName=WeEatWell.ear/WeEatWell.jar#WeEatWell" is in error due to the following reason(s): ** NOT FO
      UND Depends on 'persistence.unit:unitName=WeEatWell.ear/WeEatWell.jar#WeEatWell' **

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha8]
              at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha8]
              at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.201
      01110-CR1]
              at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:118
      ) [:0.1.0.Alpha1]
              at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:133
      ) [:6.0.0.20101110-CR1]
              at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56)
      [:6.0.0.20101110-CR1]
              at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.j
      ar:2.1.0-alpha-5]
              at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-ba
      se.jar:2.1.0-alpha-5]
              at java.lang.Thread.run(Unknown Source) [:1.6.0_20]

      21:46:09,119 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      21:46:09,122 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      21:46:09,122 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.20101110-CR1 "Neo"] Started in 41s:598ms

       

      Have various Apps running on JBoss 4.2.3 accessing MySQL no problem.

       

      Any suggestions?

       

      Thanks.

        • 1. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
          jaikiran pai Master

          That error is saying something else. I guess there is some servlet or some other piece of code in your web module which is injecting or referring to (a non-existent) "WeEatWell" Persistence unit.

          • 2. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
            Roger Lee Apprentice

            Can't find anything obvious.

             

            Any suggestions as to where I should look?

             

            Thanks.

            • 3. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
              jaikiran pai Master

              If you have web.xml or jboss-web.xml, post the contents of those here.

              • 4. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
                Roger Lee Apprentice

                May need v.6.x DTD refs?

                 

                web.xml;

                 

                <?

                xml version="1.0" ?>

                <

                web-app xmlns="http://java.sun.com/xml/ns/javaee"

                 

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

                 

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                 

                version="2.5">

                 

                 

                <!-- RichFaces -->

                 

                 

                <context-param>

                 

                <param-name>org.richfaces.SKIN</param-name>

                 

                <param-value>DEFAULT</param-value>

                 

                </context-param>

                 

                 

                <!-- Suppress spurious stylesheets -->

                 

                 

                <context-param>

                 

                <param-name>org.richfaces.CONTROL_SKINNING</param-name>

                 

                <param-value>disable</param-value>

                 

                </context-param>

                 

                 

                <context-param>

                 

                <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>

                 

                <param-value>disable</param-value>

                 

                </context-param>

                 

                 

                <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->

                 

                 

                <context-param>

                 

                <param-name>org.richfaces.LoadStyleStrategy</param-name>

                 

                <param-value>ALL</param-value>

                 

                </context-param>

                 

                 

                <context-param>

                 

                <param-name>org.richfaces.LoadScriptStrategy</param-name>

                 

                <param-value>ALL</param-value>

                 

                </context-param>

                 

                 

                <!-- Seam -->

                 

                 

                <listener>

                 

                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>

                 

                </listener>

                 

                 

                <filter>

                 

                <filter-name>Seam Filter</filter-name>

                 

                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>

                 

                </filter>

                 

                 

                <filter-mapping>

                 

                <filter-name>Seam Filter</filter-name>

                 

                <url-pattern>/*</url-pattern>

                 

                </filter-mapping>

                 

                 

                <servlet>

                 

                <servlet-name>Seam Resource Servlet</servlet-name>

                 

                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>

                 

                </servlet>

                 

                 

                <servlet-mapping>

                 

                <servlet-name>Seam Resource Servlet</servlet-name>

                 

                <url-pattern>/seam/resource/*</url-pattern>

                 

                </servlet-mapping>

                 

                 

                <!-- Facelets development mode (disable in production) -->

                 

                 

                <context-param>

                 

                <param-name>facelets.DEVELOPMENT</param-name>

                 

                <param-value>@debug@</param-value>

                 

                </context-param>

                 

                 

                <!-- JSF -->

                 

                 

                <context-param>

                 

                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                 

                <param-value>.xhtml</param-value>

                 

                </context-param>

                 

                 

                <servlet>

                 

                <servlet-name>Faces Servlet</servlet-name>

                 

                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                 

                <load-on-startup>1</load-on-startup>

                 

                </servlet>

                 

                 

                <servlet-mapping>

                 

                <servlet-name>Faces Servlet</servlet-name>

                 

                <url-pattern>*.seam</url-pattern>

                 

                </servlet-mapping>

                 

                 

                <security-constraint>

                 

                <display-name>Restrict raw XHTML Documents</display-name>

                 

                <web-resource-collection>

                 

                <web-resource-name>XHTML</web-resource-name>

                 

                <url-pattern>*.xhtml</url-pattern>

                 

                </web-resource-collection>

                 

                <auth-constraint/>

                 

                </security-constraint>

                 

                 

                <!-- uncomment <ejb-local-ref> entries when deploying to GlassFish and (optionally) JBoss AS 5 -->

                 

                <!--

                <ejb-local-ref>

                <ejb-ref-name>WeEatWell/AuthenticatorBean/local</ejb-ref-name>

                <ejb-ref-type>Session</ejb-ref-type>

                <local-home/>

                <local>com.weeatwell.ejb.Authenticator</local>

                </ejb-local-ref>

                -->

                 

                 

                <!-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -->

                 

                 

                <persistence-unit-ref>

                 

                <persistence-unit-ref-name>WeEatWell/pu</persistence-unit-ref-name>

                 

                <persistence-unit-name>../WeEatWell.jar#WeEatWell</persistence-unit-name>

                 

                <!-- The relative reference doesn't work on GlassFish. Instead, set the <persistence-unit-name> to "WeEatWell",

                package persistence.xml in the WAR, and add a <jar-file> element in persistence.xml with value "../../WeEatWell.jar".

                <persistence-unit-name>WeEatWell</persistence-unit-name>

                -->

                 

                </persistence-unit-ref>

                 

                </web-app>

                • 5. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
                  Roger Lee Apprentice

                  jaikiran pai any suggestions after seeing my web.xml file.

                   

                  Totally stuck trying to move to JBoss 6.x. Looks like I'll be using v.4.2.3 forever!

                  • 6. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
                    jaikiran pai Master

                    Sorry, I forgot about this thread.

                     

                    The problem with that web.xml is this section:

                    <persistence-unit-ref>
                    <persistence-unit-ref-name>WeEatWell/pu</persistence-unit-ref-name>
                    <persistence-unit-name>../WeEatWell.jar#WeEatWell</persistence-unit-name>
                    ...
                    

                     

                     

                    1) Do you really need that persistence-unit-ref? If not then just remove it.

                    2) If yes, then you'll have to set the correct unit name (which we can decide after looking at your application packaging details).

                    • 7. Re: -ds.xml in - Porting JBoss 4.2.4 EJB 3.x app to JBoss 6.0 CR1
                      Roger Lee Apprentice

                      I believe that was generated by seam-gen. That line was okay in the 4.2.3 deployment and is currently in another Seam App deployed on JBoss 4.2.3.

                       

                      I have commented it out and my JBoss 6 version now starts with out errors but when i try to run the web site from localhost

                       

                      http://localhost:8080/WeEatWell/home.seam

                       

                      I can't display the webpage, whereas I can in JBoss 4.2.3.

                       

                      I get "Internet Explorer cannot display the webpage".

                       

                      Thanks for that. Will investigate "localhost" problem.