Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish DeploymentException: Error in linking security policy for

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?

like image 888
Bhesh Gurung Avatar asked Sep 06 '11 15:09

Bhesh Gurung


4 Answers

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...

like image 124
rvnovaes Avatar answered Oct 06 '22 23:10

rvnovaes


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.

like image 36
qupera Avatar answered Oct 07 '22 00:10

qupera


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.

like image 31
Ido Ran Avatar answered Oct 06 '22 23:10

Ido Ran


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

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

like image 28
Bhesh Gurung Avatar answered Oct 06 '22 23:10

Bhesh Gurung