You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Bryan Dollery <Br...@ChaosEngineers.co.nz> on 2003/01/29 14:03:49 UTC

Strange Problem with DList?

Hi guys,

I'm getting a bizarre error trying to create a simple query. The error
message makes it look like I'm having problems creating DLists, but I can't
see why that should be. The query is simple, there isn't even a where
clause, and it's being run against a mysql table with about 5 records in
it.

I'm using OJB 0.9.8, against MySQL 3.23.52, on SKD1.4.1.

I've pasted the first bit of the stack-trace below (but I've added spaces
to enhance readability). It's the actual create method that is throwing the
exception, but the OQLQuery object definitely isn't null, and neither is
the simple query string (very simple, select, no where clause).

All opinions gratefully received.

Cheers,

Bryan

Output
-------------------------
[BOOT] WARN: Value
"org.apache.ojb.broker.accesslayer.ConnectionFactoryDefaultImpl" is illegal
for key "ConnectionFactoryClass" (should be a class, using default value
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)

[BOOT] WARN: Value
"org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl" is illegal for
key "PersistentFieldClass" (should be a class, using default value
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl)

[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Create
PersistenceBroker instance pool, pool configuration was
{whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000,
numTestsPerEvictionRun=10, testWhileIdle=false, testOnReturn=false,
timeBetweenEvictionRunsMillis=-1, minEvictableIdleIimeMillis=600000,
testOnBorrow=false}

[org.apache.ojb.broker.util.sequence.SequenceManagerFactory] INFO: Use
sequence manager class: class
org.apache.ojb.broker.util.sequence.SequenceManagerHiLoImpl

*Connected*

[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
Create connection pool for JdbcDescriptorKey 1276169792

[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
Create new connection pool for
org.apache.ojb.broker.metadata.JdbcConnectionDescriptor,
 used descriptor: JdbcConnectionDescriptor

DBMS:MySQL
DRIVER: com.mysql.jdbc.Driver
PROTOCOL: jdbc
SUBPROTOCOL: mysql
DBALIAS: //localhost:3306/student
USERNAME: root
PASSWORD:
EAGER RELEASE: false

pool configuration was: {whenExhaustedAction=0, maxIdle=-1, maxActive=21,
maxWait=5000, numTestsPerEvictionRun=10, testWhileIdle=false,
testOnReturn=false, timeBetweenEvictionRunsMillis=-1,
minEvictableIdleIimeMillis=600000, testOnBorrow=true}

[DEFAULT] WARN: Could not found autoincrement attribute for class:
org.apache.ojb.odmg.collections.DListImpl

[org.apache.ojb.odmg.collections.DListImpl] ERROR: Generation of new id
failed

null

java.lang.NullPointerException
	at
org.apache.ojb.broker.util.sequence.SequenceManagerHelper.buildSequenceName
(Unknown Source)
	at
org.apache.ojb.broker.util.sequence.SequenceManagerHiLoImpl.getUniqueId(Unk
nown Source)
	at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(Unknown
Source)
	at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getUniqueId(Unkn
own Source)
	at org.apache.ojb.odmg.collections.DListImpl.generateNewId(Unknown Source)
	at org.apache.ojb.odmg.collections.DListImpl.<init>(Unknown Source)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcce
ssorImpl.java:39)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
ctorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at java.lang.Class.newInstance0(Class.java:306)
	at java.lang.Class.newInstance(Class.java:259)
	at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(U
nknown Source)
	at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(U
nknown Source)
	at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(U
nknown Source)
	at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getCollectionByQ
uery(Unknown Source)
	at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)
	at MyFirstORM.getStudents(MyFirstORM.java:48)


RE: Strange Problem with DList?

Posted by Bryan Dollery <Br...@ChaosEngineers.co.nz>.
Hi Armin,

Thanks for the rapid response.

Well, I sorta upgraded.

I took the config files from a simple Wiki I wrote, using OJB and gave them
to some java students of mine to use during a lecture on ORM and ODMG.

They wrote new code, but used the old config files, so that may be the
problem. Their code is locked away until the morning, so I'll try your
suggestion then.

However, after writing my message to the group I thought that I'd dust off
my 'working' code, and see if it still works in 0.9.8. Oddly enough it
doesn't. I've just followed your suggestion, and updated all of my config
files, and I've made sure that my classpath contains no reference to the
elder libraries. However, my old code don't work.

I'll write about it in a separate question, so as not to clog up this one
:-)

Thanks again,

Bryan


