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 Sebastian Münch <se...@gmx.net> on 2003/12/10 19:43:31 UTC
How to set up a ojb-jdo project
Hi,
we are in the middle of developing a small application using the jdo api on
ojb. The
tutorials are running fine, now we wanna setup our own app. By compiling our
application,
we get the following error:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[JDO] DEBUG: OjbStoreConnector.begin: connectionReadyForRelease=false
javax.jdo.JDOUserException: Class given to getExtent does not implement
javax.jdo.spi.PersistenceCapable
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
Source)
at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
Source)
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
at test.TestApp.run(TestApp.java:57)
at test.TestApp.main(TestApp.java:25)
Exception in thread "main" javax.jdo.JDOUserException: Cannot close
PersistenceManager while transaction is still active.
at com.sun.jdori.common.PersistenceManagerImpl.close(Unknown Source)
at
com.sun.jdori.common.PersistenceManagerImpl.popCurrentWrapper(Unknown
Source)
at com.sun.jdori.common.PersistenceManagerWrapper.close(Unknown
Source)
at test.TestApp.run(TestApp.java:76)
at test.TestApp.main(TestApp.java:25)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Our persistent class is HJSTest. We applied the HSJTest.jdo to our
Userclass. The
following files are located In our project directory:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
HSJTest.jdo
OJB.properties
TestApp.class
TestApp.sh
Test_ClassDescriptor.xml
Test_ConnectionDescriptor.xml
Test_Repository.xml
cache.ccf
commons-logging.properties
jdo.dtd
log4j.properties
repository.dtd
repository.xml
repository_database.xml
repository_ejb.xml
repository_internal.xml
repository_jdo.xml
repository_junit.xml
repository_user.xml
simplelog.properties
spy.properties
test/
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Our source code including compiled files are located in the test/ directory.
We believe, that there is a problem with the Enhancer, adding the
PersistenceCapable -
Interface to our Class. Can anybody help us on that sibject?
Thx,
Jing, Holger, Sebastian
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: How to set up a ojb-jdo project
Posted by Gus Heck <gu...@olin.edu>.
This looks like a runtime error not a compile time error.
This exception means, as you guessed, that either you forgot to enhance
the class (with the sun reference enhancer), or the enhancer tried and
failed (you should get messages if it fails). Alternately, you have
inadvertently tried to get an extent of some other class that isn't
supposed to be persistant.
Do you get any error messages during enhancement?
Also, as always, check that your app is really getting re-deployed
properly, and you arn't seeing errors from an old version that is still
running. I use the Tomcat Manager App's Ant tasks for this, so I don't
have to worry about making sure I delete the warfiles, and the expanded
warfile, and I don't need to worry about whatever is in the work directory.
Also, you can eliminate repository_junit.xml and repository_internal.xml
(and thier references in repository.xml)
I'm not sure how anything is working unless you have flattened the
directory structure in your listing of files... the standard web ap
directory structure is:
+--WEB-INF--+
| +--classes/ <<< all class files in package dirs,
| | repository.xml & .dtd ,
| | OJB.properties plus
| | package.jdo/classname.jdo files
| | in appropriate dirs
| +--lib/ <<< All library jars here
| | (db-ojb-1.0.rc4.jar, jdo.jar etc)
| +--web.xml
+--index.jsp
+--staic-page.html
+--whatever-content-dirs/
Sourcefiles for your classes are not needed anywhere, and can be
ommited. Taglib descriptor (.tld) files can go anywhere, as long as your
pages specify their location correctly. I tend to put mine in /WEB-INF/lib.
Hope some of this helps, please create a new thread instead of replying
to an existing one next time you have a new question. The way you did it
you will only get seen by people who think "Newbie questions... please
help" is an interesting subject, or who do not view thier mail as
threads.You probably want the widest possible audience ;)
-Gus
Sebastian Münch wrote:
> Hi,
>
> we are in the middle of developing a small application using the jdo
> api on
> ojb. The
> tutorials are running fine, now we wanna setup our own app. By
> compiling our
> application,
> we get the following error:
>
>
> [JDO] DEBUG: OjbStoreConnector.begin: connectionReadyForRelease=false
> javax.jdo.JDOUserException: Class given to getExtent does not implement
> javax.jdo.spi.PersistenceCapable
> at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
> Source)
> at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
> Source)
> at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
> at test.TestApp.run(TestApp.java:57)
> at test.TestApp.main(TestApp.java:25)
> Exception in thread "main" javax.jdo.JDOUserException: Cannot close
> PersistenceManager while transaction is still active.
> at com.sun.jdori.common.PersistenceManagerImpl.close(Unknown Source)
>
> at
> com.sun.jdori.common.PersistenceManagerImpl.popCurrentWrapper(Unknown
> Source)
> at com.sun.jdori.common.PersistenceManagerWrapper.close(Unknown
> Source)
> at test.TestApp.run(TestApp.java:76)
> at test.TestApp.main(TestApp.java:25)
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Our persistent class is HJSTest. We applied the HSJTest.jdo to our
> Userclass. The
> following files are located In our project directory:
>
>
> HSJTest.jdo
> OJB.properties
> TestApp.class
> TestApp.sh
> Test_ClassDescriptor.xml
> Test_ConnectionDescriptor.xml
> Test_Repository.xml
> cache.ccf
> commons-logging.properties
> jdo.dtd
> log4j.properties
> repository.dtd
> repository.xml
> repository_database.xml
> repository_ejb.xml
> repository_internal.xml
> repository_jdo.xml
> repository_junit.xml
> repository_user.xml
> simplelog.properties
> spy.properties
> test/
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Our source code including compiled files are located in the test/
> directory.
>
>
>
> We believe, that there is a problem with the Enhancer, adding the
> PersistenceCapable -
> Interface to our Class. Can anybody help us on that sibject?
>
> Thx,
> Jing, Holger, Sebastian
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org