openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willis Blackburn (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1804) NPE in MappingInfo.java line 1514
Date Wed, 22 Sep 2010 11:13:32 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913500#action_12913500
] 

Willis Blackburn commented on OPENJPA-1804:
-------------------------------------------

Test case run:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -Dfile.encoding=MacRoman
-classpath /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/Contents/Resources/Java/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/javaws.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/management-agent.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/alt-rt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunpkcs11.jar:/Users/wboyce/git/openjpatest/target/classes:/Users/wboyce/.m2/repository/org/apache/openjpa/openjpa/2.0.1/openjpa-2.0.1.jar:/Users/wboyce/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:/Users/wboyce/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/Users/wboyce/.m2/repository/net/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar:/Users/wboyce/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/wboyce/.m2/repository/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar:/Users/wboyce/.m2/repository/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar:/Users/wboyce/.m2/repository/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar:/Users/wboyce/.m2/repository/org/apache/geronimo/specs/geronimo-jpa_2.0_spec/1.1/geronimo-jpa_2.0_spec-1.1.jar:/Users/wboyce/.m2/repository/com/h2database/h2/1.2.143/h2-1.2.143.jar
openjpatest.Main
6  db  TRACE  [main] openjpa.Runtime - Setting the following properties from "file:/Users/wboyce/git/openjpatest/target/classes/META-INF/persistence.xml"
into configuration: {openjpa.BrokerFactory=jdbc, openjpa.ConnectionDriverName=org.h2.Driver,
openjpa.RuntimeUnenhancedClasses=supported, javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl,
openjpa.MetaDataFactory=jpa(Types=openjpatest.AddressBook;openjpatest.Group;openjpatest.Organization),
openjpa.Log=DefaultLevel=TRACE, PersistenceVersion=2.0, openjpa.ConnectionURL=jdbc:h2:mem:test,
openjpa.Id=db}
44  db  TRACE  [main] openjpa.Runtime - org.apache.openjpa.enhance.InstrumentationFactory.findToolsJar()
-- couldn't find /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/tools.jar
46  db  TRACE  [main] openjpa.Runtime - Trying to load javax.validation APIs based on the
ValidationMode=AUTO
48  db  TRACE  [main] openjpa.Runtime - Could not create the optional validation provider.
Reason returned: "No available javax.validation APIs"
77  db  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.0.1
78  db  TRACE  [main] openjpa.Runtime - Properties: javax.persistence.lock.timeout: 0
javax.persistence.query.timeout: 0
javax.persistence.sharedCache.mode: UNSPECIFIED
javax.persistence.validation.group.pre-persist: javax.validation.groups.Default
javax.persistence.validation.group.pre-update: javax.validation.groups.Default
openjpa.AutoClear: 0
openjpa.AutoDetach: [Ljava.lang.String;@2af081
openjpa.BrokerFactory: jdbc
openjpa.BrokerImpl: default
openjpa.CacheDistributionPolicy: default
openjpa.Callbacks: default
openjpa.ClassResolver: default
openjpa.Compatibility: default
openjpa.ConnectionDriverName: org.h2.Driver
openjpa.ConnectionFactoryMode: false
openjpa.ConnectionRetainMode: 0
openjpa.ConnectionURL: jdbc:h2:mem:test
openjpa.DataCache: false
openjpa.DataCacheManager: default
openjpa.DataCacheTimeout: -1
openjpa.DetachState: loaded
openjpa.DynamicDataStructs: false
openjpa.DynamicEnhancementAgent: true
openjpa.EntityManagerFactory: default
openjpa.FetchBatchSize: -1
openjpa.FetchGroups: [Ljava.lang.String;@313a53d
openjpa.FlushBeforeQueries: 0
openjpa.Id: db
openjpa.IgnoreChanges: false
openjpa.InitializeEagerly: false
openjpa.InverseManager: false
openjpa.LifecycleEventManager: default
openjpa.LockManager: mixed
openjpa.Log: true(DefaultLevel=TRACE)
openjpa.ManagedRuntime: auto
openjpa.MaxFetchDepth: -1
openjpa.MetaDataFactory: jpa(Types=openjpatest.AddressBook;openjpatest.Group;openjpatest.Organization)
openjpa.MetaDataRepository: default
openjpa.Multithreaded: false
openjpa.NontransactionalRead: true
openjpa.NontransactionalWrite: true
openjpa.Optimistic: true
openjpa.OrphanedKeyAction: log
openjpa.ProxyManager: default
openjpa.QueryCache: false
openjpa.QueryCompilationCache: true
openjpa.ReadLockLevel: 10
openjpa.RefreshFromDataCache: false
openjpa.RestoreState: 1
openjpa.RetainState: true
openjpa.RetryClassRegistration: false
openjpa.RuntimeUnenhancedClasses: 0
openjpa.SavepointManager: in-mem
openjpa.Sequence: table
openjpa.TransactionMode: false
openjpa.WriteLockLevel: 20
openjpa.jdbc.DriverDataSource: simple
openjpa.jdbc.EagerFetchMode: 2
openjpa.jdbc.FetchDirection: 1000
openjpa.jdbc.FinderCache: true
openjpa.jdbc.IdentifierUtil: default
openjpa.jdbc.LRSSize: 2
openjpa.jdbc.MappingDefaults: jpa
openjpa.jdbc.QuerySQLCache: true
openjpa.jdbc.ResultSetType: 1003
openjpa.jdbc.SQLFactory: default
openjpa.jdbc.SchemaFactory: dynamic
openjpa.jdbc.Schemas: [Ljava.lang.String;@2af081
openjpa.jdbc.SubclassFetchMode: 1
openjpa.jdbc.SynchronizeMappings: null
openjpa.jdbc.TransactionIsolation: -1
openjpa.jdbc.UpdateManager: default
89  db  TRACE  [main] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
140  db  TRACE  [main] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@4d3c7378".
171  db  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.H2Dictionary".
271  db  TRACE  [main] openjpa.jdbc.JDBC - createConnectionFactory: DataSource=org.apache.openjpa.jdbc.schema.SimpleDriverDataSource_@50269997
310  db  TRACE  [main] openjpa.jdbc.JDBC - DataSource connection setAutoCommit to "true"
524  db  TRACE  [main] openjpa.jdbc.JDBC - catalogSeparator: .
catalogTerm: catalog
databaseProductName: H2
databaseProductVersion: 1.2.143 (2010-09-18)
driverName: H2 JDBC Driver
driverVersion: 1.2.143 (2010-09-18)
extraNameCharacters: 
identifierQuoteString: "
numericFunctions: ABS,ACOS,ASIN,ATAN,COS,COT,SIN,TAN,ATAN2,BITAND,BITOR,BITXOR,MOD,CEILING,DEGREES,EXP,FLOOR,LOG,LOG10,RADIANS,SQRT,PI,POWER,RAND,RANDOM_UUID,ROUND,ROUNDMAGIC,SECURE_RAND,SIGN,ENCRYPT,DECRYPT,HASH,TRUNCATE,COMPRESS,EXPAND,ZERO
procedureTerm: procedure
schemaTerm: schema
searchStringEscape: \
sqlKeywords: LIMIT,MINUS,ROWNUM,SYSDATE,SYSTIME,SYSTIMESTAMP,TODAY
stringFunctions: ASCII,BIT_LENGTH,LENGTH,OCTET_LENGTH,CHAR,CONCAT,DIFFERENCE,HEXTORAW,RAWTOHEX,INSTR,INSERT,LOWER,UPPER,LEFT,RIGHT,LOCATE,POSITION,LPAD,RPAD,LTRIM,RTRIM,TRIM,REGEXP_REPLACE,REPEAT,REPLACE,SOUNDEX,SPACE,STRINGDECODE,STRINGENCODE,STRINGTOUTF8,SUBSTRING,UTF8TOSTRING,XMLATTR,XMLNODE,XMLCOMMENT,XMLCDATA,XMLSTARTDOC,XMLTEXT
systemFunctions: ARRAY_GET,ARRAY_LENGTH,AUTOCOMMIT,CANCEL_SESSION,CASEWHEN,CAST,COALESCE,CONVERT,CURRVAL,CSVREAD,CSVWRITE,DATABASE,DATABASE_PATH,FILE_READ,GREATEST,IDENTITY,IFNULL,LEAST,LOCK_MODE,LOCK_TIMEOUT,LINK_SCHEMA,MEMORY_FREE,MEMORY_USED,NEXTVAL,NULLIF,READONLY,ROWNUM,SCHEMA,SCOPE_IDENTITY,SESSION_ID,SET,TABLE,TRANSACTION_ID,USER
timeDateFunctions: CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,DATEADD,DATEDIFF,DAYNAME,DAY_OF_MONTH,DAY_OF_WEEK,DAY_OF_YEAR,EXTRACT,FORMATDATETIME,HOUR,MINUTE,MONTH,MONTHNAME,PARSEDATETIME,QUARTER,SECOND,WEEK,YEAR
url: jdbc:h2:mem:test
userName: 
defaultTransactionIsolation: 2
driverMajorVersion: 1
driverMinorVersion: 2
maxBinaryLiteralLength: 0
maxCatalogNameLength: 0
maxCharLiteralLength: 0
maxColumnNameLength: 0
maxColumnsInGroupBy: 0
maxColumnsInIndex: 0
maxColumnsInOrderBy: 0
maxColumnsInSelect: 0
maxColumnsInTable: 0
maxConnections: 0
maxCursorNameLength: 0
maxIndexLength: 0
maxProcedureNameLength: 0
maxRowSize: 0
maxSchemaNameLength: 0
maxStatementLength: 0
maxStatements: 0
maxTableNameLength: 0
maxTablesInSelect: 0
maxUserNameLength: 0
isCatalogAtStart: true
isReadOnly: false
nullPlusNonNullIsNull: true
nullsAreSortedAtEnd: false
nullsAreSortedAtStart: false
nullsAreSortedHigh: false
nullsAreSortedLow: true
storesLowerCaseIdentifiers: false
storesLowerCaseQuotedIdentifiers: false
storesMixedCaseIdentifiers: false
storesMixedCaseQuotedIdentifiers: true
storesUpperCaseIdentifiers: true
storesUpperCaseQuotedIdentifiers: false
supportsAlterTableWithAddColumn: true
supportsAlterTableWithDropColumn: true
supportsANSI92EntryLevelSQL: true
supportsANSI92FullSQL: false
supportsANSI92IntermediateSQL: false
supportsCatalogsInDataManipulation: true
supportsCatalogsInIndexDefinitions: true
supportsCatalogsInPrivilegeDefinitions: true
supportsCatalogsInProcedureCalls: false
supportsCatalogsInTableDefinitions: true
supportsColumnAliasing: true
supportsConvert: true
supportsCoreSQLGrammar: true
supportsCorrelatedSubqueries: true
supportsDataDefinitionAndDataManipulationTransactions: false
supportsDataManipulationTransactionsOnly: true
supportsDifferentTableCorrelationNames: false
supportsExpressionsInOrderBy: true
supportsExtendedSQLGrammar: false
supportsFullOuterJoins: false
supportsGroupBy: true
supportsGroupByBeyondSelect: true
supportsGroupByUnrelated: true
supportsIntegrityEnhancementFacility: true
supportsLikeEscapeClause: true
supportsLimitedOuterJoins: true
supportsMinimumSQLGrammar: true
supportsMixedCaseIdentifiers: false
supportsMixedCaseQuotedIdentifiers: true
supportsMultipleResultSets: false
supportsMultipleTransactions: true
supportsNonNullableColumns: true
supportsOpenCursorsAcrossCommit: false
supportsOpenCursorsAcrossRollback: false
supportsOpenStatementsAcrossCommit: true
supportsOpenStatementsAcrossRollback: true
supportsOrderByUnrelated: true
supportsOuterJoins: true
supportsPositionedDelete: true
supportsPositionedUpdate: true
supportsSchemasInDataManipulation: true
supportsSchemasInIndexDefinitions: true
supportsSchemasInPrivilegeDefinitions: true
supportsSchemasInProcedureCalls: true
supportsSchemasInTableDefinitions: true
supportsSelectForUpdate: true
supportsStoredProcedures: false
supportsSubqueriesInComparisons: true
supportsSubqueriesInExists: true
supportsSubqueriesInIns: true
supportsSubqueriesInQuantifieds: true
supportsTableCorrelationNames: true
supportsTransactions: true
supportsUnion: true
supportsUnionAll: true
usesLocalFilePerTable: false
usesLocalFiles: true
allProceduresAreCallable: true
allTablesAreSelectable: true
dataDefinitionCausesTransactionCommit: true
dataDefinitionIgnoredInTransactions: false
doesMaxRowSizeIncludeBlobs: false
supportsBatchUpdates: true
526  db  TRACE  [main] openjpa.jdbc.JDBC - Initial connection autoCommit: true, holdability:
1, TransactionIsolation: 2
528  db  TRACE  [main] openjpa.jdbc.JDBC - <t 421134813, conn 2054185226> [0 ms] close
580  db  TRACE  [main] openjpa.Runtime - Found datasource1: datasource 1344706967 from configuration.
StoreContext: org.apache.openjpa.kernel.FinalizingBrokerImpl@359ecd80
590  db  TRACE  [main] openjpa.MetaData - Scanning resource "META-INF/orm.xml" for persistent
types.
591  db  TRACE  [main] openjpa.MetaData - The persistent unit root url is "null"
591  db  TRACE  [main] openjpa.MetaData - parsePersistentTypeNames() found [openjpatest.Group,
openjpatest.Organization, openjpatest.AddressBook].
591  db  TRACE  [main] openjpa.MetaData - Found 3 classes with metadata in 4 milliseconds.
619  db  TRACE  [main] openjpa.Enhance - org.apache.openjpa.enhance.InstrumentationFactory.findToolsJar()
-- couldn't find /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/tools.jar
620  db  INFO   [main] openjpa.Enhance - Creating subclass for "[class openjpatest.Group,
class openjpatest.Organization, class openjpatest.AddressBook]". This means that your application
will be less efficient and will consume more memory than it would if you ran the OpenJPA enhancer.
Additionally, lazy loading will not be available for one-to-one and many-to-one persistent
attributes in types using field access; they will be loaded eagerly instead.
645  db  TRACE  [main] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
645  db  TRACE  [main] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@643cb075".
645  db  TRACE  [main] openjpa.MetaData - Loading metadata for "class openjpatest.Group" under
mode "[META]".
646  db  TRACE  [main] openjpa.MetaData - Scanning resource "META-INF/orm.xml" for persistent
types.
646  db  TRACE  [main] openjpa.MetaData - The persistent unit root url is "null"
646  db  TRACE  [main] openjpa.MetaData - parsePersistentTypeNames() found [openjpatest.Group,
openjpatest.Organization, openjpatest.AddressBook].
646  db  TRACE  [main] openjpa.MetaData - Found 3 classes with metadata in 1 milliseconds.
696  db  TRACE  [main] openjpa.MetaData - Parsing class "openjpatest.Group".
697  db  TRACE  [main] openjpa.MetaData - Parsing package "openjpatest.Group".
711  db  TRACE  [main] openjpa.MetaData - Generating default metadata for type "openjpatest.Group".
711  db  TRACE  [main] openjpa.MetaData - Using reflection for metadata generation.
748  db  TRACE  [main] openjpa.MetaData - Set persistence-capable superclass of "openjpatest.Group"
to "null".
750  db  TRACE  [main] openjpa.MetaData - Resolving metadata for "openjpatest.Group@471860896".
750  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.id".
757  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.name".
757  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.organization".
757  db  TRACE  [main] openjpa.MetaData - Loading metadata for "class openjpatest.Organization"
under mode "[META]".
757  db  TRACE  [main] openjpa.MetaData - Parsing class "openjpatest.Organization".
757  db  TRACE  [main] openjpa.MetaData - Generating default metadata for type "openjpatest.Organization".
757  db  TRACE  [main] openjpa.MetaData - Using reflection for metadata generation.
764  db  TRACE  [main] openjpa.MetaData - Set persistence-capable superclass of "openjpatest.Organization"
to "null".
764  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.version".
765  db  TRACE  [main] openjpa.MetaData - Resolving metadata for "openjpatest.Organization@92700153".
765  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Organization@92700153.addressBook".
765  db  TRACE  [main] openjpa.MetaData - Loading metadata for "class openjpatest.AddressBook"
under mode "[META]".
765  db  TRACE  [main] openjpa.MetaData - Parsing class "openjpatest.AddressBook".
766  db  TRACE  [main] openjpa.MetaData - Generating default metadata for type "openjpatest.AddressBook".
766  db  TRACE  [main] openjpa.MetaData - Using reflection for metadata generation.
773  db  TRACE  [main] openjpa.MetaData - Generating default metadata for type "openjpatest.EmailAddress".
773  db  TRACE  [main] openjpa.MetaData - Using reflection for metadata generation.
773  db  TRACE  [main] openjpa.MetaData - Set persistence-capable superclass of "openjpatest.AddressBook"
to "null".
773  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Organization@92700153.hostNames".
773  db  TRACE  [main] openjpa.MetaData - Resolving embedded metadata for "java.lang.Object@259650411".
775  db  TRACE  [main] openjpa.MetaData - Preparing mapping for "openjpatest.Group".
778  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.id".
783  db  TRACE  [main] openjpa.MetaData - 	"id" has mapping strategy "org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
784  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.name".
784  db  TRACE  [main] openjpa.MetaData - 	"name" has mapping strategy "org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".
784  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.version".
784  db  TRACE  [main] openjpa.MetaData - 	"version" has mapping strategy "none".
787  db  TRACE  [main] openjpa.MetaData - "openjpatest.Group<discriminator>" has mapping
strategy "value-map".
788  db  TRACE  [main] openjpa.MetaData - "openjpatest.Group<version>" has mapping strategy
"version-number".
788  db  TRACE  [main] openjpa.MetaData - Resolving mapping for "openjpatest.Group@471860896".
788  db  TRACE  [main] openjpa.MetaData - "openjpatest.Group" has mapping strategy "full".
788  db  TRACE  [main] openjpa.MetaData - 	Resolving field "openjpatest.Group@471860896.organization".
Exception in thread "main" <openjpa-2.0.1-r422266:989424 fatal user error> org.apache.openjpa.persistence.ArgumentException:
Errors encountered while resolving metadata.  See nested exceptions for details.
	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:642)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:385)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:358)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:256)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:227)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:195)
	at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:134)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:317)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:241)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:215)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
	at openjpatest.Main.main(Main.java:17)
