Glassfish DeploymentException: Error in linking security policy for
Asked Answered
C

8

58

I have been trying to deploy my web application (war) from Glassfish AdminConsole but I keep getting the following error message -

Exception while loading the app : Error in linking security policy for MyApp-war -- Inconsistent Module State.

But it deploys without any problem when I do it from Netbeans. (I don't know if Netbeans is doing something that I am missing before deploying the application.)

And I also tried with the latest version of Glassfish (i.e. V3.1.1 (build 12) ), and I can deploy the same application without any problem from AdminConsole.

I am using Glassfish 3.1 (build 43) and Netbeans 7.0.

Is there any Security Policy setting that I have to have before deploying my application with this version of Glassfish?

Cryptogenic answered 6/9, 2011 at 15:37 Comment(0)
H
105

The same thing was happening to me.

Here is what I did:

  • Stoped the Glassfish server
  • Deleted all the content from glassfishhome/glassfish/domains/yourdomainname/generated
  • Started Glassfish

It worked for me. But what still sucks is that everytime I need to deploy I need to follow this procedure again...

Halfblooded answered 2/8, 2012 at 3:23 Comment(0)
A
41

I will answer this in response to the comment of @SteveTaylor. His answer in the above comment helped me solving the problem, so he is the one who deserves the credits.

Original answer from @SteveTaylor:

The problem is a corrupt OSGi cache. The reason upgrading worked for you is because you started with a clean OSGi cache. All that's needed to fix this problem is delete the entire OSGi cache under $GLASSFISH_HOME/glassfish/domains//osgi-cache

This answer worked for me as well. Thanks a lot. I am using a cluster (Oracle GlassFish 3.1.2.2) consisting of two nodes and a domain server. I removed the OSGi cache under all three directories (2 nodes and domain) after I stopped the cluster and restarted it then. After that, the problem was solved.

Abdu answered 9/9, 2013 at 13:38 Comment(4)
Thanks. Worked for me as well!!Display
Worked for me - had to remvoe the generated and osgi-cache directories and restart the appserver :)Lagan
This is what worked for me also, I was already trying to delete the domains/domain1/generated/* but did not work. Deleting the osgi-cache/* worked.Falk
Thanks. Worked for me without removing the /generated.Epistle
C
1

Probably a bug in the version of Glassfish I was using.

Basically changing to a different (later) version solved the problem.

Cryptogenic answered 29/9, 2011 at 2:26 Comment(5)
For me, the change to GlassFish 3.1.2.2 (not 3.1.2!) helped.Chimerical
+Bhesh Gurung, I believe it's not bug.Betake
to resolve the issue : restart the server/clean the project after that run the application. It should mostly work because it worked for me without switching to 3.1.2.2.Betake
The problem is a corrupt OSGi cache. The reason upgrading worked for you is because you started with a clean OSGi cache. All that's needed to fix this problem is delete the entire OSGi cache under $GLASSFISH_HOME/glassfish/domains/<your-domain>/osgi-cache.Overload
@SteveTaylor your answer worked for me as well. Thanks a lot. I am using a cluster (Oracle GlassFish 3.1.2.2) consisting of two nodes and a domain server. I removed the OSGi cache under all three directories (2 nodes and domain) after I stopped the cluster and restarted it then. After that, the problem was solved.Abdu
A
1

It happen to me to, especially after I check out different version of my web application and try to deploy it to Glassfish.

The only certain solution I've found is to completely stop galssfish, restart it and deploy the application.

Anisometropia answered 29/2, 2012 at 11:29 Comment(2)
This was my option, and server throws this exception: javax.management.RuntimeMBeanException: java.lang.RuntimeException: java.lang.IllegalStateException: BootAMX listener was not calledFrighten
The BootAMX listener exception is not relevant, and is completely safe to ignore.Escalante
C
1

In my case, I was missing @Stateless tag in one of my Managed Beans. Adding it, solved it for me. Hope it helps.

Concordia answered 28/12, 2018 at 10:42 Comment(0)
L
0

I don't know if this helps, but I got the same error when deploying from the command line. In my case I'm using a pretty up-to-date version (GlassFish Server Open Source Edition 3.1.2 (build 23)). What worked for me was removing --force=true from this:

  $ sudo /usr/local/glassfish3/bin/asadmin deploy --force=true ~cornell/designer.war

What's important (I think) is that I had not previously deployed the app. Confusing!

Luminiferous answered 26/4, 2012 at 13:35 Comment(0)
R
0

In my case ,just I do "clean and build". that usually works well.

Regeneracy answered 4/1, 2021 at 6:13 Comment(0)
O
-1

It happen to me too. In my case, it have occurred when I try to deploy the project and forget to start the database server, and then when I start the database server and I deployed again, I got this error message. When this occurred, I recompile the code, stop the server, undeploy the old project and deploy the new again.

Osteotome answered 15/3, 2013 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.