db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-555) All calls to Class.getMethod and Method.invoke (among others) need to be invoked inside a doPrivileged block.
Date Tue, 15 Jul 2008 05:31:32 GMT

    [ https://issues.apache.org/jira/browse/JDO-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613531#action_12613531
] 

Craig Russell commented on JDO-555:
-----------------------------------

Andy,

Yes, initialise() is the culprit I see.

Without the patch to MetaDataManager, running gives
 [java] RUN GetPMFByFile.testValidGetPMF	   ERROR

The doPrivileged can go in any of several places in the stack (between org.apache.jdo.tck.api.persistencemanagerfactory.AbstractGetPMF.makePersistent(AbstractGetPMF.java:102)
and
java.lang.Class.getDeclaredFields(Class.java:1714)

I picked getMetaDataForClass because it seems to encompass a lot of reflection code.

    [java] 1) testValidGetPMF(org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFile)java.security.AccessControlException:
access denied (java.lang.RuntimePermission accessDeclaredMembers)
    [java] 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    [java] 	at java.security.AccessController.checkPermission(AccessController.java:427)
    [java] 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    [java] 	at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
    [java] 	at java.lang.Class.checkMemberAccess(Class.java:2125)
    [java] 	at java.lang.Class.getDeclaredFields(Class.java:1714)
    [java] 	at org.datanucleus.jdo.JDOAdapter.processPrimaryKeyClass(JDOAdapter.java:406)
    [java] 	at org.datanucleus.jdo.JDOAdapter.isValidPrimaryKeyClass(JDOAdapter.java:377)
    [java] 	at org.datanucleus.metadata.AbstractClassMetaData.validateObjectIdClass(AbstractClassMetaData.java:1147)
    [java] 	at org.datanucleus.metadata.ClassMetaData.initialise(ClassMetaData.java:654)
    [java] 	at org.datanucleus.metadata.MetaDataManager.initialiseAbstractClassMetaData(MetaDataManager.java:1974)
    [java] 	at org.datanucleus.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:862)
    [java] 	at org.datanucleus.ObjectManagerImpl.hasPersistenceInformationForClass(ObjectManagerImpl.java:3749)
    [java] 	at org.datanucleus.ObjectManagerImpl.assertClassPersistable(ObjectManagerImpl.java:3667)
    [java] 	at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1150)
    [java] 	at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1091)
    [java] 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:666)
    [java] 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:691)
    [java] 	at org.apache.jdo.tck.api.persistencemanagerfactory.AbstractGetPMF.makePersistent(AbstractGetPMF.java:102)
    [java] 	at org.apache.jdo.tck.api.persistencemanagerfactory.AbstractGetPMF.checkGetPMFWithValidProperties(AbstractGetPMF.java:142)
    [java] 	at org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFile.testValidGetPMF(GetPMFByFile.java:72)
    [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] 	at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:259)
    [java] 	at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
    [java] 	at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
    [java] 	at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)



> All calls to Class.getMethod and Method.invoke (among others) need to be invoked inside
a doPrivileged block.
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: JDO-555
>                 URL: https://issues.apache.org/jira/browse/JDO-555
>             Project: JDO
>          Issue Type: Bug
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Matthew T. Adams
>            Assignee: Andy Jefferson
>             Fix For: JDO 2 maintenance release 2
>
>         Attachments: datanucleus.patch, datanucleus.patch, jdo-555.patch, jdo-555.patch,
jdo-555.patch, xmlbean.patch
>
>
> Discovered in review of patch to JDO-545.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message