dev@glassfish.java.net

[gf-dev] 返: Re: Any questions about loading the applications

From: <lvsongping_at_cn.fujitsu.com>
Date: Fri, 4 Jul 2014 02:17:58 +0000

Hi, Hong:
   
   Thanks for your confirmation. I agree with you and think this is a bug that need to be fixed.

To Jeff Tancill
Cc: Security team:

   Could you help me to confirm this phenomenon from the Security code. This bug is cause by SecurityUtil.linkPolicyFile where used to check the inconsistent of the policy file. I hope if you can give me some advice from the security code.

Thanks & Regards
Jeremy Lv
> -----元のメッセージ-----
> 差出人: Hong Zhang [mailto:hong.hz.zhang_at_oracle.com]
> 送信日時: 2014年7月4日 9:53
> 宛先: dev_at_glassfish.java.net
> 件名: [gf-dev] Re: Any questions about loading the applications
>
> Hi, Jeremy
>
> I guess step 4) is ok that you try to redeploy the application when the
> cluster is offline and ideally when the cluster comes back on, it should
> pick up the latest bits of the application. As this is not a very common
> use case, this code path probably was not tested before.
>
> Security team could comment on what the expected behavior is from security
> code and whether it's something we should fix.
>
> Thanks,
>
> - Hong
>
> On 7/1/2014 5:05 AM, lvsongping_at_cn.fujitsu.com wrote:
> > 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.j
> ava:337)
> > at
> com.sun.enterprise.security.SecurityDeployer.linkPolicies(SecurityDepl
> oyer.java:279)
> > at
> com.sun.enterprise.security.SecurityDeployer.access$100(SecurityDeploy
> er.java:81)
> > at
> com.sun.enterprise.security.SecurityDeployer$AppDeployEventListener.ev
> ent(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(ApplicationLi
> fecycle.java:482)
> > at
> com.sun.enterprise.v3.server.ApplicationLoaderService.processApplicati
> on(ApplicationLoaderService.java:384)
> > at
> com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(Ap
> plicationLoaderService.java:228)
> > at
> com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.j
> ava: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(EventPublishingInh
> abitant.java:139)
> > at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImp
> l.java:78)
> > at
> com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.jav
> a:255)
> > at
> com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup
> .java:147)
> > at
> com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.j
> ava:137)
> > at
> com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishIm
> pl.java:79)
> > at
> com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassF
> ishDecorator.java:63)
> > at
> com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OS
> GiGlassFishImpl.java:69)
> > at
> com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(G
> lassFishMain.java:117)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57)
> > at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:43)
> > at java.lang.reflect.Method.invoke(Method.java:601)
> > at
> com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMai
> n.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
> >
> >