Body encoding problem with TC 5.0.18 alpha

2004-01-18 Thread olaf . hahnl
I have a problem with Tomcat 5, which might turn out to be a bug.

I just send a page (with UTF-8 encoding) from my servlet which contains
some special characters (in this case ° and §) in the value for a hidden
form field (see example below).
Requesting the content with IE 6 or Mozilla 1.5 through a tunnel from TC
4.1.19 I am seeing the following (special characters are encoded in two
characters) and everything works just fine in the browser. Using TC 5.0.16
or 5.0.18 alpha the special characters are sent as they would when being
ISO-encoded I believe. The browser tries to interpret the page and the
special characters as UTF-8, so nothing works and the page-functionality
breaks. If I manually switch the encoding in the browser to ISO, it works
again.

So my question is, was there any intentional change in between TC 4.1 and
TC5 regarding this issue, is this an already known problem or could this be
a bug, or a fault on my side?

I tried to search the archives and found quite a lot which deals with
character encoding, but nothing which seem to match, I apologize if I
missed something.

Any help is appreciated.

Regards,
Olaf


Example:

Tomcat 4.1.19

Content-Type: text/html;charset=UTF-8

html
...
input type=hidden name=TEMPLATELIST value=DE=1§Demo°
...
/html

Tomcat 5.0.18 Alpha

Content-Type: text/html;charset=UTF-8

html
...
input type=hidden name=TEMPLATELIST value=DE=1§Demo°
...
/html


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



First version of JK2 Domino connector and more questions about JNI-mode

2003-01-03 Thread olaf . hahnl

I am leaving for a one week holiday and wanted to share the first
beta-version of the JK2 Domino connector with you.

I am not familiar with the Apache coding guidlines etc., it is just for you
who are interested in this and are more experienced than I am, to have a
look at the code, and to comment on it. There are some parts where I am not
sure about the function which I marked with a comment and some ???. Most of
it I mentioned in my first mail to this list.

To compile it without having the Domino C-API, one have to define the
symbol NO_CAPI.


I just tested it with JNI mode, which I need for my own projects and
discoverd a few things/problems I like to mention here. I am not sure if
these are specific to flaws in my code or to misconfiguration of the
config-file (see below) or to the way the JNI-mode works. First of all, all
the servlet and JSP examples provided with TC worked quite well. Because of
the problems with JNI-mode and Domino 6 (see my last few mails) I solely
worked with Domino 5.0.11 on Windows, but in the future the filter should
also work under Linux etc.

Then I tested one of my own web-apps and got astonishing results, nothings
works! I was able to reduce the problem to the following configuration: In
a simple servlet I tried to set up commons-logging 1.0.2 to work together
with log4j 1.2.7. I could not achive this in JNI mode and always got this
error

java.lang.NoClassDefFoundError: org/apache/log4j/Layout
  at
org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:153)
  at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
  at TestServlet.clinit(TestServlet.java:23)

Commons-logging and log4j are only in the web-app's lib-directory. To make
it worse the same thing is working as expected without any modifications
when TC is started as a seperate process using the startup batch file and
accessed using HTTP1.1 connector. Log4j alone work quite a nice as well and
using the old JK connector it also works quite well.

My thought is that it has something to do with classloaders and/or the VM
is intialized with different options. As I looked for the system-properties
I saw that they are quite dfferent in the two situations. Any thoughts
regarding this problem?

My workers2.properties lookes like this for the VM initialization

[vm:]
info=Parameters used to load a JVM in the server process
OPT=-Djava.class.path=${CATALINA_HOME}/bin/tomcat-jni.jar;
OPT=-Djava.io.tmpdir=${CATALINA_HOME}/temp
OPT=-Dcatalina.home=${CATALINA_HOME}
OPT=-Duser.dir=${CATALINA_HOME}/bin
OPT=-Xmx128M

Comments on both issues are welcome!

Olaf

(See attached file: dsapi2.zip)



dsapi2.zip
Description: Zip archive
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


RE: First version of JK2 Domino connector and more questions about JNI-mode

2003-01-03 Thread olaf . hahnl

Mladen Turk [EMAIL PROTECTED] wrote on 03.01.2003 13:00:15:


 Great news!

 
  My workers2.properties lookes like this for the VM initialization
 
  [vm:]
  info=Parameters used to load a JVM in the server process
  OPT=-Djava.class.path=${CATALINA_HOME}/bin/tomcat-jni.jar;

 Try using the folwing instead OPT=-Djava.class.path=

 classpath=${TOMCAT_HOME}/bin/tomcat-jni.jar
 classpath=${TOMCAT_HOME}/server/lib/commons-logging.jar

Do you mean in the workers2.properties like this

[vm:]
info=Parameters used to load a JVM in the server process
classpath=${TOMCAT_HOME}/bin/tomcat-jni.jar
classpath=${TOMCAT_HOME}/server/lib/commons-logging.jar

or in the system-environment? I will try this when I am back.

 Can DSAPI be tested with Domino 6 trial version?


As far as I know, there should be no problem with this, but I am not sure
what the limitation of the trial version is or if there is a technical
limitation at all or just a license issue.

But be reminded to the jvm problem I have with Domino 6, but perhaps you
are able to include the suggested fix/code to attach to an already running
jvm or test other connection methods.

If there are questions fell free to ask. I like to hear news when I am back
from the short holiday.

 MT.

Olaf



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




RE: Questions related to a port of the IIS-connector to Domino I plan toprovide

2002-12-31 Thread olaf . hahnl


Mladen Turk [EMAIL PROTECTED] wrote on 30.12.2002 19:25:01:

  
   Looks to me like that you are using the wrong JVM.
  
  The strange thing is, that this only happens when using
  Domino 6 and not when using Domino 5 with the same JVM path
  and DSAPI filter. I extracted the relevant code from
  'jk_jni_worker.c' and found the mentioned JNI_CreateJavaVM
  call to be the problem. I tried it with JDK/JRE 1.3.1_06 and
  JDK/JRE 1.4.1_01 and got the same results :( Can there be any
  class-path or system-path related issues, which might be
  handled different from Domino 5 to 6? Any other ideas or hints?
 

 Seems that Domino 6 is using its own JVM (think that the one (IBM 1.3.1)
 comes with installation) and you have collision problem cause you are
 loading another JVM in the process.

You are right, from the Domino 6 Java directory and the jvm.dll I got this
string J2RE 1.3.1 IBM Windows 32 build cn131-20020515. Domino 5.0.11 has
a javai.dll with the version string 1.1.8_008_Iris in it.

 There could be a problem with that if Domino already loads JVM, cause
 you can load JVM only once per process.  We'll need to change some calls
 to JNI to attach to already created JVM. I'll try to do that (for JK2).

Ok, I understand what the problem is most likely. If I try to load the JVM
of Domino 6 I get the 'error', that the JVM already exists. If one would
use this JVM, the problem is that you may not have any or at least
restricted control over startup options (see below) and if, they must be
specified in notes.ini for example as JavaUserClasses with a limit of 255
chars. And what might be a problem too is that you are bound to the JDK
version which is delivered with Domino. But it would be much better this
way than not be able to use it at all, so I would appreciate! if you could
do/integrate this. (See below some code I would suggest for the problem of
discovering a loaded JVM for windows, what do you think?)

I looked into the documentation of notes.ini variables which allow to
configure the included JVM. There seems to be no documented way to set
custom options like -Dtomcat-home=... and so on. On the other hand you can
set the classpath and heap/stack sizes (for reference see
http://www-10.lotus.com/ldd/today.nsf/54dd141eed99bf278525697a00561a66/e94d1b96f50fce5685256af6006299da?OpenDocument
 and
http://www-10.lotus.com/ldd/today.nsf/54dd141eed99bf278525697a00561a66/2d5fefbb437a00256c410047a793?OpenDocument)

By the way: I changed my test code to create a JVM based on a JDK 1.1.8
which I have installed on my machine. That worked without any problems, but
obviously gets me nowhere. On the other hand under Domino 5 a JVM is also
already loaded when the connector is creating another JVM, but perhaps the
Domino JVM 1.1.8 is more forgiving.

 Do you have some tools (like Process Explorer from SysInternals?) so you
 can tell if the JVM is already loaded and what is the version.

I used Process Explorer and found what I described in the sections above.
Domino 6 loads the JVM in Lotus\Domino\jvm\bin but Domino 5 loads JVM
(javai.dll) in its programm directory as well.

 MT.

Olaf

This code enumerates all moduls loaded by a process and if jvm.dll is found
gives back the complete path and filename. I have tested it shortly and it
did the job for me very well.

static char* findAlreadyLoadedJVM()
{
  static char jvm[MAX_PATH+1];
  HANDLE hSnapshot;
  MODULEENTRY32 lpme;
  BOOL err;

  // Create snapshot for all moduls loaded by the current process
  hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
  lpme.dwSize = sizeof(MODULEENTRY32);

  err = Module32First(hSnapshot, lpme);
  while (err)
  {
// compare if modul-name is a loaded JVM
if (_stricmp(jvm.dll, lpme.szModule) == 0)
{
  // copy path and file-name, close handle and return jvm
  strcpy(jvm, lpme.szExePath);
  CloseHandle(hSnapshot);
  return jvm;
}
err = Module32Next(hSnapshot, lpme);
  }
  CloseHandle(hSnapshot);

  // no loaded JVM found
  return NULL;
}



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




RE: Questions related to a port of the IIS-connector to Domino I plan toprovide

2002-12-30 Thread olaf . hahnl

Mladen Turk [EMAIL PROTECTED] wrote on 30.12.2002 08:02:13:

 Good, so if there is DSAPI, there shuld't be problems :).
I think so and I am making progress, but hope someone can help me further
with questions 2 and 3 :)


  For the moment I work with 5.0 for the following reasons.
  Many organizations I work with have and will have Domino 5
  servers around for quite some time and because I do have a
  problem with the old jk1 connector with Domino 6. It produces
  the following two errors during execution of the
  JNI_CreateJavaVM call in jk_jni_worker.c - 'Entry point for
  procedure  _JVM_GetCPMethodNameUTF@12 in DLL jvm.dll
  could not be found' and afterwards 'Entry point for procedure
  _JVM_SupportsCX8@0 in DLL jvm.dll could not be found'. I
  am not sure what causes the errors but I think it Domino 6
  because with Domino 5 there are no problems at all. Any suggestions?
 

 Looks to me like that you are using the wrong JVM.

The strange thing is, that this only happens when using Domino 6 and not
when using Domino 5 with the same JVM path and DSAPI filter. I extracted
the relevant code from 'jk_jni_worker.c' and found the mentioned
JNI_CreateJavaVM call to be the problem. I tried it with JDK/JRE 1.3.1_06
and JDK/JRE 1.4.1_01 and got the same results :( Can there be any
class-path or system-path related issues, which might be handled different
from Domino 5 to 6? Any other ideas or hints?


 MT.

Olaf



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




Questions related to a port of the IIS-connector to Domino I plan toprovide

2002-12-29 Thread olaf . hahnl
I am working on a port of the jk2 connector to Domino based on the iis
connector. Perhaps it can be included in the normal release later, for now
I have some questions which should get me nearer to first beta release of
the Domino connector.
By the way I am working with TC 4.1.18 JDK 1.3.1_06 and/or 1.4.1_01 on
Windows 2000 Workstation.

I am gratefull for any advice, because I am new to most of this.

Best regards,
Olaf Hahnl


1. How can I use JSPs when using the JK2 JNI-mode. I always get the
message, that no JAVAC could be found and I should set the JAVA_HOME
variable.
Message is:
Unable to find a javac compiler;
  com.sun.tools.javac.Main is not on the classpath.
Under windows JNI-mode uses an available JRE (location read from the
registry) and to my knowledge there is never a javac or tools.jar in any
JRE. I can only solve this, if I disable the #ifdef WIN32 surrounding the
function jk2_vm_guessJvmDll in jk_vm_default.c, which means use the
JAVA_HOME variable to discover a JDK. I also have to add
${JAVA_HOME}/lib/tools.jar to the OPT=-Djava.class.path= parameter in
worker2.properties.
Is there another way to execute JSPs with in-process execution of TC, am I
missing something, or should one change the discovery-method under windows
to first use the JAVA_HOME variable and if not set, fall back to the
registry process?

2. In the jk_isapi_plugin.c in HttpFilterProc there is a point where a url
header with the path and name of the connector-dll is set !SetHeader(pfc,
url, extension_uri)). For what is this used and how should I handle this.
I have not found anything which relies an this?

3. In jk_service_iis.c there is a function char *
jk2_service_iis_get_roles(jk_env_t *env, jk_ws_service_t *s) which I do not
understand. What does this one achieve, is it for a kind of SSO?





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




RE: Questions related to a port of the IIS-connector to Domino I plan toprovide

2002-12-29 Thread olaf . hahnl



Mladen Turk [EMAIL PROTECTED] wrote on 29.12.2002 17:48:40:



  -Original Message-
  From: [EMAIL PROTECTED]
  Sent: Sunday, December 29, 2002 2:35 PM
  To: [EMAIL PROTECTED]
  Subject: Questions related to a port of the IIS-connector to
  Domino I plan to provide
 

 What version of Domino?
 Think that new 6.0 is all JAVA based (but not sure), and I don't think
 there is DSAPI any more.
 If the IBM makes the old 5.0 code as public domain ;-), then it would
 make sense.

