Hi, we use Apache Maven 2.04 http://maven.apache.org for our java build environment. Maven handles dependency management by downloading jar's your project needs and storing them in a local directory that is added to your classpath. By default, on Windows, this is C:\Documents and Settings\(username)\.m2\repository
One of the jar's we develop has a META-INF\persistence.xml -- when we try to execute some code to instantiate a new Entity Manager, it has a problem with whitespace in the local file URL (see stacktrace below).
This seems to be a problem with the classloader. In Eclipse, this problem does not occur (even though in Eclipse the path still points to the same jar). Executing from the cmd line (e.g. running mvn test) generates this exception.
There are quick / hack workarounds -- like moving our local maven repo to not have whitespace, but I'm curious if there is any other solution to this issue?
Thx in advance,
Davis
Hibernate version:
Hibernate Core 3.2.2 ga
Hibernate Annotations 3.2.1 ga
Hibernate Entity Manager 3.2.1 ga
Full stack trace of any exception that occurs:
javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Documents and Settings/ianbro/.m2/repository/com/teleatlas/global/orm-tracer/orm-tracer/1.0-SNAPSHOT/orm-tracer-1.0-SNAPSHOT.jar. Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/ianbro/.m2/repository/com/teleatlas/global/orm-tracer/orm-tracer/1.0-SNAPSHOT/orm-tracer-1.0-SNAPSHOT.jar
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:252)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at com.teleatlas.global.orm.util.HibernateUtil.getEntityManager(HibernateUtil.java:89)
at com.teleatlas.global.orm.query.impl.DataProviderImpl.<init>(DataProviderImpl.java:71)
at com.teleatlas.global.orm.query.DataProviderFactory.getDataProvider(DataProviderFactory.java:41)
at com.teleatlas.global.edit.viewereditor.mapcomponents.orm.OrmRoadElementMapFeatureDataIntegration.loadRealFeatures(OrmRoadElementMapFeatureDataIntegration.java:97)
at com.teleatlas.global.edit.viewereditor.mapcomponents.orm.OrmRoadElementMapFeatureDataIntegration.testFetchFunctionalRoadClass(OrmRoadElementMapFeatureDataIntegration.java:129)
Name and version of the database you are using:
Oracle 10.2 g
|