Tomcat classloader and JNI questions

2002-09-17 Thread Eric Hollander

I am working on getting Jmagick to work with Tomcat-4.1 and JDK 1.4.  I
have heard that it is possible but no one can quite describe how so I've
been doing some experimentation with it.

It does work if I use this command to start Tomcat:


# LD_LIBRARY_PATH=/usr/local/lib java -Djava.endorsed.dirs= -classpath
/usr/java/j2sdk1.4.0_01/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
-Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
-Djava.io.tmpdir=/var/tomcat4/temp org.apache.catalina.startup.Bootstrap
start

where of course the .so file is in /usr/local/lib.  So, I have two
questions related to this:

First, why should LD_LIBRARY_PATH be necessary?  I am doing this under
Linux, and I put /usr/local/lib in /etc/ld.conf, and reran ldconfig, so
I shouldn't need to set the LD_LIBRARY_PATH.  But if it is necessary, is
there some way to modify the startup scripts to take care of this, so I
can use them instead of having to start java directly from the command
line?

Second, it does not make sense to me that I have to include the
jmagick.jar in the classpath in the command line.  Tomcat's classloader
has many options and places to put things, but I tried putting the jar
in CATALINA_HOME/lib, CATALINA_HOME/common/lib, and WEB-INF/lib, and it
does not work in any of those cases.  The only way to get jmagick to
work is to add it to the command line classpath.  Is there any other
way, and if not, is there a way to modify the standard startup scripts
so that they include it, so I don't have to run java directly?

Thanks!  After I get this all figured out I'm going to write it up and
post it.  The good news is that Jmagick does definitely work with Tomcat
and JDK 1.4; the bad news is that it's not documented how to do this, so
I'll change that.


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




RE: Tomcat classloader and JNI questions

2002-09-17 Thread Miguel Angel Mulero Martinez

Have you tried CATALINA_HOME/server/lib?

-Mensaje original-
De: Eric Hollander [mailto:[EMAIL PROTECTED]]
Enviado el: martes, 17 de septiembre de 2002 10:23
Para: [EMAIL PROTECTED]
Asunto: Tomcat classloader and JNI questions

I am working on getting Jmagick to work with Tomcat-4.1 and JDK 1.4.  I
have heard that it is possible but no one can quite describe how so I've
been doing some experimentation with it.

It does work if I use this command to start Tomcat:


# LD_LIBRARY_PATH=/usr/local/lib java -Djava.endorsed.dirs= -classpath
/usr/java/j2sdk1.4.0_01/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
-Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
-Djava.io.tmpdir=/var/tomcat4/temp org.apache.catalina.startup.Bootstrap
start

where of course the .so file is in /usr/local/lib.  So, I have two
questions related to this:

First, why should LD_LIBRARY_PATH be necessary?  I am doing this under
Linux, and I put /usr/local/lib in /etc/ld.conf, and reran ldconfig, so
I shouldn't need to set the LD_LIBRARY_PATH.  But if it is necessary, is
there some way to modify the startup scripts to take care of this, so I
can use them instead of having to start java directly from the command
line?

Second, it does not make sense to me that I have to include the
jmagick.jar in the classpath in the command line.  Tomcat's classloader
has many options and places to put things, but I tried putting the jar
in CATALINA_HOME/lib, CATALINA_HOME/common/lib, and WEB-INF/lib, and it
does not work in any of those cases.  The only way to get jmagick to
work is to add it to the command line classpath.  Is there any other
way, and if not, is there a way to modify the standard startup scripts
so that they include it, so I don't have to run java directly?

Thanks!  After I get this all figured out I'm going to write it up and
post it.  The good news is that Jmagick does definitely work with Tomcat
and JDK 1.4; the bad news is that it's not documented how to do this, so
I'll change that.


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


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




RE: Tomcat classloader and JNI questions

2002-09-17 Thread Mr. Tomcat

On Mon, 2002-09-16 at 22:39, Miguel Angel Mulero Martinez wrote:
 Have you tried CATALINA_HOME/server/lib?

Yes, I tried that.  It didn't work.  The ONLY way to get the JVM to load
the shared libs is if the jmagick.jar is in the classpath itself.  Would
this be considered a Tomcat bug, or is this just the way it is with JDK
1.4?  If this is the only way to do this, there should probably be an
extra config files for adding more jars to the JVM's own classpath. 
Should I file this as a bug?



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




RE: Tomcat classloader and JNI questions

2002-09-17 Thread Cox, Charlie

put it in /common/lib and restart tomcat so that it sees it.

Tomcat completely ignores the classpath, so I'm not sure how that made a
difference here. 

Charlie

 -Original Message-
 From: Mr. Tomcat [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 5:47 AM
 To: Tomcat Users List
 Subject: RE: Tomcat classloader and JNI questions
 
 
 On Mon, 2002-09-16 at 22:39, Miguel Angel Mulero Martinez wrote:
  Have you tried CATALINA_HOME/server/lib?
 
 Yes, I tried that.  It didn't work.  The ONLY way to get the 
 JVM to load
 the shared libs is if the jmagick.jar is in the classpath 
 itself.  Would
 this be considered a Tomcat bug, or is this just the way it 
 is with JDK
 1.4?  If this is the only way to do this, there should probably be an
 extra config files for adding more jars to the JVM's own classpath. 
 Should I file this as a bug?
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 

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