openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Prud'hommeaux (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-42) Simple orm.xml file causes exception (NPE)
Date Tue, 12 Sep 2006 02:50:22 GMT
    [ http://issues.apache.org/jira/browse/OPENJPA-42?page=comments#action_12434042 ] 
            
Marc Prud'hommeaux commented on OPENJPA-42:
-------------------------------------------

I'm surprised by the build error ... I haven't seen it before. However, I agree that it sounds
like the jars are being built OK.

As for the "Could not locate metadata for the class.." error, that means that OpenJPA didn't
load the class for some reason. If you change your query to query the full class name (e.g.,
change "select x from Manager x" to "select x from org.mypackage.Manager x"), do you get the
same error? A better error message might result.

Also, if you want to attach the new test case, I can take a look.

> Simple orm.xml file causes exception (NPE)
> ------------------------------------------
>
>                 Key: OPENJPA-42
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-42
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: Mac OS X
> Java 5 SE
> Resource Local
> OpenJPA build from SVN  rev. 441247
>            Reporter: Thomas Risberg
>         Attachments: OPENJPA-42.zip, plainJpa.zip
>
>
> This simple orm.xml file causes a NPE - 
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
>     version="1.0">
>   <package>springdeveloper.domain</package>
>   <entity class="Client" metadata-complete="false" access="FIELD"></entity>
>   <entity class="Manager" metadata-complete="false" access="FIELD">
>     <attribute-override name="description">
>       <column name="DESCR" length="2000"/>
>     </attribute-override>
>   </entity>
> </entity-mappings>
> I have attached a test case - plainJpa.zip
> Same code runs fine with the RI.
> This is the output from my run:
> /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java -Dfile.encoding=MacRoman
-classpath /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar:/Users/trisberg/Projects/plainJpa/classes:/Users/trisberg/Projects/plainJpa/lib/openjpa-jdbc-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-persistence-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-lib-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-kernel-5-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/commons-collections-3.2.jar:/Users/trisberg/Projects/plainJpa/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar:/Users/trisberg/Projects/plainJpa/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar:/Users/trisberg/Projects/plainJpa/lib/commons-pool-1.3.jar:/Users/trisberg/Projects/plainJpa/lib/serp-1.11.0.jar:/Users/trisberg/Projects/plainJpa/lib/hsqldb.jar:/Users/trisberg/Projects/plainJpa/lib/persistence-api-1.0.jar:/Users/trisberg/Projects/plainJpa/lib/commons-logging-1.0.4.jar:/Users/trisberg/Projects/plainJpa/lib/commons-dbcp-1.2.1.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-persistence-jdbc-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/commons-lang-2.1.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-kernel-0.9.0-incubating-SNAPSHOT.jar:/Users/trisberg/Projects/plainJpa/lib/openjpa-jdbc-5-0.9.0-incubating-SNAPSHOT.jar
springdeveloper.TestApp
> OPenJPAVersion:
> OpenJPA 0.9.0-incubating-SNAPSHOT
> version id: 0.9.0-incubating-SNAPSHOT-r0
> revision: 0
> os.name: Mac OS X
> os.version: 10.4.7
> os.arch: ppc
> java.version: 1.5.0_06
> java.vendor: Apple Computer, Inc.
> java.class.path:
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/dt.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/plugin.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jconsole.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar
> 	/Users/trisberg/Projects/plainJpa/classes
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-jdbc-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-persistence-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-lib-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-kernel-5-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/commons-collections-3.2.jar
> 	/Users/trisberg/Projects/plainJpa/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar
> 	/Users/trisberg/Projects/plainJpa/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar
> 	/Users/trisberg/Projects/plainJpa/lib/commons-pool-1.3.jar
> 	/Users/trisberg/Projects/plainJpa/lib/serp-1.11.0.jar
> 	/Users/trisberg/Projects/plainJpa/lib/hsqldb.jar
> 	/Users/trisberg/Projects/plainJpa/lib/persistence-api-1.0.jar
> 	/Users/trisberg/Projects/plainJpa/lib/commons-logging-1.0.4.jar
> 	/Users/trisberg/Projects/plainJpa/lib/commons-dbcp-1.2.1.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-persistence-jdbc-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/commons-lang-2.1.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-kernel-0.9.0-incubating-SNAPSHOT.jar
> 	/Users/trisberg/Projects/plainJpa/lib/openjpa-jdbc-5-0.9.0-incubating-SNAPSHOT.jar
> 	/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar
> user.dir: /Users/trisberg/Projects/plainJpa
> TestApp!
> 119  INFO   [main] openjpa.Runtime - Starting OpenJPA 0.9.0-incubating-SNAPSHOT
> Exception in thread "main" <0|false|0.9.0-incubating-SNAPSHOT> org.apache.openjpa.persistence.PersistenceException:
null
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
> 	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:139)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:171)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:124)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:50)
> 	at springdeveloper.TestApp.run(TestApp.java:53)
> 	at springdeveloper.TestApp.main(TestApp.java:27)
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.meta.ClassMetaData.getSuperclassField(ClassMetaData.java:820)
> 	at org.apache.openjpa.meta.ClassMetaData.resolveDefinedSuperclassFields(ClassMetaData.java:1115)
> 	at org.apache.openjpa.meta.ClassMetaData.defineSuperclassFields(ClassMetaData.java:1091)
> 	at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:314)
> 	at org.apache.openjpa.meta.MetaDataRepository.loadMapping(MetaDataRepository.java:605)
> 	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:505)
> 	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:300)
> 	at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:279)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:660)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:731)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:630)
> 	at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:160)
> 	at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:126)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:164)
> 	... 6 more
> Process finished with exit code 1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message