LoginSignup
3
0

More than 3 years have passed since last update.

Error in linking security policy for appName -- Inconsistent Module State. となってしまった時の対応方法

Last updated at Posted at 2017-05-22
  • 環境
    • OS : Windows7
    • Eclipse : Kepler Service Release 2
      • Build id: 20140224-0627
    • GlassFish : 4.1.1

事象 : EclipseでGlassFishを起動したらエラーになって起動できなかった。

ダイアログに表示されたエラー
cannot Deploy appName
deploy is failing=Error occurred during deployment: Exception while loading the app : Error in linking security policy for appName -- Inconsistent Module State. Please see server.log for more details.

server.logを見ろと言われたので {GlassFishのフォルダ}\glassfish\domains{使っているドメイン}\logs\server.log を見ました。

server.log
[2017-05-22T16:10:14.135+0900] [glassfish 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=45 _ThreadName=admin-listener(5)] [timeMillis: 1495437014135] [levelValue: 1000] [[
  Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: Error in linking security policy for appName -- Inconsistent Module State
    at com.sun.enterprise.security.ee.SecurityUtil.linkPolicyFile(SecurityUtil.java:336)
    at com.sun.enterprise.security.ee.SecurityDeployer.linkPolicies(SecurityDeployer.java:318)
    at com.sun.enterprise.security.ee.SecurityDeployer.access$100(SecurityDeployer.java:87)
    at com.sun.enterprise.security.ee.SecurityDeployer$AppDeployEventListener.event(SecurityDeployer.java:145)
    at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:496)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
...省略...

原因 : generatedディレクトリ配下にごみ的なのがあるから

Remove the application folder which is placed under policy folder:
rm -Rf /opt/sun-glassfish/glassfish/domains/domain1/generated/policy/appname
Glassfish: Error in linking security policy for - Stack Overflow

私は最初に見たサイトがこちらだったので generated フォルダ配下を全て削除しましたが、うまくいきました。

Stoped the Glassfish server
Deleted all the content from glassfishhome/glassfish/domains/yourdomainname/generated
Started Glassfish
deployment - Glassfish DeploymentException: Error in linking security policy for - Stack Overflow

対応 : 停止していないGlassFishを殺して、generatedディレクトリ配下を削除する

RHEL6で似たようなことがあった時の対応記録

  1. Eclipse[サーバー]タブでGlassFishを停止する
  2. EclipseのサーバView上で停止していても動いていることがあるのでタスクマネージャーなどで怪しいjava.exe(停止していないGlassFish)がいたら殺す。
  3. generatedディレクトリ配下をすべて削除する
    • {GlassFishのフォルダ}/glassfish/domains/{使っているドメイン}/generated/
  4. Eclipseの[サーバー]タブでGlassFishを選択して右クリック > [クリーン]
    • generatedディレクトリ配下が再作成される
  5. [プロジェクト] > [クリーン]
  6. デプロイして起動する
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0