Discussion:
[Middlegen-user] java.lang.ClassNotFoundException: middlegen.DontCloseLog4JLogSystem
Chris Malan
2003-06-05 07:59:12 UTC
Permalink
Hi All,

A few days ago this same problem was presented by somebody else, so obviously
it is not unique. There have been no answers as yet.

It happens when running the samples directly after clicking the Generate
button on the GUI.

First question: where is this class that can't be found?
Answer: in the middlegen.jar file in the ${MIDDLEGEN_HOME}/samples/lib
directory.

It would therefore seem that this middlegen.jar is not on the classpath.
Unfortunately, it is not so simple.

Looking at the build.xml I find:
<path id="lib.class.path">
<pathelement path="${database.driver.classpath}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>

<!-- The middlegen jars -->
<fileset dir="${middlegen.home}/">
<include name="*.jar"/>
</fileset>
</path>

I also find: <property name="lib.dir" value="${basedir}/lib"/>

As ${basedir} is the samples directory that places us right in the middle of
lib directory which contains middlegen.jar

Now we find:
<taskdef name="middlegen" classname="middlegen.MiddlegenTask"
classpathref="lib.class.path" /> in the middlegen task. BTW, this class is
also in the same jar file, and it seems to load well. Running the individual
tasks in sequence from the commandline, this is where the trouble is.
However, it seems that some of the other jars in the lib directory are indeed
added to the classpath, because disabling this little bit brings us not even
this far.

Of course, adding the middlegen.jar to the classpath does not work.

I've searched the middlegen archives, but no mention of this, apart from the
letter a few days ago.

The database tables where generated and populated (the three names etc), no
problem.

I run XDoclet1.2.1b2 and Ant 1.5.1

Any idea what can be wrong? I'm stuck.

Thanks very much.
--
Chris Malan
***@optusnet.com.au
Home Page: http://members.optusnet.com.au/~malan2000
Eivind Waaler
2003-06-05 08:25:03 UTC
Permalink
What version of Middlegen are we talking about here? What JDK version are
you using?

Make sure you don't have any other stuff in your classpath before running
Middlegen. Try 'set CLASSPATH=' or similar before you run 'ant
middlegen'. Also make sure you don't have any xdoclet stuff or other jar
files that may cause this in the %ANT_HOME%\lib directory.

.eivind
Post by Chris Malan
Hi All,
A few days ago this same problem was presented by somebody else, so obviously
it is not unique. There have been no answers as yet.
It happens when running the samples directly after clicking the Generate
button on the GUI.
First question: where is this class that can't be found?
Answer: in the middlegen.jar file in the ${MIDDLEGEN_HOME}/samples/lib
directory.
It would therefore seem that this middlegen.jar is not on the classpath.
Unfortunately, it is not so simple.
<path id="lib.class.path">
<pathelement path="${database.driver.classpath}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<!-- The middlegen jars -->
<fileset dir="${middlegen.home}/">
<include name="*.jar"/>
</fileset>
</path>
I also find: <property name="lib.dir" value="${basedir}/lib"/>
As ${basedir} is the samples directory that places us right in the middle of
lib directory which contains middlegen.jar
<taskdef name="middlegen" classname="middlegen.MiddlegenTask"
classpathref="lib.class.path" /> in the middlegen task. BTW, this class is
also in the same jar file, and it seems to load well. Running the individual
tasks in sequence from the commandline, this is where the trouble is.
However, it seems that some of the other jars in the lib directory are indeed
added to the classpath, because disabling this little bit brings us not even
this far.
Of course, adding the middlegen.jar to the classpath does not work.
I've searched the middlegen archives, but no mention of this, apart from the
letter a few days ago.
The database tables where generated and populated (the three names etc), no
problem.
I run XDoclet1.2.1b2 and Ant 1.5.1
Any idea what can be wrong? I'm stuck.
Thanks very much.
--
Chris Malan
Home Page: http://members.optusnet.com.au/~malan2000
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Chris Malan
2003-06-08 04:50:03 UTC
Permalink
Hi Eivind

Thanks very much for yor advice. It was the velocity.jar in /ant.home/lib/
that caused the problems. My system classpath includes only jdk1.4.0 and the
present directory - that is to say . . My Middlegen is 2.0b1.

