[
https://issues.apache.org/jira/browse/OPENJPA-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715294#action_12715294
]
Albert Lee commented on OPENJPA-5:
----------------------------------
With Java security enabled, the following exception occurred:
**Exception: Caught unexpected Exception during test execution.
org.apache.openjpa.persistence.PersistenceException:There were errors
initializing your configuration: java.lang.ExceptionInInitializerError
at
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:49)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at
org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:211)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:714)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at
org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:288)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1549)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:700)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:198)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:160)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:212)
at
com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:42)
at
com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:27)
at
suite.jpafvt.common.testvehicle.JPAFVTGenericBMTTestEJB.executeTestCase(JPAFVTGenericBMTTestEJB.java:85)
at
suite.r80.base.jpaspec.annoxml.ordercolumn.test.jee.ejb.EJSLocal0SLOrderColumnTestSLEJB_52ec6ee4.executeTestCase(EJSLocal0SLOrderColumnTestSLEJB_52ec6ee4.java)
at
suite.jpafvt.common.testvehicle.JPAFVTGenericEJBVehicleServlet.executeTestCase(JPAFVTGenericEJBVehicleServlet.java:58)
at
suite.jpafvt.common.testvehicle.AbstractJPATestServletVehicle.doPost(AbstractJPATestServletVehicle.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1530)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:829)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3742)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:929)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1580)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:177)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.security.AccessControlException: Access denied
(java.lang.RuntimePermission getClassLoader)
at
java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at
com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:211)
at java.lang.Thread.getContextClassLoader(Thread.java:456)
at serp.bytecode.Project.loadClass(Project.java:95)
at serp.bytecode.Project.loadClass(Project.java:67)
at
org.apache.openjpa.lib.util.ConcreteClassGenerator.makeConcrete(ConcreteClassGenerator.java:61)
at
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:46)
... 40 more
and
Caused by: java.security.AccessControlException: Access denied
(java.lang.RuntimePermission createClassLoader)
at
java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at
com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:211)
at
java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:594)
at java.lang.ClassLoader.(ClassLoader.java:143)
at serp.bytecode.BCClassLoader.(BCClassLoader.java:25)
at
org.apache.openjpa.lib.util.ConcreteClassGenerator.makeConcrete(ConcreteClassGenerator.java:54)
at
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:46)
... 40 more
Need DoPrivilege() around the "new BCClassLoader" and "project.loadClass()";
> OpenJPA doesn't compile with JDBC 4
> -----------------------------------
>
> Key: OPENJPA-5
> URL: https://issues.apache.org/jira/browse/OPENJPA-5
> Project: OpenJPA
> Issue Type: Improvement
> Components: build / infrastructure
> Affects Versions: 0.9.0, 0.9.6
> Reporter: Craig Russell
> Attachments: OPENJPA-5.patch, openjpa-5.patch.2.txt,
> openjpa-5.patch.3.txt
>
>
> Patrick opines:
> OpenJPA implements Statement, ResultSet, Connection, and maybe a
> couple other JDBC interfaces. See
> org.apache.openjpa.lib.jdbc.Delegating*. We do this for a number of
> reasons: to resolve database-specific bugs in a transparent fashion, to
> provide logging, to handle reference counting, etc.
> The pressing issue is that we must provide implementations of all of the
> methods in the various java.sql interfaces. The fact that we do not
> implement the new JDBC4 methods is why OpenJPA won't currently compile
> against JDK6. This is pretty easy to fix; take a look at
> org.apache.openjpa.lib.jdbc.DelegatingStatement to see how we handled
> this for JDBC3. Since we know that we never invoke the new methods, we
> can happily throw unsupported operation exceptions for the new methods.
> However, these unsupported methods do provide a challenge. While Kodo
> doesn't use any of these methods, our mechanism for implementing them is
> limiting, in that users who obtain Connections from Kodo will not be
> able to use the new JDBC3/JDBC4 methods in their own code. Ideally, we
> should provide some means for people to designate to OpenJPA that it
> should use a dynamic proxy to implement the unimplemented methods. This
> shouldn't be the default behavior, as the dynamic proxy will add
> overhead, but certainly could be desirable for some. I'll file an issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.