1 2 Previous Next 17 Replies Latest reply on Mar 28, 2014 1:33 PM by Tomaz Cerar

    Migration spring app from JBoss 7.1 to Wildfly

    Gustavo Lira e Silva Newbie

      Hi,

       

      I have an application on production using Spring MVC, Spring Data and Spring Security running on JBoss 7.1, everythink works fine.

       

      Now I want to migrate this application to running on Wildfly with Java 8. When my application is deploying this error appears:

       

      JBAS016069: Error injecting persistence unit into CDI managed bean. Can't find a persistence unit named sgn-core in deployment sgn-web.war

       

      I put JPA logs on TRACE and Wildfly is dysplaing this:

       

      6:38:41,835 TRACE [org.jboss.as.jpa.messages] (weld-worker-2) pu search for name 'sgn-core' inside of sgn-web.war

      16:38:41,841 TRACE [org.jboss.as.jpa.messages] (weld-worker-2) pu findWithinDeployment searching for sgn-core

      16:38:41,842 TRACE [org.jboss.as.jpa.messages] (weld-worker-2) pu findWithinDeployment skipping empty pu holder for sgn-core

      ...

      16:38:41,912 TRACE [org.jboss.as.jpa.messages] (weld-worker-2) findWithinLibraryJar checking for 'sgn-core' found no persistence units

      ...

       

      But my application is the same, and didn't change anythink.

       

      Please could someone help me?

        • 1. Re: Migration spring app from JBoss 7.1 to Wildfly
          Scott Marlow Master

          Can you show us the contents of your application archive (jar tf sgn-web.war) and the rest of the org.jboss.as.jpa TRACE output from the server.log (from start to end of sgn-web.war deployment).

          • 2. Re: Migration spring app from JBoss 7.1 to Wildfly
            Gustavo Lira e Silva Newbie

            Hi,

             

            First of all, thank you very much for your attention.

             

            Here is the full server.log http://snipt.org/QhKg7

            Here is the jar tf sgn-web,war command http://snipt.org/QhLc3

            • 3. Re: Migration spring app from JBoss 7.1 to Wildfly
              Scott Marlow Master

              Where is the persistence.xml file?  I don't see it in sgn-web.war?

               

              Also, please post more of the deployment output (need to see from start to end of deployment output).http://snipt.org/QhKg7

              • 4. Re: Migration spring app from JBoss 7.1 to Wildfly
                Gustavo Lira e Silva Newbie

                Hi,

                 

                My persistence.xml is in sgn-core.jar.

                 

                Here is the server.log again http://pastebin.com/qzuQk6dk, sorry for the another one

                I'm using maven multi-module

                • 5. Re: Migration spring app from JBoss 7.1 to Wildfly
                  Scott Marlow Master

                  Where is the sgn-core.jar jar, I don't see it in http://snipt.org/QhLc3?

                  • 6. Re: Migration spring app from JBoss 7.1 to Wildfly
                    Gustavo Lira e Silva Newbie

                    Here is the list of command http://pastebin.com/PjBzSPPx

                     

                    The jar is localized by WEB-INF/lib/sgn-core-0.0.1-SNAPSHOT.jar

                     

                    Again, thanks for your attention!

                    • 8. Re: Migration spring app from JBoss 7.1 to Wildfly
                      Tomaz Cerar Master

                      good god! it is amazing that anything ever worked with all that mess in your lib.

                      This is not spring app, but, most of frameworks on the planet app.

                       

                      If you cleanup your lib, things will probably start working again.

                      Given that you are using maven, you should probably define bunch of dependencies you have as <scope>provided</scope>

                      i would also recommend you to look from where do this dependancies get into your final artifact by running mvn dependency:tree

                       

                      In short list of problematic jars that you should probably remove from your app. you have lots of duplication of jars or different versions of same lib.

                      Also you are including bunch of stuff that is part of server and as such is not needed and in some cases even causes problems.

                      WEB-INF/lib/jcip-annotations-1.0.jar <-- probably safe to remove

                      WEB-INF/lib/commons-exec-1.1.jar

                      WEB-INF/lib/commons-codec-1.6.jar

                      WEB-INF/lib/xml-apis-1.4.01.jar <-- remove

                      WEB-INF/lib/spring-data-jpa-1.5.1.RELEASE.jar

                      WEB-INF/lib/spring-data-commons-1.7.1.RELEASE.jar

                      WEB-INF/lib/spring-orm-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-aop-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-tx-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-core-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-context-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-webmvc-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-web-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-beans-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-test-4.0.2.RELEASE.jar

                      WEB-INF/lib/aspectjrt-1.6.10.jar <-- remove

                      WEB-INF/lib/commons-fileupload-1.2.2.jar

                      WEB-INF/lib/commons-io-1.3.2.jar <-- remove

                      WEB-INF/lib/slf4j-api-1.6.6.jar <-- remove

                      WEB-INF/lib/jcl-over-slf4j-1.6.6.jar <-- remove

                      WEB-INF/lib/slf4j-log4j12-1.6.6.jar <-- remove

                      WEB-INF/lib/log4j-1.2.12.jar <-- remove

                      WEB-INF/lib/jstl-1.2.jar <-- remove, this is part of app server

                      WEB-INF/lib/validation-api-1.1.0.Final.jar <-- remove, part of app server

                      WEB-INF/lib/hamcrest-all-1.3.jar <-- remove, this is testing lib not runtime

                      WEB-INF/lib/naming-java-0.8.jar

                      WEB-INF/lib/naming-core-0.8.jar

                      WEB-INF/lib/naming-factory-dbcp-5.5.12.jar

                      WEB-INF/lib/spring-expression-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-security-core-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/aopalliance-1.0.jar <-- remove

                      WEB-INF/lib/spring-security-config-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/spring-security-web-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/spring-jdbc-4.0.2.RELEASE.jar

                      WEB-INF/lib/spring-security-taglibs-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/spring-security-acl-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/spring-security-ldap-3.1.5.RELEASE.jar <-- why diffrent version of spring? 3 v 4?

                      WEB-INF/lib/spring-ldap-core-1.3.2.RELEASE.jar

                      WEB-INF/lib/commons-logging-1.0.4.jar <-- remove

                      WEB-INF/lib/commons-lang-2.4.jar

                      WEB-INF/lib/spring-ldap-core-tiger-1.3.2.RELEASE.jar

                      WEB-INF/lib/ical4j-1.0.2.jar

                      WEB-INF/lib/backport-util-concurrent-3.1.jar <-- remove

                      WEB-INF/lib/aspectjweaver-1.6.8_2.jar <-- remove

                      WEB-INF/lib/json-20090211.jar

                      WEB-INF/lib/dbunit-2.4.9.jar <-- remove this testing framework

                      WEB-INF/lib/mockito-all-1.9.5.jar <-- remove this testing framework

                      WEB-INF/lib/jbpm-human-task-hornetq-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-human-task-core-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-workitems-5.4.0.Final.jar

                      WEB-INF/lib/commons-compress-1.0.jar

                      WEB-INF/lib/smack-3.1.0.jar

                      WEB-INF/lib/rome-1.0.jar

                      WEB-INF/lib/commons-net-2.0.jar

                      WEB-INF/lib/cxf-rt-transports-http-2.4.4.jar <-- remove, this is part of app sever

                      WEB-INF/lib/cxf-rt-transports-common-2.4.4.jar <-- remove, this is part of app sever

                      WEB-INF/lib/jbpm-bpmn2-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-flow-builder-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-flow-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-persistence-jpa-5.4.0.Final.jar

                      WEB-INF/lib/jbpm-bam-5.4.0.Final.jar

                      WEB-INF/lib/knowledge-api-5.5.0.Final.jar

                      WEB-INF/lib/drools-core-5.5.0.Final.jar

                      WEB-INF/lib/mvel2-2.1.3.Final.jar

                      WEB-INF/lib/knowledge-internal-api-5.5.0.Final.jar

                      WEB-INF/lib/drools-compiler-5.5.0.Final.jar

                      WEB-INF/lib/antlr-runtime-3.3.jar <-- probably safe to remove

                      WEB-INF/lib/antlr-3.3.jar <-- probably safe to remove

                      WEB-INF/lib/stringtemplate-3.2.1.jar

                      WEB-INF/lib/xstream-1.4.1.jar <-- remove

                      WEB-INF/lib/xmlpull-1.1.3.1.jar <-- remove

                      WEB-INF/lib/xpp3_min-1.1.4c.jar <-- remove

                      WEB-INF/lib/drools-spring-5.5.0.Final.jar

                      WEB-INF/lib/drools-decisiontables-5.5.0.Final.jar

                      WEB-INF/lib/drools-templates-5.5.0.Final.jar

                      WEB-INF/lib/jxl-2.6.10.jar

                      WEB-INF/lib/drools-persistence-jpa-5.5.0.Final.jar

                      WEB-INF/lib/protobuf-java-2.4.1.jar

                      WEB-INF/lib/jta-1.1.jar <--remove, part of EE spec and part of server

                      WEB-INF/lib/ecj-3.5.1.jar <-- remove, you dont need eclipse compiler

                      WEB-INF/lib/postgresql-9.1-901.jdbc4.jar <-- remove, jdbc drivers belong to server not deployment

                      WEB-INF/lib/jackson-core-lgpl-1.9.12.jar <-- why?

                      WEB-INF/lib/jackson-mapper-lgpl-1.9.12.jar <-- why?

                      WEB-INF/lib/jackson-datatype-hibernate4-2.2.3.jar <-- why?

                      WEB-INF/lib/jackson-databind-2.2.3.jar <-- why?

                      WEB-INF/lib/jackson-core-2.2.3.jar <-- why?

                      WEB-INF/lib/jasperreports-5.1.2.jar

                      WEB-INF/lib/commons-beanutils-1.8.0.jar

                      WEB-INF/lib/commons-digester-2.1.jar

                      WEB-INF/lib/itext-2.1.7.js2.jar

                      WEB-INF/lib/bcmail-jdk14-138.jar <-- if you need it, update it

                      WEB-INF/lib/bcprov-jdk14-138.jar <-- if you need it, update it

                      WEB-INF/lib/bctsp-jdk14-1.38.jar <-- if you need it, update it

                      WEB-INF/lib/bcprov-jdk14-1.38.jar <-- if you need it, update it

                      WEB-INF/lib/bcmail-jdk14-1.38.jar <-- if you need it, update it

                      WEB-INF/lib/jcommon-1.0.15.jar

                      WEB-INF/lib/jfreechart-1.0.12.jar

                      WEB-INF/lib/jdtcore-3.1.0.jar <-- remove

                      WEB-INF/lib/castor-1.2.jar

                      WEB-INF/lib/jackson-annotations-2.0.5.jar <-- why?

                      WEB-INF/lib/cxf-bundle-2.7.7.jar <-- remove, part of app server

                      WEB-INF/lib/velocity-1.7.jar

                      WEB-INF/lib/commons-collections-3.2.1.jar

                      WEB-INF/lib/wsdl4j-1.6.3.jar <-- remove

                      WEB-INF/lib/jaxb-xjc-2.1.13.jar <-- remove

                      WEB-INF/lib/jaxb-impl-2.1.13.jar <-- remove

                      WEB-INF/lib/xmlschema-core-2.0.3.jar <-- remove

                      WEB-INF/lib/antlr-2.7.7.jar <-- yet another antrl, remove

                      WEB-INF/lib/xmlbeans-2.6.0.jar <-- remove

                      WEB-INF/lib/xml-resolver-1.2.jar <-- remove

                      WEB-INF/lib/geronimo-jaxws_2.2_spec-1.1.jar <-- absolutly remove, this clashes with app server provided ones

                      WEB-INF/lib/woodstox-core-asl-4.2.0.jar <-- probably safe to remove

                      WEB-INF/lib/stax2-api-3.1.1.jar <-- remove

                      WEB-INF/lib/geronimo-javamail_1.4_spec-1.7.1.jar <-- remove part of server

                      WEB-INF/lib/geronimo-servlet_3.0_spec-1.0.jar <-- absolutly remove, part of server

                      WEB-INF/lib/geronimo-jms_1.1_spec-1.1.1.jar <-- absolutly remove, part of server

                      WEB-INF/lib/spring-jms-3.0.7.RELEASE.jar <-- yet 3rd vesion of spring?

                       

                      this 4 jars do the same thing, why diffrent versions?

                      WEB-INF/lib/httpcore-nio-4.2.4.jar

                      WEB-INF/lib/httpcore-4.2.4.jar

                      WEB-INF/lib/httpasyncclient-4.0-beta3.jar

                      WEB-INF/lib/httpclient-4.2.5.jar

                       

                      WEB-INF/lib/mina-core-2.0.7.jar <-- you actualy use mina, i doubt it, remove

                      WEB-INF/lib/asm-3.3.1.jar <-- remove

                      WEB-INF/lib/js-1.7R2.jar <-- rhino? you should probably remove it

                      WEB-INF/lib/javax.ws.rs-api-2.0-m10.jar <-- remove spec api

                      WEB-INF/lib/oauth-provider-20100527.jar

                      WEB-INF/lib/oauth-20100527.jar

                      WEB-INF/lib/ehcache-core-2.5.1.jar <-- if you really need it upgrade it

                      WEB-INF/lib/wss4j-1.6.12.jar <-- remove

                      WEB-INF/lib/xmlsec-1.5.5.jar <-- remove

                      WEB-INF/lib/opensaml-2.5.1-1.jar

                      WEB-INF/lib/openws-1.4.2-1.jar

                      WEB-INF/lib/xmltooling-1.3.2-1.jar

                      WEB-INF/lib/joda-time-1.6.2.jar <--do you really use it?

                      WEB-INF/lib/neethi-3.0.2.jar <-- remove

                      WEB-INF/lib/cxf-api-2.7.7.jar <-- remove

                      WEB-INF/lib/jaxws-api-2.2.6.jar <-- remove

                      WEB-INF/lib/saaj-api-1.3.4.jar <-- remove

                      WEB-INF/lib/javax.annotation-3.1.1.jar <-- remove

                      WEB-INF/lib/jsr181-api-1.0-MR1.jar <--remove

                      WEB-INF/lib/xercesImpl-2.11.0.jar <-- remove

                      WEB-INF/lib/jaxb-api-2.2.4.jar <--remove

                      WEB-INF/lib/stax-api-1.0-2.jar <-- remove

                      WEB-INF/lib/activation-1.1.jar <- remove, this is part of jdk

                      WEB-INF/lib/axiom-api-1.2.14.jar

                      WEB-INF/lib/geronimo-activation_1.1_spec-1.1.jar <-- remove, this is part of jdk and same as activation-1.1.jar

                      WEB-INF/lib/jaxen-1.1.4.jar

                      WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar <-- remove

                      WEB-INF/lib/apache-mime4j-core-0.7.2.jar

                      WEB-INF/lib/axiom-impl-1.2.14.jar

                       

                      CXF, remove it whole, this is part of server

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

                      WEB-INF/lib/cxf-common-utilities-2.5.11.jar

                      WEB-INF/lib/cxf-rt-frontend-jaxws-2.7.7.jar

                      WEB-INF/lib/cxf-rt-core-2.7.7.jar

                      WEB-INF/lib/cxf-rt-bindings-soap-2.7.7.jar

                      WEB-INF/lib/cxf-rt-databinding-jaxb-2.7.7.jar

                      WEB-INF/lib/cxf-rt-bindings-xml-2.7.7.jar

                      WEB-INF/lib/cxf-rt-frontend-simple-2.7.7.jar

                      WEB-INF/lib/cxf-rt-ws-addr-2.7.7.jar

                      WEB-INF/lib/cxf-rt-ws-policy-2.7.7.jar

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

                       

                      WEB-INF/lib/itextpdf-5.4.5.jar

                      WEB-INF/lib/webutilities-0.0.6.jar

                      WEB-INF/lib/closure-compiler-r1592.jar

                      WEB-INF/lib/args4j-2.0.12.jar

                      WEB-INF/lib/ant-1.8.2.jar <-- remove

                      WEB-INF/lib/ant-launcher-1.8.2.jar <-- remove

                      WEB-INF/lib/jsr305-1.3.9.jar <-- remove

                      WEB-INF/lib/jarjar-1.1.jar <-- jarjar? in runtime, you should probably remove it

                      WEB-INF/lib/guava-11.0.1.jar

                      WEB-INF/lib/yuicompressor-2.4.7.jar <-- you ned it in runtime? this is usualy build time toole

                      WEB-INF/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar <-- remove

                      WEB-INF/lib/hibernate-validator-4.1.0.Final.jar <-- remove

                      WEB-INF/lib/hibernate-entitymanager-4.2.7.Final.jar <-- remove

                      WEB-INF/lib/jboss-logging-3.1.0.GA.jar <-- remove

                      WEB-INF/lib/javassist-3.18.1-GA.jar <-- remove

                      WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.1.Final.jar <-- remove

                      WEB-INF/lib/hibernate-commons-annotations-4.0.2.Final.jar <-- remove

                      WEB-INF/lib/hibernate-core-4.2.7.Final.jar <-- remove

                      WEB-INF/lib/mail-1.5.0-b01.jar <-- remove

                      WEB-INF/lib/groovy-all-2.2.1.jar

                      • 9. Re: Migration spring app from JBoss 7.1 to Wildfly
                        Gustavo Lira e Silva Newbie

                        Hi Tomaz!

                         

                        Thanks for you help.

                         

                        I will do this now and them I'll back here to say the results!

                        • 10. Re: Migration spring app from JBoss 7.1 to Wildfly
                          Gustavo Lira e Silva Newbie

                          Even removing almost all of the libs mentioned, mt application didn't work on Wildfly. What is estranged because my application running well even in JBoss EAP 6.2

                           

                          Some libs I couldn't remove because of Drools and JBPM

                          • 11. Re: Migration spring app from JBoss 7.1 to Wildfly
                            Scott Marlow Master

                            Please show us the contents of WEB-INF/lib/sgn-core-0.0.1-SNAPSHOT.jar (as output from "jar tf".  I'm having problems looking at the snipt.org links now, so continue using pastebin.

                             

                            From looking at your server.log output earlier, I so no evidence that the persistence.xml was deployed, which is why I asked where it is.

                            • 12. Re: Migration spring app from JBoss 7.1 to Wildfly
                              Gustavo Lira e Silva Newbie

                              Hi,

                               

                              Again Thanks for your attention!

                               

                              Here the result http://pastebin.com/qhDBbwCi

                              • 13. Re: Re: Migration spring app from JBoss 7.1 to Wildfly
                                Scott Marlow Master

                                Clearly, we are not seeing the persistence.xml, otherwise we would see something like the following during deployment:

                                INFO  [org.jboss.as.jpa] (MSC service thread 1-7) JBAS011401: Read persistence.xml for PU_NAME

                                • 14. Re: Migration spring app from JBoss 7.1 to Wildfly
                                  Scott Marlow Master

                                  Try creating a new sgn-web.war that only has the sgn-core-0.0.1-SNAPSHOT.jar file in it.

                                   

                                  Something like:

                                   

                                  mkdir hack

                                  cd hack

                                  jar xf ../sgn-web.war

                                  Then remove all files from hack except sgn-core-0.0.1-SNAPSHOT.jar.

                                   

                                  Create the new sgn-web.war

                                  cd hack

                                  jar cf ../newsgn-web.war .

                                   

                                  Then try deploying newsgn-web.war and see if you see the "Read persistence.xml for" message on the console.

                                  1 2 Previous Next