Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@apache.org Received: (qmail 54102 invoked from network); 6 Aug 2002 21:31:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 6 Aug 2002 21:31:25 -0000 Received: (qmail 25441 invoked by uid 97); 6 Aug 2002 21:31:52 -0000 Delivered-To: qmlist-jakarta-archive-cactus-user@jakarta.apache.org Received: (qmail 25423 invoked by uid 97); 6 Aug 2002 21:31:51 -0000 Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Cactus Users List" Reply-To: "Cactus Users List" Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 25411 invoked by uid 98); 6 Aug 2002 21:31:50 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Vincent Massol" To: "'Cactus Users List'" Subject: RE: LogConfigurationException Date: Tue, 6 Aug 2002 22:29:31 +0100 Organization: OCTO Technology Message-ID: <010201c23d90$5adec8d0$acc8c8c8@octovma> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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.(AbstractTestCase.java:124) > > at > org.apache.cactus.AbstractWebTestCase.(AbstractWebTestCase.java:86 ) > \ > at org.apache.cactus.ServletTestCase.(ServletTestCase.java:119) > at SampleServletTest.(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: For additional commands, e-mail: