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

Any opinions expressed in this email are those of the individual and not necessarily 
Knowledge Management Software plc.  This email and any files transmitted with it are 
confidential and solely for the use of the intended recipient.
If you are not the intended recipient or the person responsible for delivering to the 
intended recipient, be advised that you have received this email in error and that any 
use is strictly prohibited.  If you have received this email in error please notify 
the Systems Manager by telephone on 44 (0) 161 227 9009


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