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: NPE at Getting Started tutorial
Date Sat, 31 Aug 2002 14:38:24 GMT
Hi Gerhard,

Looking at the stack trace and at the JDK source code, it seems the
error is because on some JDK implementation, Class.getClassLoader() will
return null to indicate that the bootstrap classloader was used to load
the given class. However, getBundle() does not support passing a null
class loader object ...

I have patched cactus so that this fix will be in the 1.4.1 that I will
deliver later today. Hopefully this will fix your problem.

Thanks 
-Vincent

> -----Original Message-----
> From: Gerhard Kreutzer [mailto:g.kreutzer@kreutzersoft.de]
> Sent: 31 August 2002 09:58
> To: cactus-user@jakarta.apache.org
> Subject: NPE at Getting Started tutorial
> 
> Hi,
> 
> I'm new to Cactus, so I'm trying the "20 minutes tutorial" linked at
the
> Getting Started documentation.
> 
> I use J2SDK 1.4.0 and tomcat 4.0.4 on Win2K prof. SP3.
> 
> Running the test (tutorial step 5) fails with a NPE (same as in thread
> "help with Tomcat howto" at TestSampleServlet #beginSaveToSessionOK()
> (see the following trace). Deleting the addParameter() statement
brings
> the same result.
> 
> What's going wrong? Can anybody help?
> 
> thanks
> Gerhard
> 
> Here is the log4j trace from cactus-client.log:
> 
> 10:06:35,325 [HttpProcessor[8080][4]] DEBUG runner.ServletTestRunner
>      -
<doGet([org.apache.catalina.connector.HttpRequestFacade@e49dcd],
> [org.apache.catalina.connector.HttpResponseFacade@343ed0])
> 10:06:35,335 [HttpProcessor[8080][4]] DEBUG runner.ServletTestRunner
>      - <run([TestSampleServlet], [null])
> 10:06:35,355 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - <setXslFileName([null])
> 10:06:35,355 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - >setXslFileName
> 10:06:35,355 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - <setSuiteClassName([TestSampleServlet])
> 10:06:35,355 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - >setSuiteClassName
> 10:06:35,375 [HttpProcessor[8080][4]] DEBUG
runner.WebappTestSuiteLoader
>     - <load([TestSampleServlet])
> 10:06:35,385 [HttpProcessor[8080][4]] DEBUG util.ClassLoaderUtils
>      - <loadClass([TestSampleServlet], [class
> org.apache.cactus.server.runner.WebappTestSuiteLoader])
> 10:06:35,395 [HttpProcessor[8080][4]] DEBUG util.ClassLoaderUtils
>      - <loadClassFromWebappClassLoader([TestSampleServlet], [class
> org.apache.cactus.server.runner.WebappTestSuiteLoader])
> 10:06:35,395 [HttpProcessor[8080][4]] DEBUG util.ClassLoaderUtils
>      - <loadClassFromContextClassLoader([TestSampleServlet])
> 10:06:35,435 [HttpProcessor[8080][4]] DEBUG util.ClassLoaderUtils
>      - >loadClassFromContextClassLoader = [class TestSampleServlet]
> 10:06:35,435 [HttpProcessor[8080][4]] DEBUG util.ClassLoaderUtils
>      - >loadClass = [class TestSampleServlet]
> 10:06:35,435 [HttpProcessor[8080][4]] DEBUG
runner.WebappTestSuiteLoader
>     - >load = [class TestSampleServlet]
> 10:06:35,475 [HttpProcessor[8080][4]] DEBUG util.JUnitVersionHelper
>      - <getTestCaseName([testSaveToSessionOK(TestSampleServlet)])
> 10:06:35,475 [HttpProcessor[8080][4]] DEBUG util.JUnitVersionHelper
>      - >getTestCaseName = [testSaveToSessionOK]
> 10:06:35,485 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - <startTest([testSaveToSessionOK(TestSampleServlet)])
> 10:06:35,485 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - >startTest
> 10:06:35,495 [HttpProcessor[8080][4]] DEBUG TestSampleServlet
>      - ------------- Test: testSaveToSessionOK
> 10:06:35,505 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([testparam], [it works!])
> 10:06:35,505 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([testparam], [it works!], [GET])
> 10:06:35,505 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,505 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,505 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([Cactus_TestClass], [TestSampleServlet], [GET])
> 10:06:35,515 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,515 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([Cactus_TestMethod], [testSaveToSessionOK],
[GET])
> 10:06:35,525 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,525 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([Cactus_AutomaticSession], [true], [GET])
> 10:06:35,525 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,525 [HttpProcessor[8080][4]] DEBUG client.ServletHttpClient
>      - <doTest([simulation URL = [null], automatic session = [true],
> cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] =
> [[testSaveToSessionOK]]][[Cactus_TestClass] =
> [[TestSampleServlet]]][[testparam] = [[it
> works!]]][[Cactus_AutomaticSession] = [[true]]]], POST parameters =
[]])
> 10:06:35,535 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - <addParameter([Cactus_Service], [CALL_TEST], [GET])
> 10:06:35,535 [HttpProcessor[8080][4]] DEBUG cactus.WebRequest
>      - >addParameter
> 10:06:35,555 [HttpProcessor[8080][4]] DEBUG TestSampleServlet
>      - Exception in test
> java.lang.NullPointerException
> 	at java.util.ResourceBundle.getBundle(ResourceBundle.java:659)
> 	at
>
org.apache.cactus.util.ClassLoaderUtils.loadPropertyResourceBundle(Class
Lo
> aderUtils.java;org/apache/cactus/util/log/LogAspect.java(1k):153)
> 	at
>
org.apache.cactus.util.Configuration.initialize(Configuration.java:140)
> 	at
>
org.apache.cactus.util.ServletConfiguration.getServletRedirectorURL(Serv
le
> tConfiguration.java:86)
> 	at
>
org.apache.cactus.client.ServletHttpClient.getRedirectorURL(ServletHttpC
li
> ent.java:87)
> 	at
>
org.apache.cactus.client.AbstractHttpClient.callRunTest(AbstractHttpClie
nt
> .java;org/apache/cactus/util/log/LogAspect.java(1k):184)
> 	at
>
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(AbstractHtt
pC
> lient.java;org/apache/cactus/util/log/LogAspect.java(1k):109)
> 	at
>
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHttpC
li
> ent.java;org/apache/cactus/util/log/LogAspect.java(1k):1218)
> 	at
>
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.ja
va
> ;org/apache/cactus/util/log/LogAspect.java(1k):104)
> 	at
>
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase
.j
> ava:260)
> 	at
> org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
> 	at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:131)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:173)
> 	at junit.framework.TestSuite.run(TestSuite.java:168)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.dispatch92_run(Servlet
Te
> stRunner.java;org/apache/cactus/util/log/LogAspect.java(1k):161)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.around92_run(ServletTe
st
> Runner.java;org/apache/cactus/util/log/LogAspect.java(1k):1218)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.
ja
> va;org/apache/cactus/util/log/LogAspect.java(1k):137)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.dispatch91_doGet(Servl
et
> TestRunner.java;org/apache/cactus/util/log/LogAspect.java(1k):121)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.around91_doGet(Servlet
Te
> stRunner.java;org/apache/cactus/util/log/LogAspect.java(1k):1149)
> 	at
>
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunne
r.
> java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
ti
> onFilterChain.java:247)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
er
> Chain.java:193)
> 	at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.
> java:243)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.
> java:190)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va
> :246)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
7)
> 	at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:1
> 80)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lv
> e.java:170)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:1
> 70)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
ja
> va:174)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
av
> a:1027)
> 	at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
11
> 25)
> 	at java.lang.Thread.run(Thread.java:536)
> 10:06:35,585 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - <addError([testSaveToSessionOK(TestSampleServlet)],
> [java.lang.NullPointerException])
> 10:06:35,595 [HttpProcessor[8080][4]] DEBUG runner.XMLFormatter
>      - <replace([null], [&], [&amp;])
> 
> 
> --
> 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