jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: LogConfigurationException
Date Sat, 31 Aug 2002 19:48:49 GMT
I'm sure you will have found the answer by now. Just in case, it is now
in the FAQ: http://jakarta.apache.org/cactus/faq.html#faq8

Cheers,
-Vincent

> -----Original Message-----
> From: Peng, Haitao [mailto:Haitao.Peng@commerceone.com]
> Sent: 08 August 2002 17:49
> To: 'Vincent Massol'
> Subject: RE: LogConfigurationException
> 
> Hi, Vincent:
> 
> I find a workaround for my problem.  If I use Junit text UI instead of
> Swing
> UI, that LogConfigurationException went away.
> I saw a similar posting at commons-user forum, but nobody address the
> question:
>    http://www.mail-archive.com/commons-
> user@jakarta.apache.org/msg00068.html
> 
> Any way, I am on my way to use Cactus.  Thanks for your help!
> 
> 
> Haitao Peng
> Commerce One at Austin
> (512) 597-6230
> 
> 
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: Tuesday, August 06, 2002 4:47 PM
> To: 'Cactus Users List'
> Subject: RE: LogConfigurationException
> 
> 
> 
> 
> > -----Original Message-----
> > From: Peng, Haitao [mailto:Haitao.Peng@commerceone.com]
> > Sent: 06 August 2002 22:31
> > To: 'Cactus Users List'
> > Subject: RE: LogConfigurationException
> >
> > Thanks, Vincent.
> > I did not modify commons-logging.  I simply add it to
> > Jrun4\servers\default\mywebapp\WEB-INF\lib and included it in a
class
> > library in JBuilder7.
> 
> You also have it on the client side, right ?
> 
> >
> > Is there any way I can turn the commons-logging off?
> 
> Are you running on JDK 1.4 ?
> 
> You can try to explicitely tell commons-logging not to log, but the
> problem seems to be with the DefaultLoggerFactory ... You can try to
use
> the
> 
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
> 
> system property. If you use the junit Ant task, you can pass it using
> the <jvmarg> tag.
> 
> If you run java from the command line simply use :
> 
>
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
> 
> Although I don't think it will fix your problem.
> 
> Is there anything else you can tell us ?
> 
> Thanks
> -Vincent
> 
> >
> >
> > Haitao Peng
> > Commerce One at Austin
> > (512) 597-6230
> >
> >
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@octo.com]
> > Sent: Tuesday, August 06, 2002 4:30 PM
> > To: 'Cactus Users List'
> > Subject: RE: LogConfigurationException
> >
> >
> > Hi Haito,
> >
> > You servlet and test case look very fine. As your subject says, it
> seems
> > to be a problem with internal Cactus logging (which uses
> > commons-logging). At first sight, it looks like you've tried to use
a
> > special logging factory class that does not inherit from LogFactory
> ...
> >
> > Have you tried to play with configuring commons-logging ? :-)
> >
> > Apart from that, I am stuck at the moment ...
> >
> > -Vincent
> >
> > > -----Original Message-----
> > > From: Peng, Haitao [mailto:Haitao.Peng@commerceone.com]
> > > Sent: 06 August 2002 20:17
> > > To: 'cactus-user@jakarta.apache.org'
> > > Subject: LogConfigurationException
> > >
> > > Hi, Vincent:
> > >
> > > I am a beginner to use Cactus with JBuilder and Jrun.  I tried a
> > simple
> > > servlet and test class.
> > >
> > > import javax.servlet.http.HttpServlet;
> > > import javax.servlet.http.HttpServletRequest;
> > >
> > > public class SampleServlet extends HttpServlet
> > > {
> > >     public void saveToSession(HttpServletRequest request)
> > >     {
> > >             String testparam = request.getParameter("testparam");
> > >             request.getSession().setAttribute("testAttribute",
> > testparam);
> > >     }
> > > }
> > >
> > >
> > > import junit.framework.*;
> > > import org.apache.cactus.*;
> > > import SampleServlet;
> > >
> > > public class SampleServletTest extends ServletTestCase
> > > {
> > >     public SampleServletTest(String theName)
> > >     {
> > >         super(theName);
> > >     }
> > >
> > >     public static void main (String[] args)
> > >     {
> > >         //junit.textui.TestRunner.run (TestSampleServlet.class);
> > >         junit.swingui.TestRunner.run (SampleServletTest.class);
> > >     }
> > >     public static Test suite()
> > >     {
> > >         return new TestSuite(SampleServletTest.class);
> > >     }
> > >
> > >     public void beginSaveToSessionOK(WebRequest webRequest)
> > >     {
> > >         webRequest.addParameter("testparam", "it works!");
> > >     }
> > >
> > >     public void testSaveToSessionOK()
> > >     {
> > >         SampleServlet servlet = new SampleServlet();
> > >         servlet.saveToSession(request);
> > >         assertEquals("it works!",
> > session.getAttribute("testAttribute"));
> > >         System.out.print("Test Works!");
> > >     }
> > > }
> > >
> > > The following are exceptions I got:
> > >
> > > junit.framework.AssertionFailedError: Exception in constructor:
> > > testSaveToSessionOK
> > (org.apache.commons.logging.LogConfigurationException:
> > > java.lang.ClassCastException:
> > > org.apache.commons.logging.impl.LogFactoryImpl
> > > at
> >
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:506)
> > > at
> >
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350)
> > >
> > > at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
> > > at
> > >
> >
>
org.apache.cactus.util.JUnitVersionHelper.around146_getTestCaseName(LogA
> > sp
> > > ec
> > > t.java(1k):1170)
> > > at
> > >
> >
>
org.apache.cactus.util.JUnitVersionHelper.getTestCaseName(LogAspect.java
> > (1
> > > k)
> > > :103)
> > > at
> > org.apache.cactus.AbstractTestCase.<init>(AbstractTestCase.java:124)
> > >
> > > at
> > >
> >
>
org.apache.cactus.AbstractWebTestCase.<init>(AbstractWebTestCase.java:86
> > )
> > > \
> > > at
> org.apache.cactus.ServletTestCase.<init>(ServletTestCase.java:119)
> > > at SampleServletTest.<init>(SampleServletTest.java:10)
> > > at java.lang.reflect.Constructor.newInstance(Native Method)
> > > at SampleServletTest.suite(SampleServletTest.java:20)
> > > at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:53)
> > at
> > > SampleServletTest.main(SampleServletTest.java:16) )
> > >
> > >
> > > I don't have any clue what is wrong?  Any pointers?
> > >
> > > Thanks
> > >
> > > Haitao Peng
> > > Commerce One at Austin
> > > (512) 597-6230
> >
> >
> >
> > --
> > 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>
> 
> 
> 
> --
> 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>


Mime
View raw message