users@glassfish.java.net

Re: AppClient/JWS/Derby/Security problems

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Wed, 13 Sep 2006 15:19:10 -0500

Hi, again, Ray.

In the stack trace related to the permission problem launching via Java
Web Start (in Thread-25 as excerpted below) I suspect the error occurs
because, although the TopLink code itself has been granted elevated
permissions and would be allowed to read the property, the
SecurityManager will not permit it to do so unless all intervening
methods in the call stack also have that permission. I suspect that the
kart... classes are not being granted permissions (bolded in the stack
trace).


With that in mind - and if you have already described this earlier in
the mail thread I apologize for asking again - can I ask how,
physically, are the kart.* classes made available to the client? Are
they packaged in the app client itself, or in a JAR within the
containing EAR? The Java Web Start-aware app client container (ACC)
should be making sure, within the Java Web Start security model, that
adequate permissions are granted to the code downloaded in the app
client JAR. If this is not happening then we need to find out why.

- Tim


Exception in thread "Thread-25" java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
* at kart.Model.setDataAccessLayer(Model.java:326)
    at
kart.addon.loader.AddonClassLoader.loadAddon(AddonClassLoader.java:223)
    at
kart.addon.loader.AddonClassLoader.beginLoad(AddonClassLoader.java:264)
    at kart.addon.loader.AddonClassLoader.start(AddonClassLoader.java:256)
    at kart.Model.execAddon(Model.java:230)
    at kart.KARTgui$11$1.run(KARTgui.java:592)*
    at java.lang.Thread.run(Thread.java:595)
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission toplink.validation-only read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at
java.security.AccessController.checkPermission(AccessController.java:427)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at
java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
    at java.lang.System.getProperty(System.java:627)
    at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(EntityManagerFactoryProvider.java:295)
    at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.isValidationOnly(EntityManagerSetupImpl.java:567)
    at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.shouldGetSessionOnCreateFactory(EntityManagerSetupImpl.java:577)
    at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:130)
    at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
    at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
    at draw.resources.dal.DataAccessImpl.<clinit>(DataAccessImpl.java:62)
    ... 13 more