Re: Strange Problem with DList?

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Bryan,

this seems a configuration problem. Did you update from an
earlier version of OJB without replacing the configuration files?
In particular OJB.properties?
If so, use the OJB.properties, repository.dtd,
repository_internal.xml.... shipped with the
actual version.

regards,
Armin

----- Original Message -----
From: "Bryan Dollery" <Br...@ChaosEngineers.co.nz>
To: "OJB Users List" <oj...@jakarta.apache.org>
Sent: Wednesday, January 29, 2003 2:03 PM
Subject: Strange Problem with DList?


> Hi guys,
>
> I'm getting a bizarre error trying to create a simple query. The error
> message makes it look like I'm having problems creating DLists, but I
can't
> see why that should be. The query is simple, there isn't even a where
> clause, and it's being run against a mysql table with about 5 records
in
> it.
>
> I'm using OJB 0.9.8, against MySQL 3.23.52, on SKD1.4.1.
>
> I've pasted the first bit of the stack-trace below (but I've added
spaces
> to enhance readability). It's the actual create method that is
throwing the
> exception, but the OQLQuery object definitely isn't null, and neither
is
> the simple query string (very simple, select, no where clause).
>
> All opinions gratefully received.
>
> Cheers,
>
> Bryan
>
> Output
> -------------------------
> [BOOT] WARN: Value
> "org.apache.ojb.broker.accesslayer.ConnectionFactoryDefaultImpl" is
illegal
> for key "ConnectionFactoryClass" (should be a class, using default
value
> org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)
>
> [BOOT] WARN: Value
> "org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl" is
illegal for
> key "PersistentFieldClass" (should be a class, using default value
> org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl)
>
> [org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO:
Create
> PersistenceBroker instance pool, pool configuration was
> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000,
> numTestsPerEvictionRun=10, testWhileIdle=false, testOnReturn=false,
> timeBetweenEvictionRunsMillis=-1, minEvictableIdleIimeMillis=600000,
> testOnBorrow=false}
>
> [org.apache.ojb.broker.util.sequence.SequenceManagerFactory] INFO: Use
> sequence manager class: class
> org.apache.ojb.broker.util.sequence.SequenceManagerHiLoImpl
>
> *Connected*
>
> [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
> Create connection pool for JdbcDescriptorKey 1276169792
>
> [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO:
> Create new connection pool for
> org.apache.ojb.broker.metadata.JdbcConnectionDescriptor,
>  used descriptor: JdbcConnectionDescriptor
>
> DBMS:MySQL
> DRIVER: com.mysql.jdbc.Driver
> PROTOCOL: jdbc
> SUBPROTOCOL: mysql
> DBALIAS: file://localhost:3306/student
> USERNAME: root
> PASSWORD:
> EAGER RELEASE: false
>
> pool configuration was: {whenExhaustedAction=0, maxIdle=-1,
maxActive=21,
> maxWait=5000, numTestsPerEvictionRun=10, testWhileIdle=false,
> testOnReturn=false, timeBetweenEvictionRunsMillis=-1,
> minEvictableIdleIimeMillis=600000, testOnBorrow=true}
>
> [DEFAULT] WARN: Could not found autoincrement attribute for class:
> org.apache.ojb.odmg.collections.DListImpl
>
> [org.apache.ojb.odmg.collections.DListImpl] ERROR: Generation of new
id
> failed
>
> null
>
> java.lang.NullPointerException
> at
>
org.apache.ojb.broker.util.sequence.SequenceManagerHelper.buildSequenceN
ame
> (Unknown Source)
> at
>
org.apache.ojb.broker.util.sequence.SequenceManagerHiLoImpl.getUniqueId(
Unk
> nown Source)
> at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(Unknown
> Source)
> at
>
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getUniqueId(U
nkn
> own Source)
> at org.apache.ojb.odmg.collections.DListImpl.generateNewId(Unknown
Source)
> at org.apache.ojb.odmg.collections.DListImpl.<init>(Unknown Source)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
> at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cce
> ssorImpl.java:39)
> at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tru
> ctorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> at java.lang.Class.newInstance0(Class.java:306)
> at java.lang.Class.newInstance(Class.java:259)
> at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(U
> nknown Source)
> at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(U
> nknown Source)
> at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(U
> nknown Source)
> at
>
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getCollection
ByQ
> uery(Unknown Source)
> at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)
> at MyFirstORM.getStudents(MyFirstORM.java:48)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ojb-user-help@jakarta.apache.org
>
>
>