4 Replies Latest reply on Dec 2, 2008 7:25 AM by gufiya

    a deployment problem

    gufiya

      Hello,

      I'm trying a very simple scenario of deploying and undeploying EJB project from Eclipse.

      I have created 3 projects -
      1) EJB project
      2) EAR project
      3) EJB client project

      I deploy the EAR to JBOSS server, and everything looks fine:

      17:13:32,812 INFO [EJBContainer] STARTED EJB: titan.travelagent.TravelAgentBean ejbName: TravelAgentBean
      17:13:32,828 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.2.3/server/default/deploy/TitanEAR.ear/TitanEJB.jar/
      17:13:32,828 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.2.3/server/default/deploy/TitanEAR.ear/
      


      When I look in the deploy directory, I see a directory for my EAR file, which contains three things:
      1) a directory for the EJB project (class files)
      2) a meta-inf directory for the EAR project (with "application.xml")
      3) a jar-file for the EJB client project (only a jar file, not directory)

      My problem starts when I remove the EAR project using Eclipse.
      For some reason, the client-jar-file (item 3 above) is not removed from the server. This cause exception in JBOSS since it tries to redeploy the EAR application but "application.xml" was deleted already.

      I guess it is really stupid thing, but for me this stuff is quite new.
      Any ideas?

      Thanks

        • 1. Re: a deployment problem
          maxandersen

          any chance something inside your app is holding a lock on the jar ?

          What happens if you stop eclipse - can you remove the file then ?

          • 2. Re: a deployment problem
            gufiya

            Thank you for your quick reply.

            I don't have any jar file in the workspace -
            I guess that the jar is created during the deplyoment to the server's "deploy" directory.
            Anyway, the problem happens also after restarting (Eclipse & machine).

            For some reason, EJB client project is deployed as a jar file, but the EJB project itself (beans implementation) is deployed as group of flat files... maybe this is the root of the problem?

            • 3. Re: a deployment problem
              maxandersen

              I would need some more details to be able to reproduce this ? Anything in the error log view ?

              • 4. Re: a deployment problem
                gufiya

                I'm using JBoss 4.2.3GA, Eclipse 3.3.2 (for J2EE).
                I have also added to eclipse JBoss Tools 2.1.2.

                When I deploy the EAR, everything is fine, and error log stays clean.
                When I remove the EAR from the server, the client JAR remains on the server, I cannot delete it (until I shutdown JBoss), and I receive the following error log entry:

                eclipse.buildId=M20080221-1800
                java.version=1.5.0_16
                java.vendor=Sun Microsystems Inc.
                BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=iw_IL
                Command-line arguments: -os win32 -ws win32 -arch x86
                
                Warning
                Tue Dec 02 14:14:15 IST 2008
                Publishing completed with a warning
                


                It has two children entries:
                eclipse.buildId=M20080221-1800
                java.version=1.5.0_16
                java.vendor=Sun Microsystems Inc.
                BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=iw_IL
                Command-line arguments: -os win32 -ws win32 -arch x86
                
                Warning
                Tue Dec 02 14:14:15 IST 2008
                Unable to delete module from server. (TitanEAR/TitanEJBClient)
                
                java.lang.Exception: Some files were not removed from the server
                at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.unpublish(JstPublisher.java:183)
                at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.publishModule(JstPublisher.java:106)
                at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishModule(DeployableServerBehavior.java:132)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:749)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:835)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:669)
                at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:887)
                at org.eclipse.wst.server.core.internal.Server.publish(Server.java:874)
                at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:72)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
                
                


                and
                eclipse.buildId=M20080221-1800
                java.version=1.5.0_16
                java.vendor=Sun Microsystems Inc.
                BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=iw_IL
                Command-line arguments: -os win32 -ws win32 -arch x86
                
                Warning
                Tue Dec 02 14:14:15 IST 2008
                Unable to delete module from server. (TitanEAR)
                
                java.lang.Exception: Some files were not removed from the server
                at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.unpublish(JstPublisher.java:183)
                at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.publishModule(JstPublisher.java:106)
                at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishModule(DeployableServerBehavior.java:132)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:749)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:835)
                at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:669)
                at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:887)
                at org.eclipse.wst.server.core.internal.Server.publish(Server.java:874)
                at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:72)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
                
                


                Another important lead:
                I have found a workaround.
                1) Go to the EJB project preferences -> j2ee module dependencies.
                2) Remove the dependency with the Client JAR project.
                3) close the preferences window (otherwise step 5 will not work).
                4) Go to the EJB project preferences -> Java build path.
                5) Add a dependency with the Client JAR project.

                Now everything works with no problem.