Now there is a new problem, one which has cropped up once before. On starting
JBoss the database tables are created (actually I'm told they already exist)
and then I am told:

-- 23:30:50,983 INFO [jbossweb]
Extract
jar:file:/usr/local/jboss-3.0.4/server/default/tmp/deploy/server/default/deploy/airline.ear/
60.airline.ear-contents/airline-web.war!/ to
/tmp/Jetty_0_0_0_0_8080__airline/webapp

#Note: the file /airline-web.war and the directory
/tmp/Jetty_0_0_0_0_8080__airline/webapp both exist with the right permissions

More:
23:30:52,755 ERROR [Manager] could not create Store:
org.mortbay.j2ee.session.JGStore
java.lang.ClassNotFoundException: org.mortbay.j2ee.session.JGStore

JGStore.class is in org.mortbay.j2ee.jar which is in
/JBossHome/server/default/deploy/jbossweb.sar/

Now from the messages of JBoss at startup I get this as far as /jbossweb.sar/
(a directory, not a file) is concerned:

23:51:37,523 INFO [MainDeployer] Starting deployment of package:
file:/usr/local/jboss-3.0.4/server/default/deploy/jbossweb.sar/
23:51:41,370 INFO [jbossweb] Registered jboss.web:Jetty=0
23:51:41,584 INFO [jbossweb] Registered jboss.web:Code=0
23:51:41,681 INFO [jbossweb] Registered jboss.web:Log=0
23:51:41,801 INFO [jbossweb] Registered jboss.web:Log=0,sink=0
23:51:41,867 INFO [JettyService] Creating
23:51:44,052 INFO [jbossweb] Registered jboss.web:Jetty=0,SocketListener=0
23:51:44,509 INFO [jbossweb] Registered jboss.web:Jetty=0,AJP13Listener=0
23:51:44,623 INFO [jbossweb] Registered jboss.web:Jetty=0,NCSARequestLog=0
23:51:44,709 INFO [JettyService] Created
23:51:44,713 INFO [JettyService] Starting
23:51:44,715 INFO [MainDeployer] Adding deployer:
***@b34126
23:51:44,754 INFO [MainDeployer] Starting deployment of package:
file:/usr/local/jboss-3.0.4/server/default/deploy/http-invoker.sar/invoker.war/

The last line is just to show that JBoss is finished deploying the contents of
directory jbossweb.sar - hopefully also org.mortbay.j2ee.jar, although there
are no messages about it.

Now, as far as JBoss is concerned, this is the environment it operates in
(straight from the horse's mouth):

================================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /usr/local/jboss-3.0.4

JAVA: /usr/java/j2sdk1.4.0/bin/java

JAVA_OPTS: -server -Dprogram.name=run.sh

CLASSPATH:
/usr/local/jboss-3.0.4/bin/run.jar:/usr/java/j2sdk1.4.0/lib/tools.jar

================================================================================

The previous time this happened to me I deleted all the CMR <ejb-ref> entries.
JBoss then loaded fine, but without the descriptor <ejb-ref> entries the
application of course can't work. I've looked at the ejb-jar.xml of the
sample and it does seem to be fine. It even has <ejb-local-ref> elements.

The only jar in JBoss that didn't come with JBoss is the database driver jar
file, pgjdbc2.jar. I've tried it with the jar that ships with Middlegen,
postgres.jar, the results are the same.

Any idea what it may be this time?

Thanks very much,


Chris Malan
***@optusnet.com.au
Home Page: http://members.optusnet.com.au/~malan2000
Eivind Waaler
2003-06-08 22:35:02 UTC
Permalink
I'm not too sure, but this sounds more like some kind of error with your
jboss installation. I'd try searching the jboss forums for similar errors.

.eivind
Post by Chris Malan
Hi Eivind
Thanks very much for yor advice. It was the velocity.jar in /ant.home/lib/
that caused the problems. My system classpath includes only jdk1.4.0 and the
present directory - that is to say . . My Middlegen is 2.0b1.
Now there is a new problem, one which has cropped up once before. On starting
JBoss the database tables are created (actually I'm told they already exist)
-- 23:30:50,983 INFO [jbossweb]
Extract
jar:file:/usr/local/jboss-3.0.4/server/default/tmp/deploy/server/default/deploy/airline.ear/
60.airline.ear-contents/airline-web.war!/ to
/tmp/Jetty_0_0_0_0_8080__airline/webapp
#Note: the file /airline-web.war and the directory
/tmp/Jetty_0_0_0_0_8080__airline/webapp both exist with the right permissions
org.mortbay.j2ee.session.JGStore
java.lang.ClassNotFoundException: org.mortbay.j2ee.session.JGStore
JGStore.class is in org.mortbay.j2ee.jar which is in
/JBossHome/server/default/deploy/jbossweb.sar/
Now from the messages of JBoss at startup I get this as far as /jbossweb.sar/
file:/usr/local/jboss-3.0.4/server/default/deploy/jbossweb.sar/
23:51:41,370 INFO [jbossweb] Registered jboss.web:Jetty=0
23:51:41,584 INFO [jbossweb] Registered jboss.web:Code=0
23:51:41,681 INFO [jbossweb] Registered jboss.web:Log=0
23:51:41,801 INFO [jbossweb] Registered jboss.web:Log=0,sink=0
23:51:41,867 INFO [JettyService] Creating
23:51:44,052 INFO [jbossweb] Registered jboss.web:Jetty=0,SocketListener=0
23:51:44,509 INFO [jbossweb] Registered jboss.web:Jetty=0,AJP13Listener=0
23:51:44,623 INFO [jbossweb] Registered jboss.web:Jetty=0,NCSARequestLog=0
23:51:44,709 INFO [JettyService] Created
23:51:44,713 INFO [JettyService] Starting
file:/usr/local/jboss-3.0.4/server/default/deploy/http-invoker.sar/invoker.war/
The last line is just to show that JBoss is finished deploying the contents of
directory jbossweb.sar - hopefully also org.mortbay.j2ee.jar, although there
are no messages about it.
Now, as far as JBoss is concerned, this is the environment it operates in
================================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/jboss-3.0.4
JAVA: /usr/java/j2sdk1.4.0/bin/java
JAVA_OPTS: -server -Dprogram.name=run.sh
/usr/local/jboss-3.0.4/bin/run.jar:/usr/java/j2sdk1.4.0/lib/tools.jar
================================================================================
The previous time this happened to me I deleted all the CMR <ejb-ref> entries.
JBoss then loaded fine, but without the descriptor <ejb-ref> entries the
application of course can't work. I've looked at the ejb-jar.xml of the
sample and it does seem to be fine. It even has <ejb-local-ref> elements.
The only jar in JBoss that didn't come with JBoss is the database driver jar
file, pgjdbc2.jar. I've tried it with the jar that ships with Middlegen,
postgres.jar, the results are the same.
Any idea what it may be this time?
Thanks very much,
Chris Malan
Home Page: http://members.optusnet.com.au/~malan2000
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...