Caused by: <openjpa-2.0.1-r422266:989424 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
No metadata was found for type "class java.lang.Object". The class is not enhanced.
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:377)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:358)
	at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1821)
	at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1786)
	at org.apache.openjpa.meta.ValueMetaDataImpl.resolve(ValueMetaDataImpl.java:435)
	at org.apache.openjpa.jdbc.meta.ValueMappingImpl.resolve(ValueMappingImpl.java:494)
	at org.apache.openjpa.meta.FieldMetaData.resolve(FieldMetaData.java:1732)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:458)
	at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1852)
	at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1786)
	at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:790)
	at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:693)
	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:617)
	... 14 more
NestedThrowables:
<openjpa-2.0.1-r422266:989424 fatal user error> org.apache.openjpa.persistence.ArgumentException:
Unable to resolve type "openjpatest.AddressBook" due to previous errors resolving related
type "openjpatest.Organization".
	at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:804)
	at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:693)
	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:617)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:385)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:358)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:256)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:227)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:195)
	at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:134)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:317)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:241)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:215)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
	at openjpatest.Main.main(Main.java:17)
java.lang.NullPointerException
	at org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1514)
	at org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(MappingInfo.java:1322)
	at org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(MappingInfo.java:1084)
	at org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:115)
	at org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:92)
	at org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:167)
	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:853)
	at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1791)
	at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:790)
	at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:751)
	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:631)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:385)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:358)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:256)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:227)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:195)
	at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:134)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:317)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:241)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:215)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
	at openjpatest.Main.main(Main.java:17)

