users@glassfish.java.net

Re: OSGI wab deploy fails with "Inconsistent Module State" exception (glassfish 3.1)

From: Kumar Jayanti <v.b.kumar.jayanti_at_oracle.com>
Date: Thu, 25 Aug 2011 18:18:34 +0530

It can also happen if the domains/domainx/generated/policy/your_app dir had some policy in it already but the domain admin server thinks that the app is not deployed yet and hence allows a redeploy of the app.

It could also occur if there was a failure in cleaning up policies (due to a bug) incase of a failed previous deployment.

Make sure you cleanup generated/policy dir before you attempt to deploy the app again.


On 25-Aug-2011, at 5:33 PM, Nithya Subramanian wrote:

> The "Inconsistent Module State" error happens when there is an issue while linking the security policies between the component archives in the war. If this error recurs in 3.1.1, please attach the test application.
>
> Thanks
> Nithya
>
> On Wednesday 24 August 2011 10:18 PM, Sahoo wrote:
>> I have seen such exception without any kind of OSGi application deployment as well and I never understood what was going wrong. I suspect some deployment object gets corrupted.
>>
>> Would you mind trying out GlassFish 3.1.1 instead of GlassFish 3.1? 3.1.1 has a number of bugs fixed since 3.1 and is fully compatible with 3.1.
>>
>> Thanks much,
>> Sahoo
>>
>> On Wednesday 24 August 2011 08:19 PM, forums_at_java.net wrote:
>>> Hi,
>>>
>>> I am trying to deploy a new OSGI WAB file to glassfish 3.1, GA build. This
>>> deployment fails with "Inconsistent Module State" exception. The war contains
>>> several jars with EJBs and a static content.
>>>
>>> What may be the reason of this exception? Where should I start the research?
>>>
>>> The full stack trace is:
>>>
>>> [#|2011-08-24T17:15:07.364+0300|WARNING|glassfish3.1|org.glassfish.osgijavaeebase|_ThreadID=21;_ThreadName=Thread-1;|Failed
>>> to deploy bundle com.mywar [257]
>>> org.glassfish.osgijavaeebase.DeploymentException: Deployment of com.mywar
>>> [257] failed because of following reason: Failed while deploying bundle
>>> com.mywar [257] : java.lang.RuntimeException: Failed to deploy bundle [
>>> com.mywar [257] ], root cause: Exception while loading the app
>>> at
>>> org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:125)
>>> at
>>> org.glassfish.osgijavaeebase.OSGiContainer.deploy(OSGiContainer.java:154)
>>> at
>>> org.glassfish.osgijavaeebase.JavaEEExtender.deploy(JavaEEExtender.java:107)
>>> at
>>> org.glassfish.osgijavaeebase.JavaEEExtender.access$200(JavaEEExtender.java:61)
>>> at
>>> org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:151)
>>> at
>>> org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:148)
>>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>> 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:662)
>>> Caused by: java.lang.RuntimeException: Failed to deploy bundle [ com.mywar
>>> [257] ], root cause: Exception while loading the app
>>> at
>>> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:196)
>>> at
>>> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.execute(OSGiDeploymentRequest.java:118)
>>> at
>>> org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:121)
>>> ... 10 more
>>> Caused by: org.glassfish.deployment.common.DeploymentException: Error in
>>> linking security policy for com.mywar_1.0.0.SNAPSHOT -- Inconsistent Module
>>> State
>>> at
>>> com.sun.enterprise.security.SecurityUtil.linkPolicyFile(SecurityUtil.java:335)
>>> at
>>> com.sun.enterprise.security.SecurityDeployer.linkPolicies(SecurityDeployer.java:279)
>>> at
>>> com.sun.enterprise.security.SecurityDeployer.access$100(SecurityDeployer.java:81)
>>> at
>>> com.sun.enterprise.security.SecurityDeployer$AppDeployEventListener.event(SecurityDeployer.java:114)
>>> at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
>>> at
>>> org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:262)
>>> at
>>> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
>>> at
>>> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
>>> at
>>> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:183)
>>> ... 12 more
>>> |#]
>>>
>>> thanks
>>>
>>>
>>>
>>>
>>> --
>>>
>>> [Message sent by forum member 'okna2000']
>>>
>>> View Post: http://forums.java.net/node/836683
>>>
>>>
>>
>