Re: jk2 problems with libapr.so

2002-01-22 Thread Aaron Bannert

On Mon, Jan 14, 2002 at 05:12:29PM +0100, jean-frederic clere wrote:
 Hi,
 
 I am playing with jk2 and I have noted that the loadNative() in AprImpl fails:
 +++
 java.lang.UnsatisfiedLinkError:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
 undefined symbol: crypt
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
 at java.lang.Runtime.load0(Runtime.java:698)
 at java.lang.System.load(System.java:797)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
 at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
 +++
 The problem is that apr needs other dynamic library.
 
 How should we solve the problem?:
 1 - Loading the missing libraries in the JVM (via System.load()) The list of
 needed library is in APRVARS.
 2 - Link jni_connect.so against a static libapr.a (like in mod_webapp for
 Apache-1.3).
 something like: gcc -shared -lm -lcrypt -lnsl -ldl -o jni_connect.so ...
 libapr.a
 
 Any comments?

Sorry for replying to this so late. As an FYI, APRVARS will soon be
removed from APR. Take a look at the replacement apr-config and
apu-config (in apr and apr-util respectively). It's not yet complete
(that's why APRVARS hasn't been removed yet), but if you see something
missing let us know.

-aaron


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




Re: jk2 problems with libapr.so

2002-01-16 Thread jean-frederic clere

[EMAIL PROTECTED] wrote:
 
 That's a bit problematic...
 
 I think it'll work fine if LD_LIBRARY_PATH is set before starting tomcat
 to include all the libs ( and libapr ) or of libapr ( and the rest ) are
 installed in the system dirs ( i.e. /usr/lib ).

It works better ;-) using System.loadLibrary() and set the LD_LIBRARY_PATH
before starting the JVM solves problem of finding the path.
System.loadNative(/usr/local/lib/libapr.so); could be changed into
System.loadLibrary(apr);

The remaing problem are the dependencies of libapr.so
How to load the needed libraries?
loadLibrary() does not make the symbols available to other libraries. (like
dlopen(RTLD_NOW|RTLD_GLOBAL)).

 
 The code in loadNative() was trying to work around and not require the
 user to set LD_LIBRARY_PATH, but including all deps is ugly.
 
 I suppose having libapr in lib path is a 'decent' requirement and we
 should drop the workaround.
 
 Using the .a lib is imho the worst solution - and I'm not sure how it'll
 interact with the jni connector ( when apr syms will be loaded twice ).

If there is only one *.so file that is no problem.
Using a dynamic libapr was a lot of problems in mod_webapp.

 
 Costin
 
 On Mon, 14 Jan 2002, jean-frederic clere wrote:
 
  Hi,
 
  I am playing with jk2 and I have noted that the loadNative() in AprImpl fails:
  +++
  java.lang.UnsatisfiedLinkError:
  /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
  /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
  undefined symbol: crypt
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
  at java.lang.Runtime.load0(Runtime.java:698)
  at java.lang.System.load(System.java:797)
  at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
  at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
  at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
  +++
  The problem is that apr needs other dynamic library.
 
  How should we solve the problem?:
  1 - Loading the missing libraries in the JVM (via System.load()) The list of
  needed library is in APRVARS.
  2 - Link jni_connect.so against a static libapr.a (like in mod_webapp for
  Apache-1.3).
  something like: gcc -shared -lm -lcrypt -lnsl -ldl -o jni_connect.so ...
  libapr.a
 
  Any comments?
 
  Cheers
 
  Jean-frederic
 
  --
  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]

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




RE: jk2 problems with libapr.so

2002-01-15 Thread GOMEZ Henri

I am playing with jk2 and I have noted that the loadNative() 
in AprImpl fails:
+++
java.lang.UnsatisfiedLinkError:
/home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
ibapr.so:
/home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
ibapr.so:
undefined symbol: crypt
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
at java.lang.Runtime.load0(Runtime.java:698)
at java.lang.System.load(System.java:797)
at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
+++
The problem is that apr needs other dynamic library.

How should we solve the problem?:
1 - Loading the missing libraries in the JVM (via 
System.load()) The list of
needed library is in APRVARS.

Did the System.load code known it's running on an APR
platform ? if so may be fine to add the needed libs there.

2 - Link jni_connect.so against a static libapr.a (like in 
mod_webapp for
Apache-1.3).
something like: gcc -shared -lm -lcrypt -lnsl -ldl -o 
jni_connect.so ...
libapr.a

the -lcrypt will need an update of build.xml ?

I'd prefer the option 1 since I'd like to have libapr.so used
instead of static libs, but it's just me own preference

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




Re: jk2 problems with libapr.so

2002-01-15 Thread jean-frederic clere

GOMEZ Henri wrote:
 
 I am playing with jk2 and I have noted that the loadNative()
 in AprImpl fails:
 +++
 java.lang.UnsatisfiedLinkError:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
 ibapr.so:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
 ibapr.so:
 undefined symbol: crypt
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
 at java.lang.Runtime.load0(Runtime.java:698)
 at java.lang.System.load(System.java:797)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
 at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
 +++
 The problem is that apr needs other dynamic library.
 
 How should we solve the problem?:
 1 - Loading the missing libraries in the JVM (via
 System.load()) The list of
 needed library is in APRVARS.
 
 Did the System.load code known it's running on an APR
 platform ? if so may be fine to add the needed libs there.

