Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] StackOverflow error while deploying osgi runtime in WAS 6.1 with java2 security

Is your webapp granted AllPermission? There is a bug in the version of AdminPermission you are using which has been fixed in the OSGi R4.2 Core specification (implemented in Equinox 3.5 or later) which is causing the endless recursion. In most cases this endless recursion does not get hit because the class loader loading up the framework implementation grants the framework AllPermission and the AllPermission grant short circuits the permission check and avoids the endless recursion. However, if your setup deviates from this at all then additional checks are done to determine if the code on the stack has permissions and this leads to the recursion.

Tom



Inactive hide details for Pradeep Fernando ---06/08/2011 11:54:43 PM---Hi,Pradeep Fernando ---06/08/2011 11:54:43 PM---Hi,


From:

Pradeep Fernando <pradeepfn@xxxxxxxxx>

To:

equinox-dev@xxxxxxxxxxx

Date:

06/08/2011 11:54 PM

Subject:

[equinox-dev] StackOverflow error while deploying osgi runtime in WAS 6.1 with java2 security




Hi,

I was trying to get my OSGI runtime up and running in the IBM WAS 6.1
. My application is a webapp that uses the BridgeServlet as the
connector between appserver and the OSGI environment. It works fine
untill I enable the JAVA2 sercurity.  Since the error traces are
relevant to the OSGI system bundle, I think you guys have a better
idea what is happening.


In the bundleContextImpl class , the startActivator method calls a
doPriviledged method and it recursively calls the other bundles in the
configured system. This is the expected behaviour i guess. But somehow
it throws a stackoverflow (pasted below) exception while doing that it
seems.

The error I'm getting is similar to the error listed in a eclipse
forum [1] . Their advice is to set the ' eclipse.security = true ' in
the config.ini . I did that and it didnt work for me. Apart from that
I cant see the rationale behind setting that property ; didnt see a
usage of that property  during my debugging session.

any thoughts ? explanations ? welcome.


my environment :

windows XP,
IBM WAS 6.1.29 trial version
equinox runtime 3.5  - (this is bit old, but i cant change this right now)
enabled java2 security
granted all permission to my web-app in the policy file



[1]
http://www.eclipse.org/forums/index.php?t=msg&goto=538878&

The Stack Trace :


!SESSION 2011-06-06 11:10:30.756 -----------------------------------------------
eclipse.buildId=unknown
java.fullversion=J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32
j9vmwi3223-20060504 (JIT enabled)
J9VM - 20060501_06428_lHdSMR
JIT  - 20060428_1800_r8
GC   - 20060501_AA
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

!ENTRY org.eclipse.osgi 4 0 2011-06-06 11:10:30.756
!MESSAGE
!STACK 0
org.osgi.framework.BundleException: Exception in
org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start()
of bundle org.eclipse.osgi.
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:805)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
      at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:207)
      at org.eclipse.osgi.framework.internal.core.Framework.launch(Framework.java:649)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:298)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:615)
      at org.wso2.carbon.bridge.EquinoxFrameworkLauncher.start(EquinoxFrameworkLauncher.java:394)
      at org.wso2.carbon.bridge.BridgeServlet.init(BridgeServlet.java:92)
      at javax.servlet.GenericServlet.init(GenericServlet.java:256)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:227)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:341)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1308)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:174)
      at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
      at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:902)
      at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:824)
      at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:542)
      at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:379)
      at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:293)
      at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:93)
      at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:162)
      at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:673)
      at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:626)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1250)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1140)
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:819)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2100)
      at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: java.lang.StackOverflowError
      at org.eclipse.osgi.framework.internal.core.Framework.getAdminPermission(Framework.java:1185)
      at org.eclipse.osgi.framework.internal.core.Framework.checkAdminPermission(Framework.java:1178)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getLocation(AbstractBundle.java:997)
      at org.osgi.framework.AdminPermission$1.run(AdminPermission.java:830)
      at java.security.AccessController.doPrivileged(AccessController.java:192)
      at org.osgi.framework.AdminPermission.getProperties(AdminPermission.java:827)
      at org.osgi.framework.AdminPermission.implies0(AdminPermission.java:650)
      at org.osgi.framework.AdminPermissionCollection.implies(AdminPermission.java:962)
      at org.eclipse.osgi.framework.internal.core.ConditionalPermissionSet.implies(ConditionalPermissionSet.java:224)
      at org.eclipse.osgi.framework.internal.core.BundleCombinedPermissions.implies(BundleCombinedPermissions.java:124)
      at java.security.ProtectionDomain.implies(ProtectionDomain.java:225)
      at java.security.AccessController.checkPermission(AccessController.java:94)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:547)
      at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:213)
      at org.eclipse.osgi.framework.internal.core.Framework.checkAdminPermission(Framework.java:1178)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getLocation(AbstractBundle.java:997)
      at org.osgi.framework.AdminPermission$1.run(AdminPermission.java:830)
      at java.security.AccessController.doPrivileged(AccessController.java:192)




Thanks in advance.


--
Pradeep Fernando.
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image


Back to the top