Hi Björn,

I assume this call cause the NPE
> org.apache.ojb.broker.core.QueryReferenceBroker.getFKQuery1toN(QueryReferenceBroker.java:604)


The source looks like

private QueryByCriteria getFKQuery1toN(Object obj, ClassDescriptor cld, CollectionDescriptor cod)
{
ValueContainer[] container = pb.serviceBrokerHelper().getKeyValues(cld, obj);
ClassDescriptor refCld = pb.getClassDescriptor(cod.getItemClass());
// line 604


I think the CollectionDescriptor returns 'null' as item class.
So I think something in your mapping or manipulation of metadata (made by you?) is wrong.


regards,
Armin

Björn Voigt wrote:
I switched back to rc6 und removed the anonymous attribute,
but I still get theNullPointerException.


[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: **** startDoc ****
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > jdbc-connection-descriptor
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: jcd-alias: default
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: default-connection: true
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: platform: PostgreSQL
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: jdbc-level: 3.0
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: driver: org.postgresql.Driver
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: protocol: jdbc
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: subprotocol: postgresql
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: dbalias: portal?autoReconnect=true
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: jndi-datasource-name: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: username: portal
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: password:
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: eager-release: false
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: batch-mode: false
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: useAutoCommit: 1
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: ignoreAutoCommitExceptions: false
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > connection-pool
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: maxActive: 21
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: maxIdle: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: maxWait: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: minEvictableIdleTimeMillis: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: numTestsPerEvictionRun: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: testOnBorrow: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: testOnReturn: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: testWhileIdle: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: timeBetweenEvictionRunsMillis: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: whenExhaustedAction: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: connectionFactory: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: validationQuery:
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: logAbandoned: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: removeAbandoned: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: removeAbandonedTimeout: null
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < connection-pool
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > sequence-manager
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: className: org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: attribute-name: grabSize attribute-value: 20
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: attribute-name: autoNaming attribute-value: true
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: attribute-name: globalSequenceId attribute-value: false
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: > attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: attribute-name: globalSequenceStart attribute-value: 10000
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < attribute
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < sequence-manager
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: < jdbc-connection-descriptor
[org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler] DEBUG: **** endDoc ****
[org.apache.ojb.broker.metadata.ConnectionRepository] DEBUG: New descriptor was added: [EMAIL PROTECTED]
jcd-alias=default
default-connection=true
dbms=PostgreSQL
jdbc-level=3.0
driver=org.postgresql.Driver
protocol=jdbc
sub-protocol=postgresql
db-alias=portal?autoReconnect=true
user=portal
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false


[EMAIL PROTECTED]

sequenceManagerClass=class org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
Properties={autoNaming=true, globalSequenceId=false, globalSequenceStart=10000, grabSize=20}
]
]
[org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] INFO: Create new PB instance for PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, user=portal, password=*****, already created persistence broker instances: 0
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Start creating new ObjectCache instance
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Default ObjectCache class was org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
[org.apache.ojb.broker.cache.CacheDistributor] INFO: Use property 'descriptorBasedCaches' is set 'false'
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Instantiate new org.apache.ojb.broker.cache.CacheDistributor class object
[org.apache.ojb.broker.cache.ObjectCacheFactory] DEBUG: Object cache created, using cache:[EMAIL PROTECTED] [EMAIL PROTECTED],Used default [EMAIL PROTECTED] of cached objects=0,Lookup hits=0,Failures=0,Reclaimed=0],Mapped caches={}]
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: New ObjectCache instance was created
[org.apache.ojb.broker.util.sequence.SequenceManagerFactory] DEBUG: Default sequence manager class was org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
[org.apache.ojb.broker.util.sequence.SequenceManagerFactory] DEBUG: create new sequence manager for broker [EMAIL PROTECTED]
[org.apache.ojb.broker.util.sequence.SequenceManagerFactory] DEBUG: Jdbc-Connection-Descriptor 'default' use sequence manager: class org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Create new connection pool:[EMAIL PROTECTED]
jcd-alias=default
default-connection=true
dbms=PostgreSQL
jdbc-level=3.0
driver=org.postgresql.Driver
protocol=jdbc
sub-protocol=postgresql
db-alias=portal?autoReconnect=true
user=portal
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false


[EMAIL PROTECTED]

sequenceManagerClass=class org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
Properties={autoNaming=true, globalSequenceId=false, globalSequenceStart=10000, grabSize=20}
]
]
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] DEBUG: createPool was called
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] DEBUG: makeObject called
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] DEBUG: Request new connection from ConnectionFactory: [EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] DEBUG: localBegin was called for con [EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] DEBUG: Try to change autoCommit state to 'false'
[org.apache.ojb.broker.accesslayer.StatementManager] DEBUG: closeResources was called
Exception in thread "main" java.lang.NullPointerException
at org.apache.ojb.broker.metadata.DescriptorRepository.getDescriptorFor(DescriptorRepository.java:407)


at org.apache.ojb.broker.core.PersistenceBrokerImpl.getClassDescriptor(PersistenceBrokerImpl.java:1680)

at org.apache.ojb.broker.core.QueryReferenceBroker.getFKQuery1toN(QueryReferenceBroker.java:604)

at org.apache.ojb.broker.core.QueryReferenceBroker.getFKQuery(QueryReferenceBroker.java:538)

at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveCollection(QueryReferenceBroker.java:469)

at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveCollections(QueryReferenceBroker.java:656)

at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1291)

at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1355)

at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBrokerImpl.java:1334)

at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(PersistenceBrokerImpl.java:1422)

at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:300)

at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:300)

    at Test.main(Test.java:33)


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to