openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ssso <simo...@yahoo.com>
Subject OpenJPA 1.2.2 slice + Oracle 10 EntityManagerFactory problem
Date Tue, 23 Feb 2010 02:32:51 GMT

Hi,

Does anyone have any success in configuring Oracle 10 with openjpa slices?

Looks like while I can run this query on my IDE, the execution here returns
empty result set.

SELECT SEQUENCE_OWNER AS SEQUENCE_SCHEMA, SEQUENCE_NAME FROM ALL_SEQUENCES


I got the following exception:

8  commerce-persistence-unit  INFO   [main] openjpa.Runtime - Detected
slices "[One]" in configuration.
92  commerce-persistence-unit  INFO   [main] openjpa.Runtime - Starting
OpenJPA Slice 1.2.2
186  commerce-persistence-unit  INFO   [main] openjpa.jdbc.JDBC - Using
dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary".
0  commerce-persistence-unit.One  INFO   [main] openjpa.Runtime - Connecting
to slice "One" at URL
"jdbc:oracle:thin:miscflydev/miscfly1@userdevdb.internal.shutterfly.com:3104:USERDEV"
145  commerce-persistence-unit.One  INFO   [main] openjpa.jdbc.JDBC - Using
dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary".

<openjpa-1.2.2-r422266:898935 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: Index: 0, Size: 0
	at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
	at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
	at com.shutterfly.ep.TestOpenJPA.testOrder(TestOpenJPA.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:94)
	at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:165)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.LinkedList.entry(LinkedList.java:365)
	at java.util.LinkedList.get(LinkedList.java:315)
	at
org.apache.openjpa.slice.jdbc.DistributedResultSet.next(DistributedResultSet.java:463)
	at
org.apache.openjpa.jdbc.sql.DBDictionary.getSequence(DBDictionary.java:4498)
	at
org.apache.openjpa.jdbc.sql.DBDictionary.getSequences(DBDictionary.java:3629)
	at
org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSequences(SchemaGenerator.java:827)
	at
org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchema(SchemaGenerator.java:338)
	at
org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:284)
	at
org.apache.openjpa.jdbc.schema.SchemaTool.getDBSchemaGroup(SchemaTool.java:1133)
	at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:344)
	at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:321)
	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:501)
	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453)
	at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
	at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119)
	at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:189)
	... 30 more


Process finished with exit code 255



My persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="1.0">

    <persistence-unit name="commerce-persistence-unit">
        
        <mapping-file>META-INF/customer-orm.xml</mapping-file>
        <mapping-file>META-INF/order-orm.xml</mapping-file>
        <class>com.shutterfly.domain.customer.impl.CustomerImpl</class>
        <class>com.shutterfly.domain.order.impl.OrderImpl</class>

        <properties>

            <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema"/>
            <property name="openjpa.Log" value="SQL=TRACE"/>

            <property name="openjpa.BrokerFactory" value="slice"/>
            <property name="openjpa.slice.Names" value="One"/>
            <property name="openjpa.slice.Master" value="One"/>
            <property name="openjpa.slice.Lenient" value="true"/>
            <property name="openjpa.slice.DistributionPolicy"
value="com.shutterfly.ep.db.OrderDistributionPolicy"/>

            <property name="openjpa.ConnectionDriverName"
value="oracle.jdbc.OracleDriver"/>

            <property name="openjpa.slice.One.ConnectionURL"
                
value="jdbc:oracle:thin:miscflydev/miscfly1@userdevdb.internal.shutterfly.com:3104:USERDEV"/>

        </properties>

    </persistence-unit>

</persistence>


* Note: without slices, my openjpa connectivity, query, etc all work.

-- 
View this message in context: http://n2.nabble.com/OpenJPA-1-2-2-slice-Oracle-10-EntityManagerFactory-problem-tp4616451p4616451.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message