You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Karr, David" <da...@attws.com> on 2002/08/15 01:11:39 UTC

Simple Struts "Hello World" application gets NPE in ProxyDirConte xt.cacheLoad() when adding Validator

I have a relatively simple "Hello World" Struts application, using a single
form bean, two actions, and a few boilerplate tiles.  I'm using Struts1.1b2.
I decided to try adding the Validator for client-side validation.

I copied validator-rules.xml and created a simple validation.xml file (to
validate a date field).  I changed my ActionForm to inherit from
ValidatorForm.  I added the Validator plugin to my struts-config.xml file.

I added a <html:javascript> tag to the end of my "mainBody.jsp" file
(referenced from a tiles template), along with a "<script>" tag right after
it.  I copied that almost directly from the "struts-validator" example.  I
copied the "staticJavascript.jsp" file from that example also.

I compiled the Java code and assembled the WAR, and deployed it to Tomcat
4.0.4 (and JDeveloper9i's embedded OC4J).

When I run the application in Tomcat, I see the following on the server
console (some stack entries elided):

-------------
SEVERE: No action instance for path /main could be created
java.lang.NullPointerException
        at
org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1
468)
        at
org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java
:1350)
        at
org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:257)
        at
org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClas
sLoader.java:1691)
        at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
ader.java:1582)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
a:937)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1372)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1254)
        at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:193)
        at
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:21
9)
        at
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcess
or.java:316)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
-------------

When I ran the application in JDeveloper, it also failed at a similar point,
although I didn't see an exception stack trace (JDeveloper is a little
deficient on showing those, apparently).

Unfortunately, my debugger isn't set up at this point to debug Tomcat, or I
would trace through this.

Just in case, I'll attach my struts-config.xml and validation.xml files.