Re: tomcat jni configuration...

2003-12-04 Thread Tony
No. When it starts, I see the following error:

.
org.apache.jk.server.JkMain newHandler
SEVERE: No class name for channelJni  channelJni
org.apache.jk.server.JkMain start
INFO: APR not loaded, disabling jni componentes: java.io.IOException:
java.lang.UnsatisfiedLinkError: no jnjni in java.library.path
.

What's that ?

thank u
any help.

- Original Message -
From: Wade Chandler [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 3:05 PM
Subject: RE: tomcat jni configuration...


 Does your tomcat installation run fine?  i.e. in a standalone mode?

 Wade

 -Original Message-
 From: Tony [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2003 12:20 AM
 To: [EMAIL PROTECTED]
 Subject: tomcat jni configuration...


 hi,
 all


 i have a problem trying to configurate my apache 2.x with Tomcat 4 (jni
 using jk2)... everything looks fine when i initiate apache, but when i
 try to access the examples apps (localhost/examples) i got the following
 error on error.log (apache directory):

 Tue Dec 02 03:08:56 2003] [notice] Parent: Created child process 2480
 [Tue Dec 02 03:08:57 2003] [notice] Child 2480: Child process is running
 [Tue Dec 02 03:08:57 2003] [error] mod_jk child init 1 0 [Tue Dec 02
 03:08:57 2003] [notice] Child 2480: Acquired the start mutex. [Tue Dec
 02 03:08:57 2003] [notice] Child 2480: Starting 250 worker threads. [Tue
 Dec 02 03:15:16 2003] [error] channel_jni.open() Can't create java
 context [Tue Dec 02 03:15:16 2003] [error] channel_jni.send() no java
 context [Tue Dec 02 03:15:16 2003] [error] ajp13.service() Error
 forwarding ajp13:jni 1 0 [Tue Dec 02 03:15:16 2003] [error] lb.service()
 worker failed 12 for ajp13:jni [Tue Dec 02 03:15:16 2003] [error]
 lb_worker.service() all workers in error or disabled state [Tue Dec 02
 03:15:16 2003] [error] mod_jk.handler() Error connecting to tomcat
 12

 ...

 can anybody help me on this please ??

 my workers2.properties is as follows:



 [shm]
 file=C:/Apache2/logs/jk2.shm
 size=1048576


 [channel.jni:jni]


 [vm:]
 OPT=-Djava.class.path=C:/Tomcat/bin/tomcat-jni.jar;C:/Tomcat/server/lib/
 tomcat-jk2.jar;C:/Tomcat/server/lib/commons-logging.jar;C:/Tomcat/common
 /lib/commons-collections.jar;C:/Tomcat/common/lib/naming-common.jar;C:/T
 omcat/common/lib/naming-resources.jar;C:/Tomcat/server/lib/catalina.jar;
 C:/Tomcat/server/lib/commons-digester.jar;C:/TomCat/server/lib/commons-b
 eanutils.jar;C:/Tomcat/server/lib/mx4j-jmx.jar;C:/Tomcat/server/lib/comm
 ons-modeler.jar;C:/Tomcat/common/lib/servlet.jar;C:/Tomcat/server/lib/to
 mcat-http11.jar;C:/Tomcat/server/lib/servlets-invoker.jar;C:/Tomcat/serv
 er/lib/servlets-default.jar;C:/Tomcat/server/lib/servlets-webdav.jar;C:/
 Tomcat/server/lib/servlets-manager.jar;C:/Tomcat/server/lib/servlets-com
 mon.jar;c:/j2sdk/j2sdk1.4.2/lib/tools.jar;c:/tomcat/bin/BootStrap.jar;c:
 /tomcat/server/lib/tomcat-util.jar;c:/tomcat/server/lib/tomcat-coyote.ja
 r
 OPT=-Dtomcat.home=C:/Tomcat
 OPT=-Dcatalina.home=C:/Tomcat
 OPT=-Xmx128M


 [worker.jni:onStartup]
 class=org/apache/jk/apr/TomcatStarter
 ARG=start
 stdout=C:/apache2/logs/stdout.log
 stderr=C:/apache2/logs/stderr.log

 [worker.jni:onShutdown]
 class=org/apache/jk/apr/TomcatStarter
 ARG=stop

 [uri:/examples/*]

 [uri:/*]



 thanks for any help.
 []s.



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




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



RE: tomcat jni configuration...

2003-12-03 Thread Wade Chandler
Does your tomcat installation run fine?  i.e. in a standalone mode?

Wade

-Original Message-
From: Tony [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2003 12:20 AM
To: [EMAIL PROTECTED]
Subject: tomcat jni configuration...


hi,
all


i have a problem trying to configurate my apache 2.x with Tomcat 4 (jni
using jk2)... everything looks fine when i initiate apache, but when i
try to access the examples apps (localhost/examples) i got the following
error on error.log (apache directory):

Tue Dec 02 03:08:56 2003] [notice] Parent: Created child process 2480
[Tue Dec 02 03:08:57 2003] [notice] Child 2480: Child process is running
[Tue Dec 02 03:08:57 2003] [error] mod_jk child init 1 0 [Tue Dec 02
03:08:57 2003] [notice] Child 2480: Acquired the start mutex. [Tue Dec
02 03:08:57 2003] [notice] Child 2480: Starting 250 worker threads. [Tue
Dec 02 03:15:16 2003] [error] channel_jni.open() Can't create java
context [Tue Dec 02 03:15:16 2003] [error] channel_jni.send() no java
context [Tue Dec 02 03:15:16 2003] [error] ajp13.service() Error
forwarding ajp13:jni 1 0 [Tue Dec 02 03:15:16 2003] [error] lb.service()
worker failed 12 for ajp13:jni [Tue Dec 02 03:15:16 2003] [error]
lb_worker.service() all workers in error or disabled state [Tue Dec 02
03:15:16 2003] [error] mod_jk.handler() Error connecting to tomcat
12

...

can anybody help me on this please ??

my workers2.properties is as follows:



[shm] 
file=C:/Apache2/logs/jk2.shm 
size=1048576 


[channel.jni:jni] 


[vm:] 
OPT=-Djava.class.path=C:/Tomcat/bin/tomcat-jni.jar;C:/Tomcat/server/lib/
tomcat-jk2.jar;C:/Tomcat/server/lib/commons-logging.jar;C:/Tomcat/common
/lib/commons-collections.jar;C:/Tomcat/common/lib/naming-common.jar;C:/T
omcat/common/lib/naming-resources.jar;C:/Tomcat/server/lib/catalina.jar;
C:/Tomcat/server/lib/commons-digester.jar;C:/TomCat/server/lib/commons-b
eanutils.jar;C:/Tomcat/server/lib/mx4j-jmx.jar;C:/Tomcat/server/lib/comm
ons-modeler.jar;C:/Tomcat/common/lib/servlet.jar;C:/Tomcat/server/lib/to
mcat-http11.jar;C:/Tomcat/server/lib/servlets-invoker.jar;C:/Tomcat/serv
er/lib/servlets-default.jar;C:/Tomcat/server/lib/servlets-webdav.jar;C:/
Tomcat/server/lib/servlets-manager.jar;C:/Tomcat/server/lib/servlets-com
mon.jar;c:/j2sdk/j2sdk1.4.2/lib/tools.jar;c:/tomcat/bin/BootStrap.jar;c:
/tomcat/server/lib/tomcat-util.jar;c:/tomcat/server/lib/tomcat-coyote.ja
r
OPT=-Dtomcat.home=C:/Tomcat 
OPT=-Dcatalina.home=C:/Tomcat
OPT=-Xmx128M
 

[worker.jni:onStartup] 
class=org/apache/jk/apr/TomcatStarter 
ARG=start 
stdout=C:/apache2/logs/stdout.log 
stderr=C:/apache2/logs/stderr.log 

[worker.jni:onShutdown] 
class=org/apache/jk/apr/TomcatStarter 
ARG=stop 

[uri:/examples/*] 

[uri:/*] 



thanks for any help.
[]s.



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



tomcat jni configuration...

2003-12-01 Thread Tony
hi,
all


i have a problem trying to configurate my apache 2.x with Tomcat 4 (jni using jk2)...
everything looks fine when i initiate apache, but when i try to access the examples 
apps (localhost/examples) i got the following error on error.log (apache directory):

Tue Dec 02 03:08:56 2003] [notice] Parent: Created child process 2480
[Tue Dec 02 03:08:57 2003] [notice] Child 2480: Child process is running
[Tue Dec 02 03:08:57 2003] [error] mod_jk child init 1 0
[Tue Dec 02 03:08:57 2003] [notice] Child 2480: Acquired the start mutex.
[Tue Dec 02 03:08:57 2003] [notice] Child 2480: Starting 250 worker threads.
[Tue Dec 02 03:15:16 2003] [error] channel_jni.open() Can't create java context
[Tue Dec 02 03:15:16 2003] [error] channel_jni.send() no java context
[Tue Dec 02 03:15:16 2003] [error] ajp13.service() Error  forwarding ajp13:jni 1 0
[Tue Dec 02 03:15:16 2003] [error] lb.service() worker failed 12 for ajp13:jni
[Tue Dec 02 03:15:16 2003] [error] lb_worker.service() all workers in error or 
disabled state
[Tue Dec 02 03:15:16 2003] [error] mod_jk.handler() Error connecting to tomcat 12

...

can anybody help me on this please ??

my workers2.properties is as follows:



[shm] 
file=C:/Apache2/logs/jk2.shm 
size=1048576 


[channel.jni:jni] 


[vm:] 
OPT=-Djava.class.path=C:/Tomcat/bin/tomcat-jni.jar;C:/Tomcat/server/lib/tomcat-jk2.jar;C:/Tomcat/server/lib/commons-logging.jar;C:/Tomcat/common/lib/commons-collections.jar;C:/Tomcat/common/lib/naming-common.jar;C:/Tomcat/common/lib/naming-resources.jar;C:/Tomcat/server/lib/catalina.jar;C:/Tomcat/server/lib/commons-digester.jar;C:/TomCat/server/lib/commons-beanutils.jar;C:/Tomcat/server/lib/mx4j-jmx.jar;C:/Tomcat/server/lib/commons-modeler.jar;C:/Tomcat/common/lib/servlet.jar;C:/Tomcat/server/lib/tomcat-http11.jar;C:/Tomcat/server/lib/servlets-invoker.jar;C:/Tomcat/server/lib/servlets-default.jar;C:/Tomcat/server/lib/servlets-webdav.jar;C:/Tomcat/server/lib/servlets-manager.jar;C:/Tomcat/server/lib/servlets-common.jar;c:/j2sdk/j2sdk1.4.2/lib/tools.jar;c:/tomcat/bin/BootStrap.jar;c:/tomcat/server/lib/tomcat-util.jar;c:/tomcat/server/lib/tomcat-coyote.jar
OPT=-Dtomcat.home=C:/Tomcat 
OPT=-Dcatalina.home=C:/Tomcat
OPT=-Xmx128M
 

[worker.jni:onStartup] 
class=org/apache/jk/apr/TomcatStarter 
ARG=start 
stdout=C:/apache2/logs/stdout.log 
stderr=C:/apache2/logs/stderr.log 

[worker.jni:onShutdown] 
class=org/apache/jk/apr/TomcatStarter 
ARG=stop 

[uri:/examples/*] 

[uri:/*] 



thanks for any help.
[]s.


Tomcat - JNI

2003-07-08 Thread Altug B. Altintas
Hi, 

i am using  Tomcat 4.1.24 and in our web application we use JNI like
below

static
{
  System.loadLibrary(optimizer_dll);
}

optimizer_dll.dll resides in c:\code\bin; This path is also in the the
PATH environment 
When i start Tomcat, every think is fine but after some times passes,
tomcat gives error like below

dll is already loaded in another classloader 

I searched that error on the web  and i found that this : 



Applications that require native libraries must ensure that the
libraries have
been loaded prior to use.  Typically, this is done with a call like:

  static {
System.loadLibrary(path-to-library-file);
  }

in some class.  However, the application must also ensure that the
library is
not loaded more than once.  If the above code were placed in a class
inside
the web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and
the
application were reloaded, the loadLibrary() call would be attempted a
second
time.

To avoid this problem, place classes that load native libraries outside
of the
web application, and ensure that the loadLibrary() call is executed only
once
during the lifetime of a particular JVM.



I think this can't be the ideal solution, any idea about this problem ? 

Regards


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



tomcat+jni+apache1.3?

2002-03-31 Thread Adam Megacz


Is it possible to use the JNI connector with Apache 1.3? I've read
that the JNI connector requires a threaded web server, and that
Apache1.3 isn't threaded (but 2.0 is).

If it's not possible, can anyone recommend a fairly stable version of
Apache 2.0?

  - a

-- 
The web is dead; long live the Internet.
http://www.xwt.org/

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Tomcat+JNI+Embedded SQL won't work for me

2001-05-07 Thread Simon A. Crase

Help!
I am trying to access some embedded SQL from Java Server pages - basically
jsp+Tomcat calling beans, which go through JNI to call embedded SQL
(Unify) - which in turn has been translated to C and compiled into a shared
object (Linux).

Everything works fine without jsp  Tomcat - I have tested the beans out
using Junit - www.junit.org.  Unfortunately the code does not work at all
with Tomcat 3.0.  I have established that the C code is running OK, and that
has been passed all the environment variables that the embedded SQL expects.
I think that the embedded SQL involves spawning another process - maybe JNI
isn't allowed to do this under Tomcat?


Any help apprciated.


Regards,


Simon Crase




Tomcat + JNI problem

2001-02-02 Thread Manoj Thakur

Hello Amandeep,

Hope you can help me. I am running Tomcat version 3.1 on HPUX 11.0 with
Apache.

What I am trying to do is invoke a C function (using JNI) from a
servlet. The C function is compiled into a shared library.

Now, if I write a simple JAVA application, use JNI and execute the C
function, everything works file. But, then if I change it from being an
application to a servlet, then it fails. Also, the reason is not that it
is not able to find and load the library (as if I remove the library or
rename it, it gives an error indicating it was unable to load the
library). But, the error indicates it was unable to locate the method
that I am trying to invoke. In fact, going through the getMethods
function, I listed all the methods loaded and available for the class,
and the native C function is also listed as one of the functions that
can be called. But, that may just be because the native C function is
listed in the class definition as per JNI requirements.

Your email is the first one where I know that somebody has successfully
implemented JNI in a servlet. Could you share if you had any problems in
your effort. Also, if you could take a few minutes, I could email you my
test example (a very simple login example) to take a look if I am
missing something obvious.

Regards and Thanks in advance
-- Manoj Thakur

 
 To: [EMAIL PROTECTED] 
 Subject: Can I set LD_LIBRARY_PATH for each virtual host 
 From: "Amandeep Jawa" [EMAIL PROTECTED] 
 Date: Tue, 17 Oct 2000 17:33:24 -0700 
 Delivered-To: mailing list [EMAIL PROTECTED] 
 list-help: mailto:[EMAIL PROTECTED] 
 list-post: mailto:[EMAIL PROTECTED] 
 list-unsubscribe: mailto:[EMAIL PROTECTED] 
 Mailing-List: contact [EMAIL PROTECTED]; run by
ezmlm 
 Organization: Imagelock, Inc. 
 Reply-To: [EMAIL PROTECTED] 
 Reply-To: "Amandeep Jawa" [EMAIL PROTECTED] 
 
 
 
 Hi folks -
 
 For JNI purposes I have to have LD_LIBRARY_PATH set for my servlets.
My
 servlets seem to be able to make simple C calls so everything is Ok so
far.
 The problem is that I am setting the library path for the entire
tomcat
 installation when I'd really like to set it per virtual host or per
servlet
 context in server.xml.
 
 Does anyone know how to do this?
 
 Sorry if this is a well known solution but the FAQ is down which seems
to be
 pretty common!
 
 'deep
 
 
 --
 Amandeep Jawa
 Imagelock, Inc.
 --
 [EMAIL PROTECTED]
 1725 Montgomery St
 San Francisco CA 94111
 
 Work: 415 616 7262 (616 SAMBA)
 Fax: 415 392 5382
 
 http://www.imagelock.com

Manoj Thakur
Email: [EMAIL PROTECTED]
Work: +1 856 866 1000 x4166
Fax:   +1 856 866 0185

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




Tomcat, JNI and HP-UX

2000-12-05 Thread Eric Lee (LYN) (EUS)
Title: Tomcat, JNI and HP-UX





I am using Tomcat 3.1 on HP-UX 10.20 with Java version (HP-UX Java C.01.18.03 05/12/2000 16:31:36 hkhd02) I am attempting to use a servlet that instantiates a class that contains JNI methods and I keep getting java.lang.UnsatisfiedLinkError exceptions when these native methods are accessed. The JNI methods execute fine from the command line with Java interpreter, I also know that the servlet is loading the shared library. There are similar postings in the mailing list archives but they are without response. If anyone has any comments, I sure would appreciate them.

Many Thanks, 
Eric Lee





RE: Tomcat, JNI and HP-UX

2000-12-05 Thread Russell Freeman
Title: Tomcat, JNI and HP-UX



I have 
some tips from experience with both Win32 and AIX platforms. I'm assuming that 
HP UK C dynamic link libraries are built similar to AIX 
ones...?

- JDK 
1.18 uses JNI version 1.0 bindings by default. Use the -jni option with javah to 
create a JNI 1.1 style C headers. These are easier to link 
with.
- Make 
sure you use the generated header for the basis of the function implementation 
(rather than copying by hand). This will ensure you get the function header 
exactly right. 
- The 
unsatified link exception can occur for many reasons: the library is not found 
(not on the LIBPATH for instance), the method wasn't resolved (not exported or 
wrong signature in C)

Given 
the following java class with natic methods:


package a.b;

public 
class c {
 public native void doSomething() 
{}
 public native void doSomethingElse() 
{}
}

You 
will need an export file with your so/shared library/DLL containing the mangled 
function prototypes, For example, in foo.exp ( the export file for the 
library foo.so ) I have: -

Java_a_b_c_doSomething

Java_a_b_c_doSomethingElse

This is the JNI 1.1 C export for the above 
java code.

  -Original Message-From: Eric Lee (LYN) (EUS) 
  [mailto:[EMAIL PROTECTED]]Sent: 05 December 2000 
  14:45To: '[EMAIL PROTECTED]'Subject: 
  Tomcat, JNI and HP-UX
  I am using Tomcat 3.1 on HP-UX 10.20 with Java 
  version ("HP-UX Java C.01.18.03 05/12/2000 16:31:36 hkhd02") I am attempting 
  to use a servlet that instantiates a class that contains JNI methods and I 
  keep getting java.lang.UnsatisfiedLinkError exceptions when these native 
  methods are accessed. The JNI methods execute fine from the command line with 
  Java interpreter, I also know that the servlet is loading the shared 
  library. There are similar postings in the mailing list archives but 
  they are without response. If anyone has any comments, I sure would 
  appreciate them.
  Many Thanks, 
  Eric Lee 



RE: Tomcat, JNI and HP-UX

2000-12-05 Thread Russell Freeman

I have some tips from experience with both Win32 and AIX platforms. I'm
assuming that HP UK C dynamic link libraries are built similar to AIX
ones...?

- JDK 1.18 uses JNI version 1.0 bindings by default. Use the -jni option
with javah to create a JNI 1.1 style C headers. These are easier to link
with.
- Make sure you use the generated header for the basis of the function
implementation (rather than copying by hand). This will ensure you get the
function header exactly right. 
- The unsatified link exception can occur for many reasons: the library is
not found (not on the LIBPATH for instance), the method wasn't resolved (not
exported or wrong signature in C)
 
Given the following java class with natic methods:
 
package  a.b;
 
public class c {
   public native void doSomething() {} 
   public native void doSomethingElse() {} 
}
 
You will need an export file with your so/shared library/DLL containing the
mangled function prototypes, For example, in foo.exp ( the export file for
the library foo.so ) I have: -
 
Java_a_b_c_doSomething
Java_a_b_c_doSomethingElse
 
This is the JNI 1.1 C export for the above java code.



Tomcat + JNI -- Help!

2000-11-20 Thread Michael Cohen (ETL)

 Hi,
 
 I have just installed Apache1.3.14 + modssl + tomcat 3.2b5 on 
 Solaris 2.6 and am trying to call a native method from my servlet 
 (this worked fine under JavaWebServer2.0).
 
 The shared library is definitely being loaded (ie no exception is 
 thrown when I tried to load it separately, the lib is on the 
 LD_LIBRARY_PATH etc) but "UnsatisfiedLinkError"
 is still being thrown indicating the implementation of  the 
 native method is not found.
 
 Has anyone come across anything like this?
 
Many thanks,

Mike.




Tomcat + JNI

2000-11-17 Thread Michael Cohen (ETL)

Hi,

I have just installed Apache1.3.14 + modssl + tomcat 3.2b5 on Solaris 2.6 
and am trying to call a native method from my servlet (this worked fine 
under JavaWebServer2.0).

The shared library is definitely being loaded (ie no exception is thrown when I tried
to load it separately, the lib is on the LD_LIBRARY_PATH etc) but 
"UnsatisfiedLinkError"
is still being thrown indicating the implementation of  the native method is not
found.

I havent done anything special to tomcat for JNI, I was a bit baffled by the purpose
jni_server.xml and jni_workers.properties files! I only need to call a C program from
within a class called by the servlet, don't need to call java methods from the native
code. 

Has anyone come across anything like this?

Many thanks,

Mike.