velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HolĂ˝ Matej <matej.h...@arbes.com>
Subject InvocationTargetException when using MessageTool
Date Thu, 29 Nov 2007 16:10:14 GMT
Hello,
after adding the MessageTool to the velocity toolbox, I get the following error when displaying
the welcome page of my web for the first time.
The tools itself seems to work without any problems, it's just this error that keeps showing
in the console.
 
[#|2007-11-29T16:45:17.547+0100|SEVERE|sun-appserver9.1|org.apache.velocity.tools.view.ViewToolInfo|_ThreadID=17;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=39b8d3a4-bff7-4d6b-966c-5305a0f396dc;|Exception
when calling init(Object) on org.apache.velocity.tools.struts.MessageTool@10ba5cf
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.velocity.tools.view.ViewToolInfo.getInstance(ViewToolInfo.java:229)
 at org.apache.velocity.tools.view.servlet.ServletToolboxManager.getToolbox(ServletToolboxManager.java:416)
 at org.apache.velocity.tools.view.servlet.VelocityViewServlet.createContext(VelocityViewServlet.java:614)
 at org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(VelocityViewServlet.java:537)
 at org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityViewServlet.java:509)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
 at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
 at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
 at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
 at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
 at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
 at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
 at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
 at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
 at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
 at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
 at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
 at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.NullPointerException
 at org.apache.velocity.tools.struts.StrutsUtils.getMessageResources(StrutsUtils.java:79)
 at org.apache.velocity.tools.struts.MessageResourcesTool.init(MessageResourcesTool.java:64)
 ... 38 more
|#]
 
 
Content of the toolbox.xml:
 
<?xml version="1.0"?>
<toolbox>
  <tool>
    <key>link</key>
    <scope>request</scope>
    <class>org.apache.velocity.tools.struts.StrutsLinkTool</class>
  </tool>
 
  <tool>
    <key>text</key>
    <scope>request</scope>
    <class>org.apache.velocity.tools.struts.MessageTool</class>
  </tool>
 
  <tool>
    <key>form</key>
    <scope>request</scope>
    <class>org.apache.velocity.tools.struts.FormTool</class>
  </tool>
 
  <tool>
    <key>render</key>
    <scope>request</scope>
    <class>org.apache.velocity.tools.view.tools.ViewRenderTool</class>
  </tool>
 
  <tool>
    <key>pager</key>
    <scope>request</scope>
    <class>xxxx.PagerTool</class>  --this is a custom pager tool extending the
AbstractPager
  </tool>
</toolbox>
 
I also have 2 message-resources files specified in the struts-config.xml:
<message-resources key="global" parameter="xxxx.GlobalResources" />
<message-resources key="local" parameter="xxxx.modules.xxxx.RecipientsResources" />
 
I'm using Eclipse and Glassfish V2 server for development, velocity tools v1.4 and have all
the commons-, struts- and velocity- .jar files in my lib directory (copied directly from the
velocity-tools-1.4.zip file downloaded from the velocity site).
 
Do you know why this happens and what can I do about it? 
 
Thanks.
 
Matej
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message