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 Martin Kalén <mk...@apache.org> on 2005/06/01 01:47:50 UTC
Re: I am having a problem with enhancing a .class for JDO
Rahul Srivastava wrote:
> Hi
> i am having a rpoblem with JDO . please help me for this.
<snip/>
> [java] com.sun.jdori.enhancer.util.InternalError: assertion failed:
> cannot
> find class file for class: org/apache/ojb/tutorial5/Product
<snip/>
> BUILD FAILED
> D:\ojb-blank\ojb-blank\build.xml:226: Java returned: 1
It looks like you might be trying to follow the JDO tutorial [1].
Unfortunately the tutorial is not 100% updated on the Apache OJB website,
so you will have to read some steps a bit differently and perform some
minor hacking to get going:
"Extract the tutorial-src.jar"
=> "Extract the tutorial5-src.jar"
"Download jdori.jar,jdo.jar from Sun's JDO site"
=> "Download jdori-enhancer.jar,jdori.jar,jdo.jar from Sun's JDO site" [2]
"cd build/resources ; java org.apache.ojb.tutorial5.Main"
=> "cd build ; java -cp
.:classes:../src/java:../lib/jdo.jar:../lib/jdori.jar:../lib/db-ojb-1.0.3.jar:../lib/antlr-2.7.5.jar:../lib/hsqldb.jar:../lib/commons-lang-2.0.jar:../lib/commons-pool-1.2.jar:../lib/commons-collections-2.1.1.jar:../lib/commons-dbcp-1.2.1.jar
org.apache.ojb.tutorial5.Application"
Or for Windows:
cd build
java -cp
.;classes;..\src\java;..\lib\jdo.jar;..\lib\jdori.jar;..\lib\db-ojb-1.0.3.jar;..\lib\antlr-2.7.5.jar;..\lib\hsqldb.jar;..\lib\commons-lang-2.0.jar;..\lib\commons-pool-1.2.jar;..\lib\commons-collections-2.1.1.jar;..\lib\commons-dbcp-1.2.1.jar
org.apache.ojb.tutorial5.Application
Download tutorial5-src.jar from your closest Apach mirror [3]
and extract it into a directory called java as subdirectory in
"src" of your ojb-blank project.
There is also a bug in the ojb-blank build.xml for performing the
Ant-task "enhance-jdori", you can patch build.xml from v1.0.3 release
by changing line 227 to:
<arg line="-v -f -d ${build.dir}/classes ${source.java.dir}/org/apache/ojb/tutorial5/Product.jdo
${build.dir}/classes/org/apache/ojb/tutorial5/Product.class"/>
Secondly, on line 45 adding:
<path id="compile-build-classpath">
<pathelement path="${build.dir}/classes"/>
<path refid="compile-classpath"/>
</path>
[insert blank line here]
And finally, on the new line 231 changing classpathref to:
classpathref="compile-build-classpath"
For more specific help, please tell us some more details
(Are you building from source or binary release?
Which O/S are you using (Windows, Linux, ...)?
Which version of OJB are you using?
Exactly what are you trying to do, eg which Ant-target?)
The JDO tutorial on the Apache OJB website and the ojb-blank project
will be updated so that you don't have perform all of these inconveniences
in a future release (hopefully before 1.0.4).
Regards,
Martin
[1] http://db.apache.org/ojb/docu/tutorials/jdo-tutorial.html
[2] http://java.sun.com/products/jdo/
[3] http://www.apache.org/dyn/closer.cgi/db/ojb/
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org