6 Replies Latest reply on Jan 19, 2009 7:02 AM by maxandersen

    EAR Auto-Deployment Issue with Ganymede and JBoss Tools 3 Be

    kenny.stainback

      Using:
      * Ganymede SR1
      * JBoss Tools 3 Beta 1 (more specifically "JBoss AS Tools" 2.0.0.Beta1-R200810311334).

      Searched the forum, but haven't found anyone with my exact same issue.

      I created a new "Dynamic Web Project" and a regular "Java" project in Eclipse. I then created a new "WAR" archive in the "Project archives" pane. I select the war archive and select "New archive --> JAR" in the war archive's WEB-INF/lib directory. This adds the jar as an embedded package within the WAR. I can manually publish to the server with no problem (both WAR and JAR projects are set to expanded deployment).

      So, if I modify index.html (for example) in my web project, the change is detected and it is deployed to the server successfully. However, if I change a Java source file in the JAR project, the change is not detected (and therefore, not deployed). The fileset configured for the JAR archive is the classes output directory of the JAR's Eclipse project. I verified that classes were indeed being generated to this directory.

      I did a similar test using an EAR archive with an embedded WAR archive. Changes made to the fileset on the EAR would auto-deploy, but changes made to the embedded WAR package were not. So, it seems as though something is not detecting changes to any child archive of the base archive type.

      Any help on this is much appreciated.

        • 1. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
          maxandersen

          Just to make sure i'm following you:

          The project archives is updating your jar for the java project but the Dynamic Web project is not picking up when the .jar that is updated is changed ?

          Or something else ?

          • 2. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
            kenny.stainback

            Thanks for the quick response - I'll try to clarify. The project archive for the web project's WEB-INF/lib directory contains a JAR project archive (see my .packages file content below). Initially everything deploys successfully. If I update an html file or Java class in my web project (deploy-test.war), the change is detected and it publishes the change to the server - excellent.

            My issue is that when I modify a Java class in my jar project (deploy-test-jar), the change is not published to the server. Likewise, if I have an EAR archive that contains a WAR archive, changes made to the war project will not auto-republish if modified.

            If I look at this from a .packages file perspective, it looks like the auto-publishing feature works for file resources defined directly below the root "package" element, but not for those defined within child "package" elements (ie, works for package name="deploy-test.war", but not for child package name="deploy-test.jar").

            If I manually perform a "publish to Server", the changes will push across fine. So, I'm specifically talking about the change detection bit not detecting changes to child packages.

            <?xml version="1.0" encoding="UTF-8"?>
            
            <packages version="1.2">
             <package name="deploy-test.war" type="org.jboss.ide.eclipse.as.core.packages.warPackage" todir="/cgwgs-master-alpha/build/expanded-archives/main/gets/jboss-5.0.0.GA/server/standard/deploy" exploded="true" inWorkspace="true">
             <fileset dir="/deploy-test/WebContent" includes="**/*" excludes="**/WEB-INF/lib/*.jar" inWorkspace="true" flatten="false">
             <properties></properties>
             </fileset>
             <folder name="WEB-INF">
             <folder name="lib">
             <package name="deploy-test.jar" type="jar" exploded="true" inWorkspace="true">
             <fileset dir="/deploy-test-jar/bin" includes="**" inWorkspace="true" flatten="false">
             <properties></properties>
             </fileset>
             <properties>
             <property name="org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployAfterBuild" value="true"></property>
             <property name="org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployServers" value="JBoss 5.0 Server,"></property>
             </properties>
             </package>
             <fileset dir="/deploy-test/WebContent/WEB-INF/lib" includes="*.jar" inWorkspace="true" flatten="false">
             <properties></properties>
             </fileset>
             <properties></properties>
             </folder>
             <folder name="classes">
             <fileset dir="/deploy-test/build/classes" includes="**/*" inWorkspace="true" flatten="false">
             <properties></properties>
             </fileset>
             <properties></properties>
             </folder>
             <properties></properties>
             </folder>
             <properties>
             <property name="org.jboss.ide.eclipse.as.core.packages.ModuleIDPropertyKey" value="1230060495108"></property>
             <property name="org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployAfterBuild" value="true"></property>
             <property name="org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployServers" value="JBoss 5.0 Server,"></property>
             </properties>
             </package>
             <properties></properties>
            </packages>
            


            • 3. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
              rob.stryker

              This should not be failing ;)

              In fact I've never had that fail before. I'll have to test it once I get back from holiday.

              • 4. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
                kenny.stainback

                The only workaround I've found is to define the war project in its own .packages file and define the jar project in its own .packages file, both as expanded archives. Then I set the web project's output directory to .../JBoss/server/default/deploy and the jar project's output directory to .../JBoss/server/default/deploy/deploy-test.war/WEB-INF/lib.

                This isn't ideal, of course, but mods to the jar project are auto-published successfully to the server. I'll keep playing with it and see if I can't get it working before you're back from holiday. Otherwise, I'll be looking for your response. I'll post again if I figure this out and it was on my end.

                Thanks.

                • 5. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
                  mingdexu

                  I have a similar issue - Eclipse 3.4.1, Jboss AS 4.2.3GA, JBoss Tool 3.0.0.CR1, Seam 2.0.2SP1

                  Application is deployed via Eclipse. It is an EAR project with WAR and EJB. When I manually deploy it to JBoss sever inside eclipse, the application starts and works fine.

                  When I change a web page (such as one .xhtml page) and click Save to save the file. In a minute, server starts to publish. It also tries to publish the java classes. However, the application will not start because it does not hot deploy the application correctly.

                  As a note, I used to use Eclipse Europa (ie, 3.3.2), and Jboss Tool 3.0.0 Alpha, and it does not deploy the Java classes.

                  Here is the console log -

                  14:44:19,635 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.AuthenticatorBean ejbName: AuthenticatorBean
                  14:44:19,639 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.impl.BookingSumCalculatorBean ejbName: BookingSumCalculatorBean
                  14:44:19,642 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.impl.CompanyCopyBean ejbName: CompanyCopyBean
                  14:44:19,645 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.impl.NumberRangeGeneratorBean ejbName: NumberRangeGeneratorBean
                  14:44:19,655 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.impl.UserSessionManagerBean ejbName: UserSessionManagerBean
                  14:44:19,663 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.LoadStructureAction ejbName: LoadStructureAction
                  14:44:19,672 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.UIRenderingManagerBean ejbName: UIRenderingManagerBean
                  14:44:19,673 INFO [EJBContainer] STOPPED EJB: com.harasoftware.eem.session.UnitConversion ejbName: UnitConversion
                  14:44:19,673 INFO [PersistenceUnitDeployment] Stopping persistence unit persistence.units:ear=eem-ear.ear,jar=eem-ejb.jar,unitName=eem
                  14:44:19,674 INFO [SessionFactoryImpl] closing
                  14:44:19,674 INFO [SessionFactoryObjectFactory] Unbinding factory from JNDI name: persistence.units:ear=eem-ear.ear,jar=eem-ejb.jar,unitName=eem
                  14:44:19,674 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                  14:44:19,676 INFO [SessionFactoryObjectFactory] Unbound factory from JNDI name: persistence.units:ear=eem-ear.ear,jar=eem-ejb.jar,unitName=eem
                  14:44:19,676 INFO [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=eemDatasource' from JNDI name 'java:eemDatasource'
                  14:44:19,776 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=eemDatasource' to JNDI name 'java:eemDatasource'
                  14:44:19,776 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=eem-ear.ear,jar=eem-ejb.jar,unitName=eem
                  14:44:23,897 INFO [Ejb3Configuration] found EJB3 Entity bean: com.harasoftware.eem.entity.Accrual
                  ....
                  14:44:25,599 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
                  14:44:25,619 INFO [Ejb3Configuration] [PersistenceUnit: eem] META-INF/orm.xml found
                  ...
                  14:44:34,351 INFO [EJBContainer] STARTED EJB: com.harasoftware.eem.session.UIRenderingManagerBean ejbName: UIRenderingManagerBean
                  14:44:34,359 INFO [EJBContainer] STARTED EJB: com.harasoftware.eem.session.UnitConversion ejbName: UnitConversion

                  and then it hangs ..


                  If I undeploy the application and redeploy iy again, it start to work again.

                  • 6. Re: EAR Auto-Deployment Issue with Ganymede and JBoss Tools
                    maxandersen

                    mingdexu, could you please try beta or even better latest build ?