9 Replies Latest reply on Jul 13, 2006 1:35 PM by Scott Stark

    Error redeploying dependent war

    octopus Newbie

      I have a deployed webapp which depends on some mbean (having depends clause in jboss-web.xml).
      When mbean is being redeployed it causes redeploying this webapp which finishes with NPE in WebModule.java

      This bug reproduced in both jboss 4.0.0 and 3.2.6

      Simple test case:

      Create sample service in /deploy, for example test-properties-service.xml

      <server>
       <mbean code="org.jboss.varia.property.SystemPropertiesService"
       name="test:service=SystemProperties">
       <!-- Set propertuies using the properties file style. -->
       <attribute name="Properties">
       </attribute>
       </mbean>
      </server>
      


      Create sample war which depends on this service, for example
      test.war
       |
       WEB-INF
       |
       web.xml
       jboss-web.xml
       |
       META-INF
      


      where web.xml
      <web-app >
      
      </web-app>
      


      jboss-web.xml
      <jboss-web>
      
       <depends>test:service=SystemProperties</depends>
      
      </jboss-web>
      


      now both test-properties-service.xml and test.war placed in /deploy and deployed successfully.

      Now update test-properties-service.xml (edit-save, touch, etc)
      jboss will try to redeploy test.war with following result:

      13:22:33,483 DEBUG [MainDeployer] Undeploying file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service
      .xml
      13:22:33,483 DEBUG [SARDeployer] undeploying document file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties
      -service.xml
      13:22:33,499 DEBUG [SARDeployer] stopping mbean test:service=SystemProperties
      13:22:33,499 DEBUG [ServiceController] stopping service: test:service=SystemProperties
      13:22:33,514 DEBUG [ServiceController] stopping dependent services for: test:service=SystemProperties depende
      nt services are: [ObjectName: jboss.web.deployment:war=test.war,id=-1080743623
       state: RUNNING
       I Depend On: test:service=SystemProperties
      
       Depends On Me: ]
      13:22:33,530 DEBUG [ServiceController] stopping service: jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,530 DEBUG [ServiceController] stopping dependent services for: jboss.web.deployment:war=test.war,id=-1080743623
      dependent services are: []
      13:22:33,546 DEBUG [WebModule] Stopping jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,546 INFO [TomcatDeployer] undeploy, ctxPath=/test, warUrl=file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tm
      p45130test.war/
      13:22:33,577 DEBUG [Context] Stopping
      13:22:33,577 DEBUG [Context] Stopping filters
      13:22:33,577 DEBUG [Context] Stopping filter 'CommonHeadersFilter'
      13:22:33,592 DEBUG [Context] Processing standard container shutdown
      13:22:33,608 DEBUG [Context] Sending application stop events
      13:22:33,624 DEBUG [Context] resetContext jboss.web:j2eeType=WebModule,name=//localhost/test,J2EEApplication=none,J2EESer
      ver=none org.jboss.mx.server.MBeanServerImpl@f99ff5
      13:22:33,624 DEBUG [Context] Stopping complete
      13:22:33,639 DEBUG [WebModule] Stopped jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,639 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.stop,sequenceNumber=225,timeStamp=1099398153639,message=null,userD
      ata=jboss.web.deployment:war=test.war,id=-1080743623]
      13:22:33,655 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.stop,sequenceNumber=226,timeStamp=1099398153655,message=null,userD
      ata=test:service=SystemProperties]
      13:22:33,671 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceDeployer,type=org.jboss.deployment.SubDeployer.stop,sequenceNumber=114,timeStamp=1099398153671,message=null,userD
      ata=org.jboss.deployment.DeploymentInfo@cb27219d { url=file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-propertie
      s-service.xml }
       deployer: org.jboss.deployment.SARDeployer@15a0305
       status: Deployed
       state: STARTED
       watch: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       lastDeployed: 1099397960936
       lastModified: 1099397960874
       mbeans:
       test:service=SystemProperties state: Stopped
      ]
      13:22:33,717 DEBUG [SARDeployer] destroying mbean test:service=SystemProperties
      13:22:33,717 DEBUG [ServiceController] destroying service: test:service=SystemProperties
      13:22:33,717 DEBUG [ServiceController] destroying dependent services for: test:service=SystemProperties depen
      dent services are: [ObjectName: jboss.web.deployment:war=test.war,id=-1080743623
       state: STOPPED
       I Depend On: test:service=SystemProperties
      
       Depends On Me: ]
      13:22:33,749 DEBUG [ServiceController] destroying service: jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,749 DEBUG [ServiceController] destroying dependent services for: jboss.web.deployment:war=test.war,id=-108074362
      3 dependent services are: []
      13:22:33,764 DEBUG [ServiceController] stopping service: jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,764 DEBUG [WebModule] Destroying jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,764 DEBUG [WebModule] Destroyed jboss.web.deployment:war=test.war,id=-1080743623
      13:22:33,764 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.destroy,sequenceNumber=227,timeStamp=1099398153764,message=null,us
      erData=jboss.web.deployment:war=test.war,id=-1080743623]
      13:22:33,780 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[sourc
      e=jboss.system:service=ServiceController,type= org.jboss.system.ServiceMBean.destroy,sequenceNumber=227,timeStamp=1099398
      153764,message=null,userData=jboss.web.deployment:war=test.war,id=-1080743623]
      13:22:33,811 DEBUG [ServiceController] stopping service: test:service=SystemProperties
      13:22:33,811 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.destroy,sequenceNumber=228,timeStamp=1099398153811,message=null,us
      erData=test:service=SystemProperties]
      13:22:33,827 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[sourc
      e=jboss.system:service=ServiceController,type= org.jboss.system.ServiceMBean.destroy,sequenceNumber=228,timeStamp=1099398
      153811,message=null,userData=test:service=SystemProperties]
      13:22:33,827 DEBUG [SARDeployer] removing mbean test:service=SystemProperties
      13:22:33,842 DEBUG [ServiceController] removing service: test:service=SystemProperties
      13:22:33,842 DEBUG [ServiceController] removing test:service=SystemProperties from server
      13:22:33,842 DEBUG [ServiceController] Context not removed, it is recording dependencies: ObjectName: test:se
      rvice=SystemProperties
       state: DESTROYED
       I Depend On:
       Depends On Me: jboss.web.deployment:war=test.war,id=-1080743623
      
      13:22:33,874 DEBUG [SARDeployer] Unregistering service UCL=jmx.loading:UCL=17210a5
      13:22:33,874 DEBUG [UnifiedLoaderRepository3] UnifiedLoaderRepository removed(false) org.jboss.mx.loading.UnifiedClassLoa
      der3@17210a5{ url=file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45117test-properties-service.xml ,addedOrder
      =21}
      13:22:33,889 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceDeployer,type=org.jboss.deployment.SubDeployer.destroy,sequenceNumber=115,timeStamp=1099398153889,message=null,us
      erData=org.jboss.deployment.DeploymentInfo@cb27219d { url=file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-proper
      ties-service.xml }
       deployer: org.jboss.deployment.SARDeployer@15a0305
       status: Deployed
       state: STARTED
       watch: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       lastDeployed: 1099397960936
       lastModified: 1099397960874
       mbeans:
       test:service=SystemProperties (state not available)
      ]
      13:22:33,936 DEBUG [J2EEManagedObject] removeObject(), name: test:service=SystemProperties, encrypted name: d
      ukascopy.system%3aservice%3dSystemProperties, search criteria: jboss.management.local:j2eeType=MBean,*,name=test.sys
      tem%3aservice%3dSystemProperties
      13:22:33,952 DEBUG [MBean] preDeregister(), parent: jboss.management.local:J2EEServer=Local,j2eeType=ServiceModule,name=d
      ukascopy-properties-service.xml
      13:22:33,967 DEBUG [ServiceModuleFactory] Destroy MBean, name: test:service=SystemProperties
      13:22:33,967 DEBUG [ServiceModule] destroy(), remove Service Module: test-properties-service.xml
      13:22:33,967 DEBUG [J2EEManagedObject] removeObject(), name: test-properties-service.xml, encrypted name: test-
      properties-service.xml, search criteria: jboss.management.local:j2eeType=ServiceModule,*,name=test-properties-servic
      e.xml
      13:22:33,983 DEBUG [ServiceModule] preDeregister(), parent: jboss.management.local:j2eeType=J2EEServer,name=Local
      13:22:33,983 DEBUG [ServiceModuleFactory] Removed JSR-77 SAR: test-properties-service.xml
      13:22:33,999 DEBUG [UnifiedClassLoader] Unregistering ucl=org.jboss.mx.loading.UnifiedClassLoader3@17210a5{ url=file:/C:/
      Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45117test-properties-service.xml ,addedOrder=21}
      13:22:33,999 DEBUG [UnifiedLoaderRepository3] UnifiedLoaderRepository removed(true) org.jboss.mx.loading.UnifiedClassLoad
      er3@17210a5{ url=file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45117test-properties-service.xml ,addedOrder=
      21}
      13:22:34,014 DEBUG [DeploymentInfo] Cleaned Deployment: file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45117dukasc
      opy-properties-service.xml
      13:22:34,014 DEBUG [MainDeployer] Undeployed file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.
      xml
      13:22:34,030 DEBUG [MainDeployer] Starting deployment of package: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/dukascop
      y-properties-service.xml
      13:22:34,030 DEBUG [MainDeployer] Starting deployment (init step) of package at: file:/C:/Cluster/jboss-3.2.6/server/all/
      deploy/test-properties-service.xml
      13:22:34,046 DEBUG [MainDeployer] Copying file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       -> C:\Cluster\jboss-3.2.6\server\all\tmp\deploy\tmp45131test-properties-service.xml
      13:22:34,061 DEBUG [MainDeployer] using deployer org.jboss.deployment.SARDeployer@15a0305
      13:22:34,077 DEBUG [SARDeployer] about to copy 0 local directories
      13:22:34,077 DEBUG [SARDeployer] looking for nested deployments in : file:/C:/Cluster/jboss-3.2.6/server/all/deploy/dukas
      copy-properties-service.xml
      13:22:34,092 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceDeployer,type=org.jboss.deployment.SubDeployer.init,sequenceNumber=116,timeStamp=1099398154092,message=null,userD
      ata=org.jboss.deployment.DeploymentInfo@cb27219d { url=file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-propertie
      s-service.xml }
       deployer: org.jboss.deployment.SARDeployer@15a0305
       status: null
       state: INIT_DEPLOYER
       watch: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       lastDeployed: 0
       lastModified: 0
       mbeans:
      ]
      13:22:34,139 DEBUG [DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplemen
      tation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: n
      ull)
      13:22:34,155 DEBUG [UnifiedClassLoader] New jmx UCL with url file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45131d
      ukascopy-properties-service.xml
      13:22:34,155 DEBUG [UnifiedClassLoader] setRepository, r=org.jboss.mx.loading.UnifiedLoaderRepository3@1b8e059, ucl=org.j
      boss.mx.loading.UnifiedClassLoader3@37dde9{ url=file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45131test-prop
      erties-service.xml ,addedOrder=0}
      13:22:34,171 DEBUG [UnifiedClassLoader] setRepository, r=org.jboss.mx.loading.UnifiedLoaderRepository3@1b8e059, ucl=org.j
      boss.mx.loading.UnifiedClassLoader3@37dde9{ url=file:/C:/Cluster/jboss-3.2.6/server/all/tmp/deploy/tmp45131test-prop
      erties-service.xml ,addedOrder=0}
      13:22:34,186 DEBUG [UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@37dde9{ url=file:/C:/Cluste
      r/jboss-3.2.6/server/all/tmp/deploy/tmp45131test-properties-service.xml ,addedOrder=0}
      13:22:34,186 DEBUG [MainDeployer] found 0 subpackages of file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-propert
      ies-service.xml
      13:22:34,202 DEBUG [MainDeployer] Watching new file: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-
      service.xml
      13:22:34,202 DEBUG [MainDeployer] create step for deployment file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-pro
      perties-service.xml
      13:22:34,217 DEBUG [SARDeployer] Deploying SAR, create step: url file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test
      -properties-service.xml
      13:22:34,217 DEBUG [SARDeployer] Registering service UCL=jmx.loading:UCL=37dde9
      13:22:34,233 DEBUG [ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      13:22:34,233 DEBUG [SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.r
      egistered source=JMImplementation:type=MBeanServerDelegate seq-no=487 time=1099398154233 message=null objectName=jmx.load
      ing:UCL=37dde9 userData=null, handback:2147483647
      13:22:34,264 DEBUG [ServiceCreator] About to create bean: test:service=SystemProperties with code: org.jboss.
      varia.property.SystemPropertiesService
      13:22:34,280 DEBUG [ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      13:22:34,280 DEBUG [SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.r
      egistered source=JMImplementation:type=MBeanServerDelegate seq-no=488 time=1099398154280 message=null objectName=dukascop
      y.system:service=SystemProperties userData=null, handback:2147483647
      13:22:34,296 DEBUG [ServiceCreator] Created bean: test:service=SystemProperties
      13:22:34,296 DEBUG [ServiceConfigurator] Properties set to {test.mt.chart.chartserver.url=http://freeserv.test.
      com/ru.test.server.auto.image/chart/, test.mt.datalayer.cache.url=rmi://192.168.100.174:1099/CacheServer} in du
      kascopy.system:service=SystemProperties
      13:22:34,311 DEBUG [ServiceController] Creating service test:service=SystemProperties
      13:22:34,311 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.create,sequenceNumber=229,timeStamp=1099398154311,message=null,use
      rData=test:service=SystemProperties]
      13:22:34,327 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[sourc
      e=jboss.system:service=ServiceController,type= org.jboss.system.ServiceMBean.create,sequenceNumber=229,timeStamp=10993981
      54311,message=null,userData=test:service=SystemProperties]
      13:22:34,342 DEBUG [ServiceController] Creating dependent components for: test:service=SystemProperties depen
      dents are: [ObjectName: jboss.web.deployment:war=test.war,id=-1080743623
       state: DESTROYED
       I Depend On: test:service=SystemProperties
      
       Depends On Me: ]
      13:22:34,374 DEBUG [ServiceController] Creating service jboss.web.deployment:war=test.war,id=-1080743623
      13:22:34,374 DEBUG [WebModule] Creating jboss.web.deployment:war=test.war,id=-1080743623
      13:22:34,389 DEBUG [WebModule] Created jboss.web.deployment:war=test.war,id=-1080743623
      13:22:34,405 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.create,sequenceNumber=230,timeStamp=1099398154405,message=null,use
      rData=jboss.web.deployment:war=test.war,id=-1080743623]
      13:22:34,421 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[sourc
      e=jboss.system:service=ServiceController,type= org.jboss.system.ServiceMBean.create,sequenceNumber=230,timeStamp=10993981
      54405,message=null,userData=jboss.web.deployment:war=test.war,id=-1080743623]
      13:22:34,436 DEBUG [ServiceController] Creating dependent components for: jboss.web.deployment:war=test.war,id=-108074362
      3 dependents are: []
      13:22:34,436 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceDeployer,type=org.jboss.deployment.SubDeployer.create,sequenceNumber=117,timeStamp=1099398154436,message=null,use
      rData=org.jboss.deployment.DeploymentInfo@cb27219d { url=file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-propert
      ies-service.xml }
       deployer: org.jboss.deployment.SARDeployer@15a0305
       status: null
       state: CREATE_DEPLOYER
       watch: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       lastDeployed: 1099398154202
       lastModified: 1099398154061
       mbeans:
       test:service=SystemProperties state: Created
      ]
      13:22:34,483 DEBUG [MainDeployer] Done with create step of deploying test-properties-service.xml
      13:22:34,499 DEBUG [MainDeployer] Begin deployment start file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-propert
      ies-service.xml
      13:22:34,499 DEBUG [SARDeployer] Deploying SAR, start step: url file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-
      properties-service.xml
      13:22:34,514 DEBUG [ServiceController] starting service test:service=SystemProperties
      13:22:34,514 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceController,type= org.jboss.system.ServiceMBean.start,sequenceNumber=231,timeStamp=1099398154514,message=null,user
      Data=test:service=SystemProperties]
      13:22:34,530 DEBUG [ServiceController] Starting dependent components for: test:service=SystemProperties depen
      dent components: [ObjectName: jboss.web.deployment:war=test.war,id=-1080743623
       state: CREATED
       I Depend On: test:service=SystemProperties
      
       Depends On Me: ]
      13:22:34,546 DEBUG [ServiceController] starting service jboss.web.deployment:war=test.war,id=-1080743623
      13:22:34,546 DEBUG [WebModule] Starting jboss.web.deployment:war=test.war,id=-1080743623
      13:22:34,561 ERROR [WebModule] Starting failed jboss.web.deployment:war=test.war,id=-1080743623
      java.lang.NullPointerException
       at org.jboss.web.WebModule.startModule(WebModule.java:61)
       at org.jboss.web.WebModule.startService(WebModule.java:40)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
       at $Proxy18.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:414)
       at org.jboss.system.ServiceController.start(ServiceController.java:436)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
       at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201
      )
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      13:22:34,717 WARN [ServiceController] Problem starting service jboss.web.deployment:war=test.war,id=-1080743623
      RuntimeMBeanException: java.lang.NullPointerException
      Cause: java.lang.NullPointerException
       at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:82)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
       at $Proxy18.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:414)
       at org.jboss.system.ServiceController.start(ServiceController.java:436)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
       at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201
      )
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.lang.NullPointerException
       at org.jboss.web.WebModule.startModule(WebModule.java:61)
       at org.jboss.web.WebModule.startService(WebModule.java:40)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       ... 40 more
      13:22:34,921 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service
      =ServiceDeployer,type=org.jboss.deployment.SubDeployer.start,sequenceNumber=118,timeStamp=1099398154921,message=null,user
      Data=org.jboss.deployment.DeploymentInfo@cb27219d { url=file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properti
      es-service.xml }
       deployer: org.jboss.deployment.SARDeployer@15a0305
       status: Starting
       state: START_DEPLOYER
       watch: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-service.xml
       lastDeployed: 1099398154202
       lastModified: 1099398154061
       mbeans:
       test:service=SystemProperties state: Started
      ]
      13:22:34,967 DEBUG [ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      13:22:34,967 DEBUG [SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.r
      egistered source=JMImplementation:type=MBeanServerDelegate seq-no=489 time=1099398154967 message=null objectName=jboss.ma
      nagement.local:J2EEServer=Local,j2eeType=ServiceModule,name=test-properties-service.xml userData=null, handback:2147
      483647
      13:22:34,983 DEBUG [ServiceModule] postRegister(), parent: jboss.management.local:j2eeType=J2EEServer,name=Local
      13:22:34,999 DEBUG [ServiceModule] Created JSR-77 ServiceModule, name: test-properties-service.xml
      13:22:34,999 DEBUG [ServiceModuleFactory] Created ServiceModule: jboss.management.local:J2EEServer=Local,j2eeType=Service
      Module,name=test-properties-service.xml
      13:22:35,014 DEBUG [ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      13:22:35,014 DEBUG [SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.r
      egistered source=JMImplementation:type=MBeanServerDelegate seq-no=490 time=1099398155014 message=null objectName=jboss.ma
      nagement.local:J2EEApplication=null,J2EEServer=Local,ServiceModule=test-properties-service.xml,j2eeType=MBean,name=d
      ukascopy.system%3aservice%3dSystemProperties userData=null, handback:2147483647
      13:22:35,030 DEBUG [MBean] postRegister(), parent: jboss.management.local:J2EEServer=Local,j2eeType=ServiceModule,name=du
      kascopy-properties-service.xml
      13:22:35,046 DEBUG [ServiceModuleFactory] Create MBean, name: test:service=SystemProperties, SAR Module: jbos
      s.management.local:J2EEServer=Local,j2eeType=ServiceModule,name=test-properties-service.xml
      13:22:35,046 DEBUG [MainDeployer] End deployment start on package: test-properties-service.xml
      13:22:35,046 DEBUG [MainDeployer] Deployed package: file:/C:/Cluster/jboss-3.2.6/server/all/deploy/test-properties-s
      ervice.xml
      
      



        • 1. Re: Error redeploying dependent war
          bern Newbie

          I have exactly the same problem and it is very annoying. Any help here would be greatly appreciated.

          • 2. Re: Error redeploying dependent war
            Scott Stark Master

            File a bug report on either sourceforge or the new jira server:
            http://jira.jboss.com/jira/secure/BrowseProject.jspa

            • 4. Re: Error redeploying dependent war
              Vicky Kak Master

              Scott,
              I have been able to implement this
              >>This method should really be removing the war dependency from the service in addition to nulling out all of these variables as the war has been
              >>undeployed and should no longer be usable.
              The code snippet doing this will look like this

              protected void destroyService()
               {
              try
              {
              ObjectName jmxName = (ObjectName) di.context.get(AbstractWebContainer.WEB_MODULE);
              ServiceControllerMBean serviceController = (ServiceControllerMBean)
              MBeanProxyExt.create(ServiceControllerMBean.class,
              ServiceControllerMBean.OBJECT_NAME, di.getServer());
              serviceController.remove(jmxName);
              }
              catch (Exception e)
              {
              System.out.println("Exception in destroyService"+e);
              }
              this.di = null;
               this.container = null;
               this.deployer = null;
               }
              



              >> The redeployment of the properties service
              >>would then have no dependent war to start.
              Yes this is done when I made the above changes .

              The following feature needs to be discusses here .
              >>What is really needed is a redeploy notion that
              >>would recycle the dependent deployments, but such a notion
              >>does not exist.
              Now the war which depends on the property service is removed from the nameToServiceMap attribute of the ServiceController. The DeploymentScanner can not figure out that the "WAR" needs to be redeployed as this has not been modified.
              So we will have to modify the destroyService() so that it deos
              1) Remove the web Deployment From the ServiceController
              2) Remove the Deployment From the MainDeployer
              3) Recycle the Deployment of the Web application , in case the web is the sub-deployment then we need to recycle the parent deployment .

              I propose the changes in the following files
              1) org.jboss.web.WebModule
              2) org.jboss.deployment.scanner.URLDeploymentScanner
              3) org.jboss.deployment.scanner.URLDeploymentScannerMBean
              4) org.jboss.deployment.MainDeployerMBean
              5) org.jboss.web.AbstractWebContainer

              Here goes the changes
              org.jboss.web.WebModule
              protected void destroyService()
               {
               try
               {
               ObjectName jmxName = (ObjectName) di.context.get(AbstractWebContainer.WEB_MODULE);
               ServiceControllerMBean serviceController = (ServiceControllerMBean)
               MBeanProxyExt.create(ServiceControllerMBean.class,
               ServiceControllerMBean.OBJECT_NAME, di.getServer());
              
               // Remove the Deployment From the ServiceController
               serviceController.remove(jmxName);
               MainDeployerMBean mainDeployer = (MainDeployerMBean)
               MBeanProxyExt.create(MainDeployerMBean.class,
               MainDeployerMBean.OBJECT_NAME, di.getServer());
              
               // Remove the Deployment From the MainDeployer
               Map deploymentMap = mainDeployer.getDeploymentMap();
               deploymentMap.remove(di.url);
              
               //Recycle the Deployment.
               javax.management.ObjectName OBJECT_NAME=
               org.jboss.mx.util.ObjectNameFactory.create("jboss.deployment:type=DeploymentScanner,flavor=URL");
               URLDeploymentScannerMBean deployerScanner = (URLDeploymentScannerMBean)
               MBeanProxyExt.create(URLDeploymentScannerMBean.class,
               OBJECT_NAME, di.getServer());
               Set deployedSet = deployerScanner.getDeployedSet();
               long timeModifier = System.currentTimeMillis();
               System.out.println("URL is "+di.url);
               deployerScanner.redeployUrl(di,timeModifier);
               }
               catch (Exception e)
               {
               System.out.println("Exception in destroyService"+e);
               }
               this.di = null;
               this.container = null;
               this.deployer = null;
               }
              

              org.jboss.deployment.scanner.URLDeploymentScanner
               public Set getDeployedSet()
               {
               return this.deployedSet;
               }
               public void redeployUrl(DeploymentInfo di, long lastModified1)
               {
               //Call Deployer.deploy()
               URL redeployUrl = null;
               DeploymentInfo current = di;
               DeploymentInfo parentDI = di;
               //System.out.println("Before current url ----->"+current.url);
               while(current!=null){
               //System.out.println("After current url ----->"+current.url);
               parentDI = current;
               current = current.parent;
               }
               for (Iterator i = deployedSet.iterator(); i.hasNext();)
               {
               DeployedURL deployedURL = (DeployedURL) i.next();
               URL url = deployedURL.url;
               long deployedLastModified = deployedURL.deployedLastModified;
               long lastModified = deployedURL.getLastModified();
               if(url.equals(parentDI.url))
               {
               System.out.println("Going to Redeploy url ----->"+url);
               //System.out.println("deployedLastModified ----->"+deployedLastModified);
               //System.out.println("lastModified ----->"+lastModified);
               deployedURL.deployedLastModified=lastModified1;
               return;
               //System.out.println("lastModified is set at ----->"+lastModified1);
               }
               }
               }
              

              org.jboss.deployment.scanner.URLDeploymentScannerMBean
               java.util.Set getDeployedSet();
               void redeployUrl(DeploymentInfo di,long lastModified);
              

              org.jboss.deployment.MainDeployerMBean
               Map getDeploymentMap();
               void setDeploymentMap(Map deploymentMap);
              

              org.jboss.web.AbstractWebContainer
              public synchronized void destroy(DeploymentInfo di)
               throws DeploymentException
               {
               ObjectName jmxName = (ObjectName) di.context.get(WEB_MODULE);
               try
               {
               if( jmxName != null )
               {
               serviceController.destroy(jmxName);
               //Changed by Vicky , July 6 2006
               //server.unregisterMBean(jmxName);
               //Changed by Vicky , July 6 2006
               }
               }
               catch (DeploymentException e)
               {
               throw e;
               }
               catch(Exception e)
               {
               throw new DeploymentException("Unable to stop web module", e);
               }
               // Generate an event for the shutdown
               super.destroy(di);
               }
              



              Does this make a sense , I have tested these changes seems to be working fix for the JBAS11 and JBAS-1748 .
              Please provide your review comments ....

              Regards
              Vicky

              • 5. Re: Error redeploying dependent war
                Holger Engels Newbie

                Hm,

                are we solving the class compatibility problems with dependent deployment units, then?

                Consider two deployment units: A and B, where B depends on A. B holds references to classes from A. Now A gets redeployed -> A2. You'll notice, that B is invalid, cause it still references instances of old A's classloader. You're getting ClassCastExceptions. B has to be redeployed -> B2. B2 will create new instances of A2's new classes.

                Holger

                • 6. Re: Error redeploying dependent war
                  Vicky Kak Master

                   


                  Consider two deployment units: A and B, where B depends on A. B holds references to classes from A. Now A gets redeployed -> A2. You'll notice, that B is invalid, cause it still references instances of old A's classloader. You're getting ClassCastExceptions. B has to be redeployed -> B2. B2 will create new instances of A2's new classes.

                  This looks an interesting case, you have the classes in B holding the reference from A .
                  I am not sure if this needs to be considered for fix, as you have a workaround for this.


                  Regards
                  Vicky


                  • 7. Re: Error redeploying dependent war
                    Scott Stark Master

                    We can't be redeploying the war from destroy service as this should be causing a redeployment infinite recursion when the war is undeployed. Also, we can't be introducing specific logic into only one deployer. The changes to have dependencies trigger redeployments needs to be handled at the system level with changes to the base ServiceController/SubDeployer logic.

                    This is not much of a priority for 4.x since we are redoing the deployers in the jboss5/mc update.

                    • 8. Re: Error redeploying dependent war
                      Vicky Kak Master

                      >>This is not much of a priority for 4.x since we are redoing the deployers in
                      >>the jboss5/mc update.
                      Is there any place where I can look for the information explaining these design changes ?
                      Are these the major changes in the Deployer Architecture ..

                      >>We can't be redeploying the war from destroy service as this should be
                      >>causing a redeployment infinite recursion when the war is undeployed
                      Let me test this...
                      Are you trying to say that if the web applications are redeployed using this logic it will be causing the infinite recursion ...

                      Regards
                      Vicky

                      • 9. Re: Error redeploying dependent war
                        Scott Stark Master

                         

                        "vickyk" wrote:
                        >>This is not much of a priority for 4.x since we are redoing the deployers in
                        >>the jboss5/mc update.
                        Is there any place where I can look for the information explaining these design changes ?
                        Are these the major changes in the Deployer Architecture ..

                        >>We can't be redeploying the war from destroy service as this should be
                        >>causing a redeployment infinite recursion when the war is undeployed
                        Let me test this...
                        Are you trying to say that if the web applications are redeployed using this logic it will be causing the infinite recursion ...

                        Regards
                        Vicky


                        Design discussion starting point is here:
                        http://www.jboss.com/index.html?module=bb&op=viewtopic&t=85963

                        Yes, I don't see how redeployment can work with the war destroy also trying to execute a redeploy. It might just be ignored as a duplicate attempt.