httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhi Qing Wu <>
Subject Apache and CLASSPATH
Date Tue, 14 Sep 2004 18:52:05 GMT

I met a strange error when I developed a module for

Since I would use gcj in writing the module, I wrote
two test programs (a JAVA program and a C program, the
C program calls the Java class, see the attachments
java2.cpp and, ) before writing the
module. I compiled two test programs with gcc and
(Main procedures:
   gcc java2.cpp -o java2 -lgcj -lstdc++
   javac single/
and set CLASSPATH to the path of Sigclass.class before
running the C program. There are no errors in
compilation and execution. Its output is correct.

However, if I copied main code in the C program to the
apache module (wrote in GCJ C, no errors occur in
compilation, see mod_permis.cpp) and ran the apache
without changing CLASSPATH.

An error occurs in the error_log of the apache:
Unhandled Java exception:
java.lang.ClassNotFoundException: single.Sigclass not
found in
[file:/home/zhiqing/make/example3, file:./, core:/]

The path "file:/home/zhiqing/make/example3" is the
CLASSPATH for Sigclass. It is strange that the
computer can not find the class in the path.

Someone told me that after Apache is started, the path
of the file will be mapped to an Internet address,
which probably causes the CLASSPATH invalid. Some
parameters of Apache may also have influence on the

I wonder if it is possible to change the CLASSPATH or
relevant parameters (or environment variables) of
Apache to get rid of the error.

The Apache in my computer is version 1.3.29. The
Apache and the C program are compiled with gcc 3.3.2.

Any advice or suggestion would be appreciated.

Zhi Qing

___________________________________________________________ALL-NEW Yahoo! Messenger - all
new features - even more fun!
View raw message