Here is the complete error I get when I try to view the vm template in a
web browser.
VelocityViewServlet : Error processing the template
java.lang.NullPointerException
at
org.apache.velocity.tools.struts.StrutsUtils.getMessageResources(StrutsUtils.java:211)
at
org.apache.velocity.tools.struts.MessageResourcesTool.init(MessageResourcesTool.java:59)
at
org.apache.velocity.tools.view.ViewToolInfo.getInstance(ViewToolInfo.java:133)
at
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getToolboxContext(ServletToolboxManager.java:354)
at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.createContext(VelocityViewServlet.java:519)
at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(VelocityViewServlet.java:401)
at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityViewServlet.java:373)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
I am not sure how much of my code I should give. I have a bean java
file, a form java file, and a action java file. I also have a web.xml
and a strukts-config file. I thinkk youu would need all that to
prooduce myy error. So tell me what you think you would need to see
and I'll post it.
Paul
Shinobu Kawai wrote:
Hi Paul,
I have written a few java files and rewrote a template to be more like a
template rather then standard html. When I tried to view the webpage I
found that I have a NullPointerException. Usually when there is a NPE
the compiler tells me where in my code the NPE is coming from. However
it just starts out with
"org.apache.velocity.tools.struts.StrutsUtils.getMessageResources(StrutsUtils.java:211)"
Source says, you didn't give it a ServletContext, or a ModuleConfig
could not be found.
return (MessageResources)app.getAttribute(Globals.MESSAGES_KEY +
moduleConfig.getPrefix());
I think the problem is that the properties file I defined is not moved
to the classes directory when the javacode is compiled. How do I do
that if I am using Ant to compiule my source code? However when I did
move the properties file into the right directory, I still get the same
error. Oh yeah this happens on all velocity pages that I created
before I changed the code.
If you need to see the entire error please let me know and I will
provide it.
I think it would. Better yet, you could show us some minimal code to
reproduce your problem. ;)
As for the Ant question, the Ant User List would be a better place to ask.
http://ant.apache.org/mail.html
Best regards,
-- Shinobu
--
Shinobu Kawai <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]