Process finished with exit code 1


> NPE in MappingInfo.java line 1514
> ---------------------------------
>
>                 Key: OPENJPA-1804
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1804
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: Enhance, UnenhancedClasses, usability
>    Affects Versions: 2.0.1
>            Reporter: Willis Blackburn
>            Assignee: Donald Woods
>             Fix For: 2.1.0
>
>         Attachments: openjpatest.tar.gz
>
>
> I am encountering a NPE at MappingInfo.java line 1514.  I'm sorry I don't have time to
prepare a test case right now.  I'm not even 100% sure what is causing the problem, but it
seems to be something like this:
> I have classes Organization, Group, User, and AddressBook.
> Group has a reference (many-to-one) to Organization.
> I'm using field-level access and the Java 6 runtime enhancer.  (NOT the build-time enhancer
or the agent.)
> In ManagedClassSubclasser.prepareUnenhancedClasses, the code receives a list of Class
objects--the ones in persistence.xml.  They are not in the same order as they are in persistence.xml,
but I don't know if that's important.  The first one is Group.  During the processing of Group,
the code invokes ClassMapping.setTable to set the table name, which is "group_table."  This
comes from the @Table annotation of Group.  So far, so good.  Then the code does some additional
processing on the relationship mappings of Group, which include the reference to Organization.
 During the processing of that relationship, the code calls MappingInfo.mergeJoinColumn. 
On line 1367, the method calls rel.getTable.  The "rel" variable points to the ClassMapping
for Organization.  Remember that prepareUnenhancedClasses hasn't gotten to Organization yet--it's
still working on Group--and so I assume that this Organization mapping was created on-demand.
 However, rel.getTable returns null.  The Organization class has a @Table attribute, and I
can see that the table name has been loaded in the ClassMappingInfo instance attached to the
ClassMapping for Organization, however the table name has not yet been copied from ClassMappingInfo
to ClassMapping.  Later, the mergeJoinColumn method attempts to dereference the null table
name and generates the NPE.
> Bottom line:  When using the Java 6, runtime enhancer, if class A has a reference to
class B, and both classes have @Table annotations (at least), and class A is processed first,
then it produces a NPE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message