That is not very easy APRVARS contains for example:
EXTRA_LIBS=-lm -lcrypt -lnsl  -ldl
We may have to make a
load(/usr/lib/libm.so);load(/usr/local/bin/libcrypt.so);...

loadlibrary looks more easy but it loads only library in $JAVA_HOME/lib (Correct
me if I have wrong!). 

 
 2 - Link jni_connect.so against a static libapr.a (like in
 mod_webapp for
 Apache-1.3).
 something like: gcc -shared -lm -lcrypt -lnsl -ldl -o
 jni_connect.so ...
 libapr.a
 
 the -lcrypt will need an update of build.xml ?

Yep! The build.xml must be changed to a the content of EXTRA_LIBS it has to read
from the file APRVARS.


 
 I'd prefer the option 1 since I'd like to have libapr.so used
 instead of static libs, but it's just me own preference
 
 --
 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: jk2 problems with libapr.so

2002-01-15 Thread jean-frederic clere

GOMEZ Henri wrote:
 
 I am playing with jk2 and I have noted that the loadNative()
 in AprImpl fails:
 +++
 java.lang.UnsatisfiedLinkError:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
 ibapr.so:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/l
 ibapr.so:
 undefined symbol: crypt
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
 at java.lang.Runtime.load0(Runtime.java:698)
 at java.lang.System.load(System.java:797)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
 at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
 +++
 The problem is that apr needs other dynamic library.
 
 How should we solve the problem?:
 1 - Loading the missing libraries in the JVM (via
 System.load()) The list of
 needed library is in APRVARS.
 
 Did the System.load code known it's running on an APR
 platform ? if so may be fine to add the needed libs there.

That is not very easy APRVARS contains for example:
EXTRA_LIBS=-lm -lcrypt -lnsl  -ldl
We may have to make a
load(/usr/lib/libm.so);load(/usr/local/bin/libcrypt.so);...

loadlibrary() looks more easy but it loads only libraries in $JAVA_HOME/lib
(Correct
me if I have wrong!).

System is  java.lang.System ;-)

 
 2 - Link jni_connect.so against a static libapr.a (like in
 mod_webapp for
 Apache-1.3).
 something like: gcc -shared -lm -lcrypt -lnsl -ldl -o
 jni_connect.so ...
 libapr.a
 
 the -lcrypt will need an update of build.xml ?

Yep! The build.xml must be changed to a the content of EXTRA_LIBS it has to read
from the file APRVARS.


 
 I'd prefer the option 1 since I'd like to have libapr.so used
 instead of static libs, but it's just me own preference
 
 --
 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: jk2 problems with libapr.so

2002-01-15 Thread costinm

That's a bit problematic...

I think it'll work fine if LD_LIBRARY_PATH is set before starting tomcat
to include all the libs ( and libapr ) or of libapr ( and the rest ) are
installed in the system dirs ( i.e. /usr/lib ).

The code in loadNative() was trying to work around and not require the
user to set LD_LIBRARY_PATH, but including all deps is ugly.

I suppose having libapr in lib path is a 'decent' requirement and we
should drop the workaround.

Using the .a lib is imho the worst solution - and I'm not sure how it'll
interact with the jni connector ( when apr syms will be loaded twice ).


Costin


On Mon, 14 Jan 2002, jean-frederic clere wrote:

 Hi,

 I am playing with jk2 and I have noted that the loadNative() in AprImpl fails:
 +++
 java.lang.UnsatisfiedLinkError:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
 /home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
 undefined symbol: crypt
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
 at java.lang.Runtime.load0(Runtime.java:698)
 at java.lang.System.load(System.java:797)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
 at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
 at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
 +++
 The problem is that apr needs other dynamic library.

 How should we solve the problem?:
 1 - Loading the missing libraries in the JVM (via System.load()) The list of
 needed library is in APRVARS.
 2 - Link jni_connect.so against a static libapr.a (like in mod_webapp for
 Apache-1.3).
 something like: gcc -shared -lm -lcrypt -lnsl -ldl -o jni_connect.so ...
 libapr.a

 Any comments?

 Cheers

 Jean-frederic

 --
 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]




jk2 problems with libapr.so

2002-01-14 Thread jean-frederic clere

Hi,

I am playing with jk2 and I have noted that the loadNative() in AprImpl fails:
+++
java.lang.UnsatisfiedLinkError:
/home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
/home/jakarta/jakarta-tomcat-4.0.1/webapps/jk/WEB-INF/jk2/jni/libapr.so:
undefined symbol: crypt
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1277)
at java.lang.Runtime.load0(Runtime.java:698)
at java.lang.System.load(System.java:797)
at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:90)
at org.apache.jk.apr.AprImpl.loadNative(AprImpl.java:78)
at org.apache.jk.common.ChannelUn.init(ChannelUn.java:135)
+++
The problem is that apr needs other dynamic library.

How should we solve the problem?:
1 - Loading the missing libraries in the JVM (via System.load()) The list of
needed library is in APRVARS.
2 - Link jni_connect.so against a static libapr.a (like in mod_webapp for
Apache-1.3).
something like: gcc -shared -lm -lcrypt -lnsl -ldl -o jni_connect.so ...
libapr.a

Any comments?

Cheers

Jean-frederic

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