You are right the actual version is Domino 6.0, but the core is all C and
C++ code with no Java at all. The DSAPI interface is vastly expanded in
Domino 6 and is used by the connector to IBM WebSphere too. Domino's
servlet environment is at servlet-api level 2.0 and does not support JSPs
at all, so for me and perhaps others there is a strong need to integrate
TC.

For the moment I work with 5.0 for the following reasons. Many
organizations I work with have and will have Domino 5 servers around for
quite some time and because I do have a problem with the old jk1 connector
with Domino 6. It produces the following two errors during execution of the
JNI_CreateJavaVM call in jk_jni_worker.c - 'Entry point for procedure 
_JVM_GetCPMethodNameUTF@12 in DLL jvm.dll could not be found' and
afterwards 'Entry point for procedure _JVM_SupportsCX8@0 in DLL jvm.dll
could not be found'. I am not sure what causes the errors but I think it
Domino 6 because with Domino 5 there are no problems at all. Any
suggestions?


  I am working on a port of the jk2 connector to Domino based
 
  1. How can I use JSPs when using the JK2 JNI-mode. I always
  get the message, that no JAVAC could be found and I should
  set the JAVA_HOME variable. Message is: Unable to find a
  javac compiler;
com.sun.tools.javac.Main is not on the classpath.

 You'll need to copy tools.jar to the TC/common/lib directory if you wish
 to use JSP. It's done by the TC setup program for you.

Thank You for the hint, my fault, so question 1 is solved.

 MT.



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