jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: Log4j problem with Cactus on J2EE RI server
Date Wed, 22 Jan 2003 11:20:01 GMT
Vincent Massol wrote:
> Hi Stuart,
> 
> Hum. Your server side configuration seems ok. I reckon you are using
> your browser to run the tests by calling the ServletTestRunner. The
> ServletTestRunner calls the System.setProperty() method to set up some
> system properties, and I remember Chris Lenz saying that this was
> "forbidden" in the J2EE RI (i.e. it would throw a SecurityManager
> exception).
> 
> You have 2 solutions to overcome this:
> 
> 1/ edit the security policy file and allow calls to System.setProperty()
> 
> 2/ use Cactus 1.5dev (use a nightly build as it is not released yet) AND
> provide a cactus.properties file in your WEB-INF/classes directory
> (defining the contextURL). (see
> http://jakarta.apache.org/cactus/1.5dev/changes.html#release_changes)
> 
> Note: Using 2/ you will also benefit from server side XSLT if you wish.

I haven't yet found a way to execute the ServletTestRunner on J2EE-RI 
yet, because Cactus uses system properties on the client side to 
communicate the contextURL and other config options. The fix I checked 
in doesn't help, as I noticed later :-(

But that doesn't relate to any of the redirectors, which work without 
requiring system properties.

> I'm not sure what the log4j problem is. Maybe the log4j jar is present
> up in the classloader hierarchy?

I also haven't got Log4J to work under J2EE-RI. Some very weird stuff, 
and I gave up and used the SimpleLog (ouch) for that project (which was 
just educational, so no big problem).

> -Vincent
> 
> 
>>-----Original Message-----
>>From: Stuart Johnson [mailto:Stuart.Johnson@fdmgroup.com]
>>Sent: 21 January 2003 16:27
>>To: cactus-user@jakarta.apache.org
>>Subject: Log4j problem with Cactus on J2EE RI server
>>
>>Hi,
>>
>>I've just completed the 20 minute quickstart on Tomcat, and everything
>>works
>>fine, but I'm having real trouble deploying exactly the same .war to
> 
> J2EE
> 
>>Reference Implementation server bundled with the J2SDKEE1.4. I need to
> 
> get
> 
>>this working because the real intention is to use Cactus to debug
> 
> EJBs.
> 
>>However, when I deploy it to the J2EE RI server, accessing it throws
> 
> the
> 
>>following error when I try to access it:
>>
>>java.lang.NoClassDefFoundError: org/apache/log4j/Layout
>>
>>Looking at the stack trace from the J2EE server console, there's the
>>following intriguing comment as well, just before the error:
>>
>>"The SecurityManager do not allow that operation."
>>
>>I guess it's a Log4J configuration issue, but I can't find any details
> 
> on
> 
>>the Log4J pages - and since it seems connected to Cactus's use of
> 
> logging,
> 
>>has anyone else has come across this?
>>
>>One thing I'd seen, from the (excellent) article from Sheldon Wosnick
> 
> - at
> 
> http://www7b.boulder.ibm.com/wsdd/techjournal/0206_wosnick/wosnick.html
> -
> 
>>was the log_server.properties file, which he recommends adding into
> 
> the
> 
>>WEB-INF\classes directory.  Still the same error though.
>>
>>Can anybody help?
>>
>>Thanks
>>
>>Stuart Johnson
>>
>>
>>
>>ps - if it helps, my log_server.properties file reads (as pe Wosnick's
>>example):
>>
>>log4j.appender.cactus = org.apache.log4j.FileAppender
>>log4j.appender.cactus.File = cactus_server.log
>>log4j.appender.cactus.Append = false
>>log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
>>log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t]
> 
> %-5p
> 
>>%-30.30c{2} %x - %m %n
>>log4j.rootCategory=DEBUG, cactus
>>log4j.category.org.apache.cactus = WARN, cactus
>>log4j.additivity.org.apache.cactus=false
>>
>>
>>The contents of the .war are as follows:
>>
>>META-INF  WEB-INF   test.jsp
>>
>>META-INF=:
>>MANIFEST.MF
>>
>>WEB-INF=:
>>classes              sun-j2ee-ri.project
>>lib                  web.xml
>>
>>WEB-INF\classes=:
>>SampleServlet.class      TestSampleServlet.class
> 
> log_server.properties
> 
>>WEB-INF\lib=:
>>aspectjrt-1.0.5.jar
>>cactus-1.4.1.jar
>>cactus-ant-1.4.1.jar
>>commons-httpclient-2.0alpha1-20020606.jar
>>commons-logging-1.0.jar
>>httpunit-1.4.1.jar
>>junit-3.7.jar
>>log4j-1.2.5.jar
>>servletapi-2.3.jar
>>
>>(I've included all the .jars going because the naming of the most
> 
> recent
> 
>>build seems to be out of sync with the Getting Started guide).
>>
>>
> 
> ________________________________________________________________________
> 
>>This e-mail has been scanned for all viruses by Star Internet. The
>>service is powered by MessageLabs. For more information on a proactive
>>anti-virus service working around the clock, around the globe, visit:
>>http://www.star.net.uk
>>
> 
> ________________________________________________________________________
> 
>>--
>>To unsubscribe, e-mail:   <mailto:cactus-user-
>>unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:cactus-user-
>>help@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>
> 
> 


-- 
Christopher Lenz
/=/ cmlenz at gmx.de


Mime
View raw message