----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I presume you've debugged your JNI class in a stand-alone 
environment?  What happens when you invoke your JNI stuff multiple times in 
that setting?

If those simple strategies don't get you anywhere, I would suggest that you 
contrive a debugging test harness that simulates the servlet environment -- 
in fact, it's not too tough to invoke the servlet directly by implementing 
your own very minimal context, request and response objects.  Good luck.

- Fernando

At 11:45 AM 1/7/00 +0000, you wrote:


>I'm resending my request for help with a little more information (and also
>becase it's imperative I sort it out, and I'm running out of ideas). I've
>checked the FAQ and the archives and though there are several items about
>JNI and about class loaders, none of the suggestions I have found have made
>any difference (they mostly involved CLASSPATH settings and the location of
>the .DLLs and .classes, but I think we are OK with this, as other servlets
>using JNI work fine, and we are not using the JSDK custom class loader
>(though we have tried it)).
>
>Here's my (slightly modified) original post.
>
>Apache 1.3.9
>Jserv   1.0
>Windows NT 4.0 Sp5
>Borland JDK from JBuilder 3  [ java -version gives: Classic VM (build
>JDK-1.2-V, native threads) ]
>JSDK 2.0
>
>The following is the jserv log after apache is started:
>
>[07/01/2000 10:13:43:934 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:13:43:934 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:13:43:994 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:13:43:994 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:13:44:004 GMT] Creating Servlet Zones
>
>
>
>We have a servlet that imports a java class that loads a JNI DLL.
>
>The DLL is written in visual C++ 6 SP3. It exposes a couple of methods
>whose signatures were generated by javah. The DLL was implemented as a
>wrapper to allow
>us to invoke several COM components written Visual Basic 6 Sp3.
>
>We can invoke the servlet once, and it works.
>
>After performing the first invocation the log is as follows
>
>[07/01/2000 10:13:43:934 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:13:43:934 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:13:43:994 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:13:43:994 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:13:44:004 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>
> >From the log above, you will see that we are implementing SingleThreadModel,
>and jserv inits five instances of the servlet. We have tried removing the
>SingleThreadModel so that Apache does not pool, and the same thing still
>occurs, except that the log only shows one instance of the servlet.
>
>The second time the servlet is invoked, it succesfully  completes all of its
>processing (including succesfully executing the C++ and VB code), then
>throws an access violation.
>
>At this point, the client is displaying the output from the servlet, and the
>server is displaying the access violation. This happens whether or not the
>second invocation comes from the same client session.
>
>The exact error is as follows:
>
>Java.exe - Application error
>The instruction at "0x660d48ed" referenced memory at "0x052a608c". The
>memory could not be read.
>
>The jserv log is now:
>
>[07/01/2000 10:13:43:934 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:13:43:934 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:13:43:994 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:13:43:994 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:13:44:004 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:14:28:548 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:14:28:548 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:14:28:588 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:14:28:598 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:14:28:598 GMT] Creating Servlet Zones
>
> >From this log it looks like jserv is being restarted, and indeed we can now
>invoke the servlet a third time (successfully this time) giving a log of:
>
>[07/01/2000 10:13:43:934 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:13:43:934 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:13:43:994 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:13:43:994 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:13:44:004 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:14:28:548 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:14:28:548 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:14:28:588 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:14:28:598 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:14:28:598 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>
>Invoking a fourth time gives the error, and a log of:
>
>[07/01/2000 10:13:43:934 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:13:43:934 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:13:43:994 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:13:43:994 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:13:44:004 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:14:28:548 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:14:28:548 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:14:28:588 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:14:28:598 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:14:28:598 GMT] Creating Servlet Zones
>[07/01/2000 10:13:59:556 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:13:59:576 GMT] com.KMSPLC.KMSSearch: init
>[07/01/2000 10:14:28:548 GMT] ApacheJServ/1.0 is starting...
>[07/01/2000 10:14:28:548 GMT] WARNING: connection authentication is disabled
>[07/01/2000 10:14:28:588 GMT] Connection allowed from localhost/127.0.0.1
>[07/01/2000 10:14:28:598 GMT] Listening on port 8007 accepting 50 maximum
>connections
>[07/01/2000 10:14:28:598 GMT] Creating Servlet Zones
>
>
>I suspect that apache is detecting that a loadable module (jserv) has failed
>and is reloading it.
>
>
>
>Attaching visual studio to the java process reveals that 0x660d48ed is
>an instruction within MSVBVM60.DLL.
>
>This sounds like a Microsoft problem, but the vb code has been running on
>several
>hundred sites for six months without a single problem occuring. We also
>invoke the VB from VC in our existing systems in exactly the same way that
>the JNI dll is invoking it, again with no problem.
>
>Strangely, we have another DLL that also invokes some VB methods (some of
>them even in the same VB DLLs as in the problem), but we can invoke this
>from a servlet with no trouble at all.
>
>This, again implies that it is an MS problem. However, I'm throwing myself
>at your mercy,because, frankly, I rather suspect there will be more people
>here with a deeper understanding (and even if the problem occurs in
>MSVNVM60.DLL, it does only occur when invoked from a servlet).
>
>Should I try jserv 1.1b3?
>
>Any help with this issue would be greatly appreciated, it is becoming a
>major show stopper on our project.
>
>Thanks in advance.
>
>Phil Lewis
>Chief Designer
>Knowledge Management Software plc
>[EMAIL PROTECTED]
>


=======================================
Fernando Salazar <[EMAIL PROTECTED]>
w -781-392-2514


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to