openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Standalone Example
Date Fri, 07 Nov 2014 14:24:06 GMT
Try to change the dependencies back to the original order and then run mvn
install prior to running test.

Thanks,
Rick

On Thu, Nov 6, 2014 at 9:22 PM, Trenton D. Adams <trent@trentonadams.ca>
wrote:

> The reason the dep doesn't exist is that the modules are in the wrong
> order in the main pom.  I moved the openjpa-examples module to the bottom
> of the list, and it builds fine now.
>
> I'm now getting a unit test failure.
>
> Running org.apache.openjpa.xmlstore.simple.TestPersistence
> 50  xmlstore-simple  INFO   [main] openjpa.Runtime - Starting OpenJPA
> 2.4.0-SNAPSHOT
> 1  xmlstore-simple  INFO   [main] openjpa.Runtime - Starting OpenJPA
> 2.4.0-SNAPSHOT
> 1  xmlstore-simple  INFO   [main] openjpa.Runtime - Starting OpenJPA
> 2.4.0-SNAPSHOT
> Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.74 sec
> <<< FAILURE!
> testQuery(org.apache.openjpa.xmlstore.simple.TestPersistence) Time
> elapsed: 0.162 sec  <<< ERROR!
> <openjpa-2.4.0-SNAPSHOT-r422266:1636474M fatal store error>
> org.apache.openjpa.persistence.RollbackException: null
>     at org.apache.openjpa.persistence.EntityManagerImpl.
> commit(EntityManagerImpl.java:594)
>     at org.apache.openjpa.xmlstore.simple.TestPersistence.
> testQuery(TestPersistence.java:65)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runTest(AbstractPersistenceTestCase.java:579)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runBare(AbstractPersistenceTestCase.java:566)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runBare(AbstractPersistenceTestCase.java:542)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> run(AbstractPersistenceTestCase.java:206)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.maven.surefire.junit.JUnitTestSet.execute(
> JUnitTestSet.java:213)
>     at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.
> executeTestSet(AbstractDirectoryTestSuite.java:115)
>     at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
> AbstractDirectoryTestSuite.java:102)
>     at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
> SurefireBooter.java:350)
>     at org.apache.maven.surefire.booter.SurefireBooter.main(
> SurefireBooter.java:1021)
> Caused by: <openjpa-2.4.0-SNAPSHOT-r422266:1636474M nonfatal general
> error> org.apache.openjpa.persistence.PersistenceException: null
>     at org.apache.openjpa.xmlstore.XMLFileHandler.load(
> XMLFileHandler.java:93)
>     at org.apache.openjpa.xmlstore.XMLStore.getMap(XMLStore.java:80)
>     at org.apache.openjpa.xmlstore.XMLStore.getData(XMLStore.java:59)
>     at org.apache.openjpa.xmlstore.XMLStoreManager.flush(
> XMLStoreManager.java:210)
>     at org.apache.openjpa.abstractstore.AbstractStoreManager.flush(
> AbstractStoreManager.java:274)
>     at org.apache.openjpa.kernel.DelegatingStoreManager.flush(
> DelegatingStoreManager.java:131)
>     at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2207)
>     at org.apache.openjpa.kernel.BrokerImpl.flushSafe(
> BrokerImpl.java:2105)
>     at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(
> BrokerImpl.java:2023)
>     at org.apache.openjpa.kernel.LocalManagedRuntime.commit(
> LocalManagedRuntime.java:81)
>     at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1528)
>     at org.apache.openjpa.kernel.DelegatingBroker.commit(
> DelegatingBroker.java:933)
>     at org.apache.openjpa.persistence.EntityManagerImpl.
> commit(EntityManagerImpl.java:570)
>     ... 31 more
> Caused by: java.lang.NullPointerException
>     at org.apache.openjpa.xmlstore.XMLFileHandler$
> ObjectDataHandler.endElement(XMLFileHandler.java:438)
>     at org.apache.openjpa.xmlstore.XMLFileHandler$
> ObjectDataHandler.endElement(XMLFileHandler.java:410)
>     at com.sun.org.apache.xerces.internal.parsers.
> AbstractSAXParser.endElement(AbstractSAXParser.java:601)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl.scanEndElement(
> XMLDocumentFragmentScannerImpl.java:1782)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(
> XMLDocumentFragmentScannerImpl.java:2939)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl
> .java:511)
>     at com.sun.org.apache.xerces.internal.parsers.
> XML11Configuration.parse(XML11Configuration.java:808)
>     at com.sun.org.apache.xerces.internal.parsers.
> XML11Configuration.parse(XML11Configuration.java:737)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.
> parse(XMLParser.java:119)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(
> AbstractSAXParser.java:1205)
>     at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$
> JAXPSAXParser.parse(SAXParserImpl.java:522)
>     at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>     at javax.xml.parsers.SAXParser.parse(SAXParser.java:331)
>     at org.apache.openjpa.xmlstore.XMLFileHandler.read(
> XMLFileHandler.java:106)
>     at org.apache.openjpa.xmlstore.XMLFileHandler.load(
> XMLFileHandler.java:89)
>     ... 43 more
>
> testNewDeleteNew(org.apache.openjpa.xmlstore.simple.TestPersistence) Time
> elapsed: 0.053 sec  <<< ERROR!
> <openjpa-2.4.0-SNAPSHOT-r422266:1636474M fatal store error>
> org.apache.openjpa.persistence.RollbackException: null
>     at org.apache.openjpa.persistence.EntityManagerImpl.
> commit(EntityManagerImpl.java:594)
>     at org.apache.openjpa.xmlstore.simple.TestPersistence.
> testNewDeleteNew(TestPersistence.java:98)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runTest(AbstractPersistenceTestCase.java:579)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runBare(AbstractPersistenceTestCase.java:566)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> runBare(AbstractPersistenceTestCase.java:542)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.
> run(AbstractPersistenceTestCase.java:206)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.maven.surefire.junit.JUnitTestSet.execute(
> JUnitTestSet.java:213)
>     at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.
> executeTestSet(AbstractDirectoryTestSuite.java:115)
>     at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
> AbstractDirectoryTestSuite.java:102)
>     at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
> SurefireBooter.java:350)
>     at org.apache.maven.surefire.booter.SurefireBooter.main(
> SurefireBooter.java:1021)
> Caused by: <openjpa-2.4.0-SNAPSHOT-r422266:1636474M nonfatal general
> error> org.apache.openjpa.persistence.PersistenceException: null
>     at org.apache.openjpa.xmlstore.XMLFileHandler.load(
> XMLFileHandler.java:93)
>     at org.apache.openjpa.xmlstore.XMLStore.getMap(XMLStore.java:80)
>     at org.apache.openjpa.xmlstore.XMLStore.getData(XMLStore.java:59)
>     at org.apache.openjpa.xmlstore.XMLStoreManager.flush(
> XMLStoreManager.java:210)
>     at org.apache.openjpa.abstractstore.AbstractStoreManager.flush(
> AbstractStoreManager.java:274)
>     at org.apache.openjpa.kernel.DelegatingStoreManager.flush(
> DelegatingStoreManager.java:131)
>     at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2207)
>     at org.apache.openjpa.kernel.BrokerImpl.flushSafe(
> BrokerImpl.java:2105)
>     at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(
> BrokerImpl.java:2023)
>     at org.apache.openjpa.kernel.LocalManagedRuntime.commit(
> LocalManagedRuntime.java:81)
>     at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1528)
>     at org.apache.openjpa.kernel.DelegatingBroker.commit(
> DelegatingBroker.java:933)
>     at org.apache.openjpa.persistence.EntityManagerImpl.
> commit(EntityManagerImpl.java:570)
>     ... 31 more
> Caused by: java.lang.NullPointerException
>     at org.apache.openjpa.xmlstore.XMLFileHandler$
> ObjectDataHandler.endElement(XMLFileHandler.java:438)
>     at org.apache.openjpa.xmlstore.XMLFileHandler$
> ObjectDataHandler.endElement(XMLFileHandler.java:410)
>     at com.sun.org.apache.xerces.internal.parsers.
> AbstractSAXParser.endElement(AbstractSAXParser.java:601)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl.scanEndElement(
> XMLDocumentFragmentScannerImpl.java:1782)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(
> XMLDocumentFragmentScannerImpl.java:2939)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
>     at com.sun.org.apache.xerces.internal.impl.
> XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl
> .java:511)
>     at com.sun.org.apache.xerces.internal.parsers.
> XML11Configuration.parse(XML11Configuration.java:808)
>     at com.sun.org.apache.xerces.internal.parsers.
> XML11Configuration.parse(XML11Configuration.java:737)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.
> parse(XMLParser.java:119)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(
> AbstractSAXParser.java:1205)
>     at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$
> JAXPSAXParser.parse(SAXParserImpl.java:522)
>     at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>     at javax.xml.parsers.SAXParser.parse(SAXParser.java:331)
>     at org.apache.openjpa.xmlstore.XMLFileHandler.read(
> XMLFileHandler.java:106)
>     at org.apache.openjpa.xmlstore.XMLFileHandler.load(
> XMLFileHandler.java:89)
>     ... 43 more
>
>
> Results :
>
> Tests in error:
>   testQuery(org.apache.openjpa.xmlstore.simple.TestPersistence)
> testNewDeleteNew(org.apache.openjpa.xmlstore.simple.TestPersistence)
>
> Tests run: 3, Failures: 0, Errors: 2, Skipped: 0
>
>
> On 2014-11-06 6:54 PM, Trenton D. Adams wrote:
>
>> That made no difference, the 2.3.0 tag does not build either.
>>
>> On 2014-11-06 6:47 PM, Trenton D. Adams wrote:
>>
>>> FYI, the trunk does not build out of the box, I'm going to try the
>>> latest tag.
>>>
>>> mvn test -DfailIfNoTests=false -Dtest=TestPersistence
>>>
>>>
>>> [INFO] Executing tasks
>>>      [echo] Running OpenBooks genmodel
>>>
>>> info:
>>>      [echo]
>>>      [echo]             Builds OpenBooks demo application.
>>>      [echo]             OpenJPA Library: /home/trenta/.m2/repository/
>>> org/apache/openjpa/openjpa-all/2.4.0-SNAPSHOT
>>>      [echo]             Build mode     : jse
>>>      [echo]             Deploy Location: /home/trenta/LocalDocuments/
>>> development/java/openjpa/openjpa-examples/openbooks/target/openbooks
>>>      [echo]
>>>
>>> check-env:
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [ERROR] BUILD ERROR
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] An Ant BuildException has occured: The following error occurred
>>> while executing this line:
>>> /home/trenta/LocalDocuments/development/java/openjpa/
>>> openjpa-examples/openbooks/build.xml:117: *** Error:
>>>            The directory for OpenJPA libraries can not be located at
>>> /home/trenta/.m2/repository/org/apache/openjpa/openjpa-
>>> all/2.4.0-SNAPSHOT.
>>>            Make sure openjpa.lib property value is correct in
>>> build.properties file.
>>>
>>>
>>>
>>> On 2014-11-06 6:35 PM, Trenton D. Adams wrote:
>>>
>>>> Yeah, I used OpenJPA quite awhile back, but I did so within a
>>>> container.  And it's been quite awhile, so I have no idea what I'm doing.
>>>> Most of the ones on the samples page make my eyes glaze over, lol.  I'm a
>>>> developer, the kind of docs I love, are those that have...
>>>>
>>>> 1. raw source code and configs
>>>> 2. build files
>>>>
>>>> In other words, a good sample should "just work".  So a tar.gz with a
>>>> fully working maven built app with unit tests would be the ultimate.  I
>>>> will endeavour to create one, and contribute it back.
>>>>
>>>> I think the unit tests are probably the best place for me to look.
>>>>
>>>> Thanks for the info
>>>>
>>>> On 2014-11-06 9:00 AM, Kevin Sutter wrote:
>>>>
>>>>> Have you checked these out?
>>>>> http://openjpa.apache.org/samples.html
>>>>>
>>>>> Also, all of the junit tests could be used as samples, depending on the
>>>>> specific function you are looking for.
>>>>> http://openjpa.apache.org/source-code.html
>>>>> http://openjpa.apache.org/testing.html
>>>>>
>>>>> Also, JPA is a widely accepted and widely documented programming model.
>>>>> So, any "standard" JPA application should work just fine with OpenJPA.
>>>>>
>>>>> Hope this helps,
>>>>> Kevin
>>>>>
>>>>> On Thu, Nov 6, 2014 at 1:25 AM, Trenton D. Adams <
>>>>> trent@trentonadams.ca>
>>>>> wrote:
>>>>>
>>>>>  Hi Guys,
>>>>>>
>>>>>> Where can I find the best openjpa standalone example? Preferably
with
>>>>>> a
>>>>>> maven build.  I have checked the site, and googled, and nothing decent
>>>>>> seems to come up.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>
>>>
>>
>


-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message