Hi all,
I'm new to this list, and I'm having a problem configuring Cactus
to work with Resin. I apologize if this is an obvious problem, but
from my reading of the docs, I was a little unclear on how things
worked.
I'm using Cactus 1.0, Resin 1.2.3, and Sun's 1.3.1 JVM running on
Redhat 6.2. I'm also using Apache and mod_caucho as a front end
to Resin. (I tried Cactus 1.1, but that didn't change anything).
My application is not using WARs or web.xml; instead, all my classes
are simply located in the server application directory, which is
set by resin's <http-server><app-dir> tags in resin.conf.
Up until recently, I've had everything working just fine. However,
Resin did not notice when I changed .class files, and I needed to
stop and restart Resin every time something changed. It turned out
that this was because the above directory was listed in my CLASSPATH
as well as resin's <http-server><app-dir> parameter. Taking the
directory out of the classpath solved the problem, which makes sense,
because Resin was treating it as a system class.
Unfortunately, this caused Cactus to stop working. It fails with
java.lang.ClassNotFound exceptions, like the following:
% java atlantes.command.TestUpdatePassword
TestUpdatePassword:
1..2
not ok 1 testNoParams(atlantes.command.TestUpdatePassword)
There were 2 errors:
1) testNoParams(atlantes.command.TestUpdatePassword)
java.lang.ClassNotFoundException: atlantes.command.TestUpdatePassword
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
org.apache.commons.cactus.server.ServletTestCaller.callTestMethod(ServletTestCaller.java:102)
at
org.apache.commons.cactus.server.ServletTestCaller.doTest(ServletTestCaller.java:200)
at
org.apache.commons.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:149)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:83)
at com.caucho.server.http.Invocation.service(Invocation.java:296)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333)
at
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
...
>From reading the cactus documentation, it seems as though having the
test classes be in <app-dir> but not the actual CLASSPATH environment
variable should be sufficient. The directory is in my
client-side CLASSPATH, but I would think that that is irrelevant, since
the request is obviously getting to the server. Also that cactus.properties is
in <app-dir>, but not CLASSPATH.
However, from looking at the stack trace, I'm guessing that cactus is using
the java class loader and not the caucho class loader, and so it won't know
about the <app-dir> location. I could be wrong, obviously.
Surely this should work, and I'm just missing something obvious, but what?
Thanks in advance,
-- Dirk
Dirk Pranke
Senior Software Engineer
Atlantes Services, Inc.
405 El Camino Real, #227
Menlo Park, CA 94025
phone: 650-330-2310
fax: 650-329-1851
http://www.atlantes.com
"A Smart Place"
RemoteLOGIC, Atlantes, SmartROOM, SmartCABINET, SmartJET, SmartTRUCK,
SmartRETURN, SmartPICKUP, and "A Smart Place" are trademarks of Atlantes
Services, Inc.
This message and any attachments are intended only for the recipient(s)
named above and may contain information that is confidential. If you
are not an intended recipient, do not copy, use or disclose this
communication. Please notify the sender by replying to this message,
delete it and destroy all copies. Thank you.