[jboss-user] [JBoss Web Services] - Possible redeploy issue

Daniel Bevenius do-not-reply at jboss.com
Thu Jul 8 09:40:17 EDT 2010


Daniel Bevenius [http://community.jboss.org/people/beve] created the discussion

"Possible redeploy issue"

To view the discussion, visit: http://community.jboss.org/message/551692#551692

--------------------------------------------------------------
Hi, 

I've got an issue with redployment of a JBoss ESB service. This service uses a feature in JBoss ESB that creates a web service for the service automatically when the .esb archive is deployed.
Redploying the .esb archive by touching it or replacing it is not an problem and works just as expected and it  will redeploy cleanly.
The problem I have is when I specify that the .esb archive depends on another deployment using the jboss-classloading features in JBoss AS 5.1.0.
 
 
The use case I have is that I have two deployments, domain-model-1.0.0.jar and service1-1.0.esb.
 
domain-model-1.0.0.jar has a jboss-classloading.xml that looks like this:
<classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY">
    <capabilities>
        <module name="domain-model" version="${version}"/>
    </capabilities>
</classloading>

 
 

service1-1.0.esb has a jboss-classloading.xml that looks like this:
<classloading xmlns="urn:jboss:classloading:1.0" import-all="true">
    <requirements>
        <module name="domain-model" version="${domain.model.version}"/>
    </requirements>
</classloading>

 
When I redploy domain-model-1.0.0.jar I get the following error:
13:53:34,102 INFO  [TomcatDeployment] undeploy, ctxPath=/service1-1.0
13:53:34,328 INFO  [QueueService] Queue[/queue/service1-1.0_esb] stopped
13:53:34,333 INFO  [EsbDeployment] Stopping 'service1-1.0.esb'
13:53:34,526 INFO  [EsbDeployment] Destroying 'service1-1.0.esb'
13:53:34,526 WARN  [ServiceMessageCounterLifecycleResource] Calling cleanup on existing service message counters for identity ID-7
13:53:34,611 INFO  [QueueService] Queue[/queue/service1-1.0_gw] stopped
13:53:34,638 INFO  [DefaultEndpointRegistry] remove: jboss.ws:context=service1-1.0,endpoint=Sample_Service1-1.0
13:53:34,644 INFO  [EsbWsdlDeployer] undeploy CL:BaseClassLoader at 1b41d4dc{vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/}
13:53:34,657 INFO  [STDOUT] Domain Model [1.0.0] stopped
13:53:34,725 INFO  [STDOUT] Domain Model [1.0.0] started
13:53:34,733 WARN  [ESBServiceEndpointInfo] Fault schemas ignored for OneWay service Sample:Service1-1.0
13:53:34,737 INFO  [EsbWsdlDeployer] Generating wsdl url : vfsmemory://service1-1.0_WSDL/WEB-INF/wsdl/Sample/Service1-1.0.wsdl
13:53:34,830 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=service1-1.0,endpoint=Sample_Service1-1.0
13:53:34,839 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/ state=PreReal mode=Manual requiredState=Installed
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/
    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:637)
Caused by: org.jboss.wsf.spi.deployment.WSFDeploymentException: java.lang.IllegalStateException: BaseClassLoader at 1b41d4dc{vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/} classLoader is not connected to a domain (probably undeployed?) for class org.jboss.wsf.stack.jbws.EndpointServlet
    at org.jboss.wsf.spi.deployment.WSFDeploymentException.rethrow(WSFDeploymentException.java:52)
    at org.jboss.wsf.container.jboss50.deployment.tomcat.ModifyWebMetaDataDeploymentAspect.create(ModifyWebMetaDataDeploymentAspect.java:52)
    at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
    at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:78)
    at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)
    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    ... 24 more
Caused by: java.lang.IllegalStateException: BaseClassLoader at 1b41d4dc{vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/} classLoader is not connected to a domain (probably undeployed?) for class org.jboss.wsf.stack.jbws.EndpointServlet
    at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:793)
    at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    at org.jboss.wsf.container.jboss50.deployment.tomcat.WebMetaDataModifierImpl.modifyMetaData(WebMetaDataModifierImpl.java:134)
    at org.jboss.wsf.container.jboss50.deployment.tomcat.WebMetaDataModifierImpl.modifyMetaData(WebMetaDataModifierImpl.java:57)
    at org.jboss.wsf.container.jboss50.deployment.tomcat.ModifyWebMetaDataDeploymentAspect.create(ModifyWebMetaDataDeploymentAspect.java:48)
    ... 29 more
13:53:34,840 INFO  [EsbWsdlDeployer] undeploy CL:BaseClassLoader at 7d4a7918{vfszip:/Users/danbev/work/jboss/as/bundles/jboss-5.1.0.GA/server/default/deploy/service1-1.0.esb/}

 

>From the exception above it looks like the classloader used by the org.jboss.wsf.spi.deployment.Deployment is using a classloader from the now undeployed deployment. You cannot actually see that from the above but I've stepped through the code and verified that the classloader indeed was the one used by the previous deployment.
I've looked through some of the code and one thing that I noticed was this section in org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook and its deploy method:
public void deploy(DeploymentUnit unit) throws DeploymentException
{
  if (ignoreDeployment(unit))
     return;
 
  if (isWebServiceDeployment(unit))
  {
     log.debug("deploy: " + unit.getName());
     Deployment dep = getDeployment(unit);
     if (dep == null)
     {
        dep = createDeployment(unit);
        dep.addAttachment(DeploymentUnit.class, unit);
     }
 
     unit.addAttachment(Deployment.class, dep);
     getDeploymentAspectManager().deploy(dep);
  }
}

 
What I'm seeing is that when the error occurs getDeployment returns a deployment instance and its initialClassLoader will be that of the previous deployment. Later when WebMetaDataModifierImpl gets called it will use the old classloader which you can see is part of the stacktrace above.

One thing that I noticed was that the state of the deployment instance returned from getDeployment is DeploymentState.DESTROYED. I added a check for this and redployment works fine after that:
if (dep == null || dep.getState() == DeploymentState.DESTROYED)

I'm not familiar with the code base and I'm not saying this is a solution but perhaps this might give someone a hint of what the issue is and why it is happening.
I'll attach the use case that I've been using if anyone wants to reproduce this.

Thanks,

/Daniel
 

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/551692#551692]

Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100708/e05c3a41/attachment-0001.html 


More information about the jboss-user mailing list