Paul - I don't fully understand whats going on, but I found what is causing the problems. When you launch your java application, you don't fork the JVM. Adding fork="yes" to <java classname="com.s... > made the problems go away.
If you google around, you'll find other people having this very problem. -Rick Hi Rick - What I think is happening is that most containers have the JAXP jar files, but if you run it standalone from the console this issue shows up. There was an evolution from java 1.4 to 1.5 that changed how this works. There are a lot of posts if you google it, but I'm no clear on the what the configuration trick is so you don't have to have xercesIml.jar. Attached is is a bare bones zip file. Directions - - Add the jars from OpenJPA 1.2.1 to the lib directory and your JDBC driver - Create a database with the test_person table for class com.steelhead.lg.test.Person - Edit src/java/META-INF/persistence.xml with your connection properties - type "ant TestJPA" This should work. If you remove the two sysproperty elements from the ant build.xml then it fails with javax.xml.parsers.FactoryConfigurationError unless you add xercesImpl.jar to the lib directory. I'm using Java SE 1.6.0_12. I had the same problem with Java 1.5.0_05. Also had the same issue with OpenJPA 1.2.0. I'm using Postgres 8.2.13 but I had the same problem with MySql 1.31 so probably the database does not matter. As I said, the OpenJPA hellojpa example works for me without xercesImpl.jar so that adds to the mystery. - Paul On 3/23/2009 11:42 AM, Rick Curtis wrote: > Paul- > <br>If you still are unable to figure out what's going on, feel free to zip > up your simple test app and I'll take a look at it. > <br><br>-Rick > <br><blockquote class="quote light-black dark-border-color"><div class="quote > light-border-color"> > <div class="quote-author" style="font-weight: bold;">Paul Copeland > wrote:</div> > <div class="quote-message shrinkable-quote">Hi Rick - > <br><br>Thanks. As I mentioned the openjpa example hellojpa also works for me > <br>WITHOUT the xerces jar. But my very simple test app does not work > with > <br>xerces. However, I found out that if I add these two properties to > my > <br>runtime ant task then I do NOT need the xerces jar. > <br><br> <sysproperty > key="javax.xml.parsers.SAXParserFactory" > <br>value="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/> > <br> <sysproperty > key="javax.xml.parsers.DocumentBuilderFactory" > <br>value="com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/> > <br><br>There is some classloader subtlety that I don't fully understand here. > <br><br>- Paul > <br><br>On 3/23/2009 8:17 AM, Rick Curtis wrote: > <br>> Paul - > <br>> I quickly looked through the javadoc for the > <br>> > http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance( > ) > <br>> SAXParserFactory and I'm thinking that your problem is > something specific > <br>> to your environment.? I was able to run the examples on my box > without > <br>> adding xercesImpl.jar to my classpath. With my JSE1.6 install, > <br>> SAXParserFactoryImpl is found in the [java_home]\lib\rt.jar. > <br>> > <br>> -Rick > <br>> > <br>> Paul Copeland wrote: > <br>> > <br>>> More info on this. I upgraded to Java SE 1.6.0_12 and I > still need the > <br>>> same jars (including xerces). > <br>>> > <br>>> Using OpenJPA 1.2 - > <br>>> > <br>>> 1) Only two jars are needed to compile my (very simple) test > application - > <br>>> > <br>>> - openjpa-1.2.0.jar > <br>>> - geronimo-jta_1.1_spec-1.1.jar > <br>>> > <br>>> 2) At runtime (standalone, not in a container) I also need these > jars > <br>>> (plus JDBC driver of course) - > <br>>> > <br>>> - serp-1.13.1.jar > <br>>> - geronimo-jta_1.1_spec-1.1.jar > <br>>> - commons-collections-3.2.jar > <br>>> - commons-lang-2.1.jar > <br>>> - xercesImpl.jar > <br>>> > <br>>> 3) When I build and run the > apache-openjpa-1.2.0/examples/hellojpa > <br>>> (Derby example) I do NOT need xerces. > <br>>> .... > <br>>> > <br>>> > <br>> > <br>> > <br></div> > </div></blockquote> > > -- View this message in context: http://n2.nabble.com/Questions-about--classpath-for-OpenJPA-tp2504942p2539314.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
