11 Replies Latest reply on Apr 21, 2008 2:01 PM by Thomas Michal

    Problem re-deploying war inside ear

    Thomas Michal Newbie

      Hi everybody,

      when I am redeploying an ear-packed application (copying to default/server/deploy) the web app is not updated by jboss, although all files inside the EAR and WAR are changed or have new timestamps.

      The server console output is:

      [TomcatDeployment] deploy, ctxPath=/myapp, vfsUrl=myapp.ear/myapp.war
      


      The files in the default/tmp/deploy folder are the old ones.

      There is no error message or exception shown in the console log, the server log shows the exception below:

      2008-04-20 11:19:06,605 DEBUG [org.jboss.web.tomcat.service.deployers.TomcatDeployment] Unable to retrieve orb
      javax.management.InstanceNotFoundException: jboss:service=CorbaORB is not registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
       at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:559)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:506)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4358)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5357)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:347)
       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:89)
       at org.jboss.web.deployers.WebModule.start(WebModule.java:67)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
       at $Proxy5.start(Unknown Source)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:255)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
       at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
       at org.jboss.system.ServiceController.start(ServiceController.java:431)
       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:150)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:108)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:246)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
       at org.jboss.Main.boot(Main.java:208)
       at org.jboss.Main$1.run(Main.java:534)
       at java.lang.Thread.run(Thread.java:595)
      


      There is a servlet that is calling an EJB that it is looking up via initial context and "myapp/beanname/local", but this works fine, unless I re-deploy the application. After redeploying I am also getting class cast exceptions from the line in the servlet where the local interface of the EJB is requested.

      I do not configure any ejb references in the jar or the war, as I understood from JBoss documentation that this is not required for JBoss.

      After stopping JBoss and starting again everything is working fine again and the new webapp is used.

      I am using:
      - Sun Java 1.5.0_11 under Linux
      - JBoss [Morpheus] 5.0.0.Beta4 (build: SVNTag=JBoss_5_0_0_Beta4 date=200802091115)

      Any help appreciated.

      Thomas

        • 1. Re: Problem re-deploying war inside ear
          jaikiran pai Master

          How is the application deployed, is it in exploded format or as an archive? And how do you redeploy the application?

          when I am redeploying an ear-packed application (copying to default/server/deploy)


          You mean you are trying to overwrite (by copy/paste) the existing application in the deploy folder?


          • 2. Re: Problem re-deploying war inside ear
            Thomas Michal Newbie

            The application is deployed as archive myapp.ear.

            An ant script touches the descriptor files (application.xml, web.xml), rebuilds the application and copies to the deploy folder, overriding the existing ear file there.

            I did this many times with an war packaged application under JBoss 4.2 and it always worked without problems.

            • 3. Re: Problem re-deploying war inside ear
              jaikiran pai Master

              JBoss-5 Beta4 has some issues with deployment. Probably this is one more issue. Can you post the ClassCastException logs and also the redeployment logs (which show what components are being redeployed)?

              • 4. Re: Problem re-deploying war inside ear
                Thomas Michal Newbie

                The log after I copied the ear file to the deploy folder:

                09:43:26,501 INFO [MCKernelAbstraction] uninstalling bean: jboss.j2ee:ear=myapp.ear,jar=myapp.jar,name=TestObjectAdminBean,service=EJB3
                09:43:26,513 INFO [EJBContainer] STOPPED EJB: de.mth.myapp.server.TestObjectAdminBean ejbName: TestObjectAdminBean
                09:43:26,526 INFO [MCKernelAbstraction] uninstalling bean: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:26,526 INFO [PersistenceUnitDeployment] Stopping persistence unit persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:26,527 INFO [SessionFactoryImpl] closing
                09:43:26,527 INFO [SessionFactoryObjectFactory] Unbinding factory from JNDI name: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:26,528 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                09:43:26,539 INFO [SessionFactoryObjectFactory] Unbound factory from JNDI name: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:26,836 INFO [PersistenceUnitParsingDeployer] Found persistence units [org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@9a3139{name=myappPU}]
                09:43:27,601 WARN [CollectionPropertyHandler] ClassInfo.getDeclaredConstructor(null) didn't work for org.jboss.metadata.ejb.spec.InterceptorClassesMetaData, found the default ctor in ClassInfo.getDeclaredConstructors()
                09:43:28,506 WARN [AnnotationRepositoryToMetaData] Not implemented: disableAnnotation(public java.util.List de.mth.myapp.server.TestObjectAdminBean.getTestObjects(), javax.annotation.security.PermitAll)
                09:43:28,506 WARN [AnnotationRepositoryToMetaData] Not implemented: disableAnnotation(public java.util.List de.mth.myapp.server.TestObjectAdminBean.getTestObjects(), javax.annotation.security.DenyAll)
                09:43:29,359 INFO [MCKernelAbstraction] installing bean: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU with dependencies:
                09:43:29,359 INFO [MCKernelAbstraction] and demands:
                09:43:29,359 INFO [MCKernelAbstraction] jboss.jca:name=myapp1DS,service=DataSourceBinding
                09:43:29,359 INFO [MCKernelAbstraction] and supplies:
                09:43:29,666 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:29,671 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                09:43:29,673 INFO [AnnotationBinder] Binding entity from annotated class: de.mth.myapp.server.TestObject
                09:43:29,674 INFO [EntityBinder] Bind entity de.mth.myapp.server.TestObject on table TestObjectS
                09:43:29,705 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
                09:43:29,706 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
                09:43:29,706 INFO [SettingsFactory] RDBMS: MySQL, version: 5.0.38-Ubuntu_0ubuntu1.4-log
                09:43:29,707 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.6 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ )
                09:43:29,707 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
                09:43:29,708 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
                09:43:29,709 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
                09:43:29,710 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
                09:43:29,710 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
                09:43:29,710 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
                09:43:29,710 INFO [SettingsFactory] JDBC batch size: 15
                09:43:29,710 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
                09:43:29,711 INFO [SettingsFactory] Scrollable result sets: enabled
                09:43:29,711 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
                09:43:29,711 INFO [SettingsFactory] Connection release mode: auto
                09:43:29,711 INFO [SettingsFactory] Maximum outer join fetch depth: 2
                09:43:29,711 INFO [SettingsFactory] Default batch fetch size: 1
                09:43:29,711 INFO [SettingsFactory] Generate SQL with comments: disabled
                09:43:29,711 INFO [SettingsFactory] Order SQL updates by primary key: disabled
                09:43:29,712 INFO [SettingsFactory] Order SQL inserts for batching: disabled
                09:43:29,712 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
                09:43:29,712 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
                09:43:29,713 INFO [SettingsFactory] Query language substitutions: {}
                09:43:29,713 INFO [SettingsFactory] JPA-QL strict compliance: enabled
                09:43:29,713 INFO [SettingsFactory] Second-level cache: enabled
                09:43:29,713 INFO [SettingsFactory] Query cache: disabled
                09:43:29,713 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
                09:43:29,714 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
                09:43:29,714 INFO [SettingsFactory] Cache region prefix: myapp_ear,myapp_jar,myappPU
                09:43:29,714 INFO [SettingsFactory] Structured second-level cache entries: disabled
                09:43:29,714 INFO [SettingsFactory] Statistics: disabled
                09:43:29,714 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
                09:43:29,715 INFO [SettingsFactory] Default entity-mode: pojo
                09:43:29,715 INFO [SettingsFactory] Named query checking : enabled
                09:43:29,724 INFO [SessionFactoryImpl] building session factory
                09:43:29,743 INFO [SessionFactoryObjectFactory] Factory name: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:29,743 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                09:43:29,753 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:29,756 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
                09:43:29,761 INFO [SchemaExport] Running hbm2ddl schema export
                09:43:29,762 INFO [SchemaExport] exporting generated schema to database
                09:43:29,894 INFO [SchemaExport] schema export complete
                09:43:29,895 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                09:43:29,898 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=myapp.ear,jar=myapp.jar,name=TestObjectAdminBean,service=EJB3 with dependencies:
                09:43:29,899 INFO [MCKernelAbstraction] and demands:
                09:43:29,899 INFO [MCKernelAbstraction] persistence.units:ear=myapp.ear,jar=myapp.jar,unitName=myappPU
                09:43:29,899 INFO [MCKernelAbstraction] jboss.ejb:service=EJBTimerService
                09:43:29,899 INFO [MCKernelAbstraction] and supplies:
                09:43:29,899 INFO [MCKernelAbstraction] Class:de.mth.myapp.server.TestObjectAdminBeanRemote
                09:43:29,899 INFO [MCKernelAbstraction] Class:de.mth.myapp.server.TestObjectAdminBeanLocal
                09:43:31,884 INFO [EJBContainer] STARTED EJB: de.mth.myapp.server.TestObjectAdminBean ejbName: TestObjectAdminBean
                09:43:32,435 INFO [TomcatDeployment] deploy, ctxPath=/myapp, vfsUrl=myapp.ear/myapp.war
                


                This happens when the servlet in the webapp TestObjectServiceImpl is trying to get the local interface for the SLSB TestObjectAdminBean:

                09:43:58,444 ERROR [[/myapp]] Exception while dispatching incoming RPC call
                com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List de.mth.myapp.client.service.TestObjectService.getTestObjectNames()' threw an unexpected exception: java.lang.ClassCastException: $Proxy89
                 at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:361)
                 at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:547)
                 at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
                 at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:187)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at de.mth.myapp.webapp.JaasLoginFilter.doFilter(JaasLoginFilter.java:80)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:90)
                 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:96)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:309)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Thread.java:595)
                Caused by: java.lang.ClassCastException: $Proxy89
                 at de.mth.myapp.webapp.TestObjectServiceImpl.getTestObjectNames(TestObjectServiceImpl.java:87)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:528)
                 ... 27 more
                


                • 5. Re: Problem re-deploying war inside ear
                  jaikiran pai Master

                  I use Windows and unfortunately i can't try out the same scenario on Windows because of the EAR file being locked (which is a different issue all together). I tried this with exploded deployment on Windows. Works fine for me. In your case, do you see that the war is undeployed when you are redeploying the application? A log like this:

                  15:41:12,462 INFO [TomcatDeployment] undeploy, ctxPath=/myApp, vfsUrl=myApp.ear/myapp.war
                  


                  Do you have any classloader isolations enabled on your EAR or WAR file through jboss-app.xml or jboss-web.xml?


                  • 6. Re: Problem re-deploying war inside ear
                    Thomas Michal Newbie

                    But the log says, that the war is deployed again:

                    09:43:32,435 INFO [TomcatDeployment] deploy, ctxPath=/myapp, vfsUrl=myapp.ear/myapp.war
                    


                    Or should there be more log output for a successful redeployment?

                    I don't use classloader isolations, the only configuration I have in the config files is the security-domain.

                    These are my config files:

                    application.xml:
                    <?xml version="1.0" encoding="UTF-8"?>
                    <application xmlns="http://java.sun.com/xml/ns/j2ee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                     http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
                     version="1.4">
                     <display-name>myappEAR</display-name>
                     <module>
                     <java>myapp.jar</java>
                     </module>
                     <module>
                     <web>
                     <web-uri>myapp.war</web-uri>
                     <context-root>myapp</context-root>
                     </web>
                     </module>
                    </application>
                    


                    jboss.xml:
                    <?xml version='1.0' encoding='UTF-8' ?>
                    <jboss>
                     <security-domain>java:/jaas/other</security-domain>
                    </jboss>
                    


                    jboss-web.xml:
                    <?xml version='1.0' encoding='UTF-8' ?>
                    <jboss-web>
                     <security-domain>java:/jaas/mth</security-domain>
                    </jboss-web>
                    


                    context.xml:
                    <!-- Add the ExtendedFormAuthenticator to get access to the username/password/exception -->
                    <Context cookies="true" crossContext="true">
                     <Valve className="org.jboss.web.tomcat.security.ExtendedFormAuthenticator"
                     includePassword="true" />
                    </Context>
                    


                    • 7. Re: Problem re-deploying war inside ear
                      Thomas Michal Newbie

                      Update:

                      I changed my servlets code to get the local interface for the ejb to be called via @ejb annotation.

                       private TestObjectAdminBeanLocal testObjectAdmin;
                      
                       @EJB(name = "testObjectAdmin")
                       public void setTestObjectAdmin(TestObjectAdminBeanLocal testObjectAdmin) {
                       this.testObjectAdmin = testObjectAdmin;
                       }
                      


                      The exception that occurs now seems to have the same cause as the one before, when I was trying to get the local interface from jndi via lookup and a class cast exception was thrown while narrowing.

                      2008-04-21 15:26:55,384 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp]] Marking servlet TestObjectService as unavailable
                      2008-04-21 15:26:55,385 DEBUG [org.apache.catalina.core.StandardWrapper] Error instantiating servlet class de.mth.myapp.webapp.TestObjectServiceImpl
                      java.lang.RuntimeException: Non matching type for @Inject of setter: public void de.mth.myapp.webapp.TestObjectServiceImpl.setTestObjectAdmin(de.mth.myapp.server.TestObjectAdminBeanLocal) for type: $Proxy90
                       at org.jboss.injection.JndiMethodInjector.inject(JndiMethodInjector.java:104)
                       at org.jboss.web.tomcat.service.TomcatInjectionContainer.processAnnotations(TomcatInjectionContainer.java:266)
                       at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:172)
                       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
                       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
                       at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4072)
                       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4377)
                       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
                       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
                       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5357)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:347)
                       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:89)
                       at org.jboss.web.deployers.WebModule.start(WebModule.java:67)
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
                       at $Proxy5.start(Unknown Source)
                       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:255)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                       at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
                       at org.jboss.system.ServiceController.start(ServiceController.java:431)
                       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:150)
                       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:108)
                       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
                       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
                       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                       at java.lang.Thread.run(Thread.java:595)
                      Caused by: java.lang.IllegalArgumentException: argument type mismatch
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at org.jboss.injection.JndiMethodInjector.inject(JndiMethodInjector.java:94)
                       ... 78 more
                      


                      Again, if I restart the server, it works fine and the local object is injected correctly and the updated webapp gets deployed.

                      Does JBoss need any configuration for the servlet-ejb relationship in the deployment descriptor of the ear, jar or war to redeploy correctly?



                      • 8. Re: Problem re-deploying war inside ear
                        jaikiran pai Master

                         

                        Does JBoss need any configuration for the servlet-ejb relationship in the deployment descriptor of the ear, jar or war to redeploy correctly?


                        No it doesn't. As long as you are redeploying the entire EAR (which you seem to be doing correctly), there should not have been a ClassCastException. Unfortunately, i don't have a Linux setup where i can try to reproduce this myself. So i won't be of much help in debugging this. Maybe someone who has a Linux system will be able to help you.


                        • 9. Re: Problem re-deploying war inside ear
                          jaikiran pai Master

                           

                          "cardoso" wrote:
                          The application is deployed as archive myapp.ear.

                          An ant script touches the descriptor files (application.xml, web.xml), rebuilds the application and copies to the deploy folder, overriding the existing ear file there.



                          Btw, how about trying this - Delete the existing EAR from the deploy folder (maybe through an Ant script) and once the EAR is deleted successfully, then just copy the new EAR to the deploy folder. See if that works.

                          • 10. Re: Problem re-deploying war inside ear
                            Thomas Michal Newbie

                             


                            Btw, how about trying this - Delete the existing EAR from the deploy folder (maybe through an Ant script) and once the EAR is deleted successfully, then just copy the new EAR to the deploy folder. See if that works.


                            After deleting the old ear file, when deploying the new ear, the war file it is unpacked to the tmp folder now, but there is still the "java.lang.IllegalArgumentException: argument type mismatch"
                            thrown as before, when catalina tries to initiate the servlet.

                            And there is an error message now that the servlet is not available, when the new webapp is calling the servlet.

                            JBoss seems to use either the old stubs or old skeletons if the argument does not fit the object that is injected?

                            • 11. Re: Problem re-deploying war inside ear
                              Thomas Michal Newbie

                              Jaikiran,

                              now I installed JBoss 4.2.2.GA and there the application is working as expected and redeployed correctly.

                              As you already guessed, it seems to be a JBoss 5 deployment problem.

                              Thank you very much for your help, I will switch to the 4.2.2 version of JBoss and wait for the release of an 5.0.0 alpha.

                              Best regards

                              Thomas