|
#1
|
|||
|
|||
|
I'm trying to add integration tests to my Maven build. I'm using Maven, Spring 2.0. (I just tried moving to 2.0.2, but got an XML parse error from my applicationContext.xml file.), and Hibernate as a JPA provider.
I have tied tests to the integration-test life cycle in Maven. I have a test that attempts to instantiate an ApplicationContext, but it fails when attempting to start my entityManager with a StackOverflowException: Code:
Error creating bean with name 'entityManagerFactory' defined in URL [file:/Users/mark/projects/quadran/target/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.StackOverflowError
Caused by: java.lang.StackOverflowError
at java.lang.String.toLowerCase(String.java:2213)
at java.lang.String.toLowerCase(String.java:2277)
at org.apache.xerces.util.URI.setScheme(URI.java:908)
at org.apache.xerces.util.URI.initializeScheme(URI.java:576)
at org.apache.xerces.util.URI.initialize(URI.java:400)
at org.apache.xerces.util.URI.<init>(URI.java:211)
at org.apache.xerces.util.URI.<init>(URI.java:195)
at org.apache.xerces.impl.XMLEntityManager.expandSystemId(XMLEntityManager.java:1140)
at org.apache.xerces.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:581)
at org.apache.xerces.impl.xs.XMLSchemaLoader.xsdToXMLInputSource(XMLSchemaLoader.java:625)
at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:580)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
these last two lines repeat for a long time.
Any ideas you might have would be appreciated. Mark |
|
#2
|
|||
|
|||
|
This is a known bug in Xerces 2.0.2, which Maven2 includes automatically via some transitive dependency that I didn't track down. You can work around it by explicitly requiring a newer version, e.g.:
Code:
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.8.1</version> </dependency> |
|
#3
|
|||
|
|||
|
Thank you. Thank you. Thank you.
You dug a ways back to find this post. You're advice worked and now my context starts, initializes and loads my JPA persistence context and I can run my integration tests. Mark |
|
#4
|
|||
|
|||
|
Hi guys,
I was very happy to find this post. The manifestation matches my problem exactly. StackOverflow with jpa while trying to read persistence.xml. Only trouble is, I'm not using Spring so I don't know how to fix it. I'm trying my first gwt application using jpa on the server. Compiling with my own ant script via Netbeans5.5 and then running with java1.6, source level 1.5, using toplink essentials for persistence provider. Netbeans seems to have xerces2.8 in ide7/modules directory. Netbeans will run other projects using its own ant script (with the same persistence.xml). Yet I still get the StackOverflowError while trying to create an EntityManagerFactory. Anyone any idea where I should look for a bad xerces?? regards Dukha |
|
#5
|
|||
|
|||
|
Hi guys,
I was very happy to find this post. The manifestation matches my problem exactly. StackOverflow with jpa while trying to read persistence.xml. Only trouble is, I'm not using Spring so I don't know how to fix it. I'm trying my first gwt application using jpa on the server. Compiling with my own ant script via Netbeans5.5 and then running with java1.6, source level 1.5, using toplink essentials for persistence provider. Netbeans seems to have xerces2.8 in ide7/modules directory. Netbeans will run other projects using its own ant script (with the same persistence.xml). Yet I still get the StackOverflowError while trying to create an EntityManagerFactory. Anyone any idea where I should look for a bad xerces?? regards Dukha |
|
#6
|
|||
|
|||
|
This problem specifically talked about Maven, if you are using it then I would guess the exist answer should tell you. If not then just check the classpath of the application. The lib directory is usually a good starting point.
Last edited by karldmoore; Aug 29th, 2007 at 11:15 AM. |
|
#7
|
|||
|
|||
|
Thanks for the help, Karl.
I'm looking at the same Stackoverflow as wtih Maven but the source is probably different. It looks as if Google are using the same old Xerces version packaged in gwt 1.3 (the latest!). I'm going further with a work around using Code:
-Djava.endorsed.dirs Code:
-javaagent: I'll post again if it works. dukha |
|
#8
|
|||
|
|||
|
The problem appears to be solved but not as I proposed above.
Indeed it is so that gwt 1.3.3 (released Feb07) uses a version of Xerces from 2002. I. expanded gwt-dev-linux.jar to a directory, expanded xerces 2.9 to a dir and hand copied from xerces to gwt. Thanks Google! I hope I don't find out the reason for such weirdness further down the track. regards dukha |
|
#9
|
|||
|
|||
|
I had a similar problem with Castor 1.1.1 which has a dependency on xerces 1.4.0, which, by the way, is incompatible with xsd schemas !
In that case, specifying explicitely a newer version of xerces won't work because xerces has been relocated to xercesimpl. The lightest solution I found was to edit the castor pom in my local repository and make it dependant upon xercesimpl 2.8.1 instead of xerces 1.4.0. The main problem is that the project is no more portable. Can anyone think about a portable solution to this problem ? |
|
#10
|
|||
|
|||
|
Hi volga,
I've given up for now and wait until GWT supports Java 1.5 dukha |
![]() |
| Thread Tools | |
| Display Modes | |
|
|