RCP JWS - java.security.AccessControlException: access denied .log read [message #458325] |
Fri, 17 November 2006 05:09  |
Eclipse User |
|
|
|
Hi
I have RCP (eclipse 3.2 based) deployed by java web start
Application starts, I see first logs and then I receive such error:
java.security.AccessControlException: access denied (java.io.FilePermission C:\tmp\xxxRCP\workspace\.metadata\.log read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
...
!ENTRY org.eclipse.equinox.registry 4 1 2006-11-16 17:36:07.451
!MESSAGE Unable to create view ID org.xxx.client.views.commandTreeView: Plug-in "org.xxx.client" was unable to instantiate class "org.xxx.client.views.CommandTreeView".
!STACK 0
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
...
----full stacktrace in attachment----
this error looks the same as when I run application from eclipse env. and don't include argument:
-Djava.security.policy=${workspace_loc}\xxxRCP\configuration\org.xxx.client\xxx.policy
which targets to
grant {
permission java.security.AllPermission;
};
I have such entry in both of my jnlp files
<security>
<all-permissions/>
</security>
All jars are signed.
javaws.policy on my computer looks like this:
// @(#)javaws.policy 1.7 00/09/18
grant codeBase "file:${jnlpx.home}/javaws.jar" {
permission java.security.AllPermission;
};
The mentioned .log file placed in osgi.instance.area (C:\tmp\xxxRCP\workspace\.metadata) contains:
!SESSION Fri Nov 17 10:11:15 CET 2006 ------------------------------------------
!ENTRY org.eclipse.core.launcher 4 0 2006-11-17 10:11:15.28
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.security.AccessControlException: access denied (java.lang.RuntimePermission shutdownHooks)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.Runtime.removeShutdownHook(Unknown Source)
at org.eclipse.core.launcher.Main.takeDownSplash(Main.java:1604)
at org.eclipse.core.launcher.Main$EndSplashHandler.run(Main.java:85)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain.java:59)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I tried to fix it by passing such argument in my main jnlp file:
<application-desc main-class="org.eclipse.core.launcher.WebStartMain">
<argument>-Djava.security.policy=c:/xxx/xxx.policy</argument>
</application-desc>
but it didn't work.
Any ideas or clues what I should focus on?
best regards
Dawid
|
|
|
Re: RCP JWS - java.security.AccessControlException: access denied .log read [message #458326 is a reply to message #458325] |
Fri, 17 November 2006 05:14   |
Eclipse User |
|
|
|
------=_Part_1741_16440933.1163758526269
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
attachment - stacktrace
------=_Part_1741_16440933.1163758526269
Content-Type: text/plain; name=security_st.txt; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=security_st.txt
Java Web Start 1.5.0_09
Using JRE version 1.5.0_09 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\kuk
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
0-5: set trace level to <n>
----------------------------------------------------
creating log-dir C:\Documents and Settings\kuk\Desktop\log
/log4j.xml
10:11:08,519 INFO [DesktopMain] xxxClient RCP startup...
10:11:08,529 DEBUG [xxxWorkbenchAdvisor] xxxWorkbenchAdvisor instaciated
10:11:09,440 DEBUG [xxxWorkbenchAdvisor] initalizing xxxWorkbenchAdvisor
10:11:09,450 DEBUG [xxxWorkbenchAdvisor] xxxWorkbenchAdvisor initalized.
10:11:09,460 DEBUG [xxxWorkbenchAdvisor] preStartup()
10:11:09,700 DEBUG [xxxWorkbenchAdvisor] preWindowOpen()
10:11:09,720 DEBUG [IconCache] IconCache initalized image-dir=C:\TRUCKLRPP\WORKSPACES\xxx\xxxRCP\img\
10:11:13,836 DEBUG [xxxWorkbenchAdvisor] fillActionBars()
10:11:13,846 DEBUG [xxxWorkbenchAdvisor] fillMenuBar()
10:11:13,846 DEBUG [xxxWorkbenchAdvisor] createFileMenu()
10:11:13,896 DEBUG [xxxWorkbenchAdvisor] createHelpMenu()
10:11:13,956 DEBUG [xxxWorkbenchAdvisor] fillCoolBar()
10:11:13,956 DEBUG [xxxWorkbenchAdvisor] createEditToolBar()
10:11:14,657 DEBUG [xxxPerspective] xxxPerspective initalized
10:11:14,768 DEBUG [CommandTreeView] intializing CommandTreeView
10:11:14,768 INFO [DesktopMain] xxxClient RCP startup...
10:11:14,768 DEBUG [Connection] opening CommandBrokerRemote-Connection...
10:11:14,768 INFO [Connection] rmiRegistryHost=rmi://localhost:1099/CommandBroker
An exception occurred while writing to the platform log:
java.security.AccessControlException: access denied (java.io.FilePermission C:\tmp\xxxRCP\workspace\.metadata\.log read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.length(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseLog.checkLogFileSize (EclipseLog.java:578)
at org.eclipse.core.runtime.adaptor.EclipseLog.log(EclipseLog.j ava:280)
at org.eclipse.core.internal.runtime.PlatformLogWriter.logging( PlatformLogWriter.java:36)
at org.eclipse.core.internal.runtime.RuntimeLog.log(RuntimeLog. java:68)
at org.eclipse.core.internal.runtime.InternalPlatform.log(Inter nalPlatform.java:825)
at org.eclipse.core.internal.runtime.Log.log(Log.java:56)
at org.eclipse.ui.internal.WorkbenchPlugin.log(WorkbenchPlugin. java:704)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:215)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:29 0)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:52 5)
at org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:13 11)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:601)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:532)
at org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:562)
at org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:815)
at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2436)
at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindo w.java:2616)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2597)
at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:658)
at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:795)
at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1437)
at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1388)
at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:190)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.xxx.client.DesktopMain.run(DesktopMain.java:122)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain .java:59)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.jav a:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Logging to the console instead.
!ENTRY org.eclipse.equinox.registry 4 1 2006-11-17 10:11:14.828
!MESSAGE Unable to create view ID org.xxx.client.views.commandTreeView: Plug-in "org.xxx.client" was unable to instantiate class "org.xxx.client.views.CommandTreeView".
!STACK 0
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket( Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket( Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at org.xxx.client.connection.Connection.<init>(Connection.java:45)
at org.xxx.client.DesktopMain.init(DesktopMain.java:69)
at org.xxx.client.views.CommandTreeView.<init>(CommandTreeView.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:157)
at org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:759)
at org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:242)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java:238)
at org.eclipse.ui.internal.registry.ViewDescriptor.createView(V iewDescriptor.java:69)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:292)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:29 0)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:52 5)
at org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:13 11)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:601)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:532)
at org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:562)
at org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:815)
at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2436)
at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindo w.java:2616)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2597)
at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:658)
at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:795)
at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1437)
at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1388)
at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:190)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.xxx.client.DesktopMain.run(DesktopMain.java:122)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain .java:59)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.jav a:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
------=_Part_1741_16440933.1163758526269--
|
|
|
|
|
Re: RCP JWS - java.security.AccessControlException: access denied .log read [message #458599 is a reply to message #458570] |
Wed, 22 November 2006 19:20   |
Eclipse User |
|
|
|
You can't set a SecurityManager in JWS. It will already have set its own one. If you have all-permissions, and all Jars are signed, then it should already have that permission. (There are bugs in the Sun database about claims that all permissions doesn't grant the rights for RMI, but they were closed as 'worksforme')
You need to sign all Jars in the distribution; the all-permissions only applies to those signed Jars. This will include the platform Jars that you're shipping. You'll need to make sure that every Jar in all your JNLPs are signed, and that the all-permissions exists in every JNLP file. It may be that you're signing your own Jars, but you're not signing some of the platform Jars; and as they're loading code from their own classloaders, it's possible that they're seen as unsigned/untrusted code.
Of course, you should also verify that your signature works and that Java trusts the certificate.
To see if it really is a permissions problem, you could try hacking your java.policy to grant rights for the RMI stuff and see if that fixes your problem; though of course, the correct problem would be to find out what's going on and why it can't be loaded.
You should be able to query the security manager programmatically (getSecurityManager()) and find out whether you have permissions e.g. to connect/resolve 127.0.0.1:1099. At least that would give you some kind of idea as to when you've got it fixed.
Alex.
|
|
|
|
Re: RCP JWS - java.security.AccessControlException: access denied .log read [message #458624 is a reply to message #458613] |
Thu, 23 November 2006 06:18  |
Eclipse User |
|
|
|
So, you've got Jars in Jars? They should be extrated to some temp location and then added in, but if they're not signed they'll probably fall outside of the security manager scope; and if it's these classes that are doing the comms (they probably are) then it could go wrong.
If you have client.jar signed, then put a class in client.jar that tries to connect to the RMI socket (new Socket("127.0.0.1","1099").openInputStream()) and see if it causes an exception. If that works (i.e. doesn't throw a SecurityException) then you probably have the client Jar signed, but not something else. Signing all Jars (whether nested or not) will of course rule out that possibility as well, so whichever one is easier :-)
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.30488 seconds