12 Replies Latest reply on Jun 1, 2015 6:44 AM by maxandersen

    Eclipse indigo JBoss AS 7 deploy problem

    zzzooo

      Hi,

       

         I'm using eclipse indigo with JBoss Tools M4, and my app is running on JBoss AS 7.0.2. I'm trying to deploy with JBoss Tools from eclipse. My project is an ear project, which contains a war and many jar files. I'm also using m2eclipse plugin, because the projects are maven projects.

      My ear structure is the next:

      - the ear file

      - it contains a war file (it's WEB-INF/lib folder is empty)

      - all the necessary jars are under the ear file's "lib" folder - including some own project jars

      When I build the whole project with maven, I have the correct ear - I can deploy it and it works well.

       

      When I try to deploy from eclipse (server - add/remove (select the ear) - and then full republish), the ear/lib will contain my own jars uncompressed, which will cause problem at deploy time (NoClassDefFoundError - caused by ClassNotFoundException referencing to classes in the uncompressed jars).

       

      My question is: How can I force the eclipse (JBossTools) to compress every project-jar in the lib directory? I also tried the check/uncheck the "Deploy projects as compressed archives" option on the Deployment tab of the server config, but it didn't have any effects on the ear's lib directory...

       

      Please help!

      Thanks in advance!

        • 1. Re: Eclipse indigo JBoss AS 7 deploy problem
          maxandersen

          Could you reduce this problem to a minimal project and open a bug in https://jira.jboss.org/jira/browse/JBIDE ?

           

          When I have .jars' in libs they stay compressed so must be some difference between your and my setup.

          • 2. Re: Eclipse indigo JBoss AS 7 deploy problem
            zzzooo

            We have found the issue.

             

            The problem was:

            I imported all my projects as "existing maven project". Then - somehow -, the org.eclipse.wst.common.component file under the ear project's .settings directory referenced for the projects - which should have been packaged (zipped) into the ear's lib directory - as resource instead of maven reference.

             

            Problem:

            <dependent-module archiveName="wicket-core-2.0.1-SNAPSHOT.jar" deploy-path="/lib" handle="module:/resource/com.doctusoft.web.wicket-core/com.doctusoft.web.wicket-core">

                        <dependency-type>uses</dependency-type>

                    </dependent-module>

             

            Solution:

            I replaced it to this:

            <dependent-module archiveName="wicket-core-2.0.1-SNAPSHOT.jar" deploy-path="/lib" handle="module:/classpath/var/M2_REPO/com/doctusoft/web/wicket-core/2.0.1-SNAPSHOT/wicket-core-2.0.1-SNAPSHOT.jar">

                        <dependency-type>uses</dependency-type>

                    </dependent-module>

             

            No it's packed correctly and works fine!

            Thanks a lot!

            z.

            • 3. Re: Eclipse indigo JBoss AS 7 deploy problem
              maxandersen

              Does that happen on every Import of that project ?

               

              How about when you do Maven > Update project configuration ?

               

              p.s. that really shouldn't "just happen" so worried there is some bug somewhere

              • 4. Re: Eclipse indigo JBoss AS 7 deploy problem
                zzzooo

                I also tried that many times - it didn't help.

                 

                The situation:

                I had too different repository under the svn. Both of them had a (maven) parent project: let it parent1 and parent2.

                We group the versions and repository references in these parent projects' pom files.

                Under these parent projects has many different projects.

                Under the parent1 we had projects, which are a kind of company framework elements.

                Under the parent2 we had projects, which are specific for a customer, and they references for the framework projects (here I have the deployable ear project as well).

                 

                I checked out these parents and it's child projects, and build them from command line with maven (3.0.3) (java version: 1.6.0_26). I have Ubuntu 10.10.

                After this, I imported them as existing maven projects into eclipse. First, the parent1 with it's child projects and then the parent2 with it's child projects. After this, I created a new server instance - JBoss 7 - referencing to my own JBoss. Then I deployed, and the mentioned problem happend...

                 

                We tried this in 3 different computer with the same environment except the op. sys. (Ubuntu 10.04, Ubuntu 11.10, Mac - OSX). The Ubuntu 10.04 was mine, and the Mac had the same issue. But on the Ubuntu 11.10 was ok. After this, we compared the differences, and realized the solution. I don't think the op.sys is the responsible for this problem, but I tried to import the projects more times, and the same issue happend - also on the Mac. I really don't know what would cause this, but after when I fixed the org.eclipse.wst.common.component file manually it worked fine. So I guess the problem was with the m2eclipse or with the wst. Maybe the our settings were different - I don't know.

                • 5. Re: Eclipse indigo JBoss AS 7 deploy problem
                  maxandersen

                  My question is:

                   

                  *after* you have imported as maven project and you get the 'broken' reference in .settings

                  and *after* you have manually fixed it.

                   

                  Does a Maven > Update Project Configuration recreate the problem ?

                   

                  If it does then its most likely an issue in m2e-wtp and we would like to figure out what is causing it.

                   

                  Just getting to see the pom.xml would help - is that doable ?

                  • 6. Re: Eclipse indigo JBoss AS 7 deploy problem
                    zzzooo

                    I did "Update Project Configuration" and the problem wasn't recreated. So after I manually fixed that file - everything is ok.

                    Unfortunatelly, I can't send you the poms .

                    • 7. Re: Eclipse indigo JBoss AS 7 deploy problem
                      aqtwrdnr

                      We are also experiencing this problem with unpacked jars in the deployment directory. We also reference a project within a multi model Maven project and our .settings directory also contains the wrong references.

                      • 8. Re: Eclipse indigo JBoss AS 7 deploy problem
                        maxandersen

                        As asked above - please provide some details for us to be able to reproduce the issue.

                        • 9. Re: Eclipse indigo JBoss AS 7 deploy problem
                          alex.dancu

                          Unfortunately I managed to reproduce it using

                          JBossAS Tools Version: 2.4.101.Final-v20140318-1509-B179 on

                          Spring Tool Suite Version: 3.5.0.RELEASE Build Id: 201404011654

                          JBoss AS 7.1.1

                           

                          Steps to reproduce:

                           

                          - created 2 maven projects, one TestWebApp - war and the other TestCommon - jar

                          - the war has declared in its pom.xml a dependency to the TestCommon.jar artifact

                          - when deploying the war, I get ClassNotFound exception because the deployed TestCommon.jar is empty

                          - if I expand Maven dependencies for TestWebApp in Package ExpIorer, I see all the other jars there, except the TestCommon.jar, which appears to be a reference to the eclipse project

                           

                          - As a workaround, if I close the eclipse TestCommon project, and remove and add again the WebApp on JBOSS, it works, now it copies the jar directly from the maven repository, and not using the reference to the eclipse project.

                          • 10. Re: Eclipse indigo JBoss AS 7 deploy problem
                            maxandersen

                            Can you please try with latest JBoss Tools 4.2 (JBoss Tools - Beta3 for Luna - Cordova, Ionic, OpenShift, Server) and see if still present ?

                            • 11. Re: Eclipse indigo JBoss AS 7 deploy problem
                              nussbaum

                              I have the same problem, with Jboss Tools 4.2, Eclipse Luna, and Jboss 6.4.

                               

                              We have a project with more subprojects and dependencies, when compiled with maven (Eclipse maven: maven clean install) => .ear file ok, if maually deployed on the server, everything works fine). If deployed through the Jboss Tools in Eclipse (Add / Remove) => deployment seems ok, no complaining from server, nothing wrong in the logs, in deployments folder the .deployed file is also created, everything seems fine, but the application doesn't work at all.

                               

                              Again, it happens only through the Eclipse JBoss deployment, otherwise manual deployment after maven compile works perfectly.

                               

                              Really crappy, not to know how to fix this and it is so time consuming - such issue should be fixed.... makes the life of a developer much harder ...and slower with the deployment...

                              • 12. Re: Eclipse indigo JBoss AS 7 deploy problem
                                maxandersen

                                If you could report a bug so we could reproduce your issue then we will help fix it.

                                 

                                Please check you have not used mvn eclipse:eclipse to generate eclipse settings but instead used m2e maven import - as that have been shown many times in past that eclipse:eclipse is *not* working well.