dev@glassfish.java.net

[gf-dev] Any questions about loading the applications

From: <lvsongping_at_cn.fujitsu.com>
Date: Tue, 1 Jul 2014 09:05:52 +0000

Hi, Hong:
Cc: Security team:

【Phenomenon】
    I have some questions about loading the application during the process of starting the cluster, here's my reproduced steps:
1) asadmin deploy --target cluster1 test.ear(there's two web modules inside this ear file)
2) asadmin start-cluster cluster1
3) asadmin stop-cluster cluster1
4) asadmin deploy --force --name true --target cluster1 test.ear(Now I have added a web module to this ear file, so this ear file contains three web modules in total).
5) asadmin start-cluster cluster1

After step 5), the [Inconsistent Module State] were thrown out to the log file and it is failed in loading the applications
[#|2014-06-30T19:23:12.916+0900|SEVERE|||_ThreadID=1;_ThreadName=main;|Error in linking security policy for LES_SOAP_OSK -- Inconsistent Module State
org.glassfish.deployment.common.DeploymentException: Error in linking security policy for LES_SOAP_OSK -- Inconsistent Module State
  at com.sun.enterprise.security.SecurityUtil.linkPolicyFile(SecurityUtil.java:337)
  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:277)
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:482)
  at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:384)
  at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:228)
  at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
  at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
  at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
  at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
  at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
  at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
  at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:255)
  at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:147)
  at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:137)
  at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
  at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
  at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
  at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:601)
  at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
  at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
|#]

【My questions】
1) Is my reproduced steps right? Is it allowed the customer to redeploy the application before the cluster is started as I have list above?
2) After some investigations about the code, I found the security component will check the application's module, if the redeployed application's module number is larger than the deployed one, the security component will throw the exception to the log file.(You can found this phenomenon from the SecurityUtil.linkPolicyFile), Is this the scenario or a bug? Why the security side will check module number during the process of loading the applications.


Thanks & Regards
Jeremy Lv
--------------------------------------------------
Lv Songping
Software Division II
    Development Department I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
        Nanjing, 210012, China
TEL  : +86+25-86630566-9327
COINS: 7998-9327
FAX  : +86+25-83317685
MAIL : lvsongping_at_cn.fujitsu.com
BLOG : https://www.java.net//author/jeremy-lv