velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@4quarters.com>
Subject Re: Velocity.init() problem
Date Sun, 04 Jan 2004 22:13:37 GMT
what version of Velocity?

On Jan 4, 2004, at 5:43 PM, Algirdas M. wrote:

> Hello,
>
> I have j2se 1.3 and tomcat 4.0.3 on the server.
> I'm executing this code:
>
>         Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,
>                 getServletContext().getRealPath("templates/"));
>
>         Velocity.setProperty(Velocity.RUNTIME_LOG,
>                 getServletContext().getRealPath("velocity.log"));
>
>         try {
>             Velocity.init();
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>
> ..and I'm getting this exception:
>
> java.lang.NullPointerException
>         at java.io.Reader.<init>(Reader.java:64)
>         at java.io.InputStreamReader.<init>(InputStreamReader.java:89)
>         at java.io.InputStreamReader.<init>(InputStreamReader.java:61)
>         at  
> org.apache.commons.collections.ExtendedProperties.load(Unknown Source)
>         at  
> org.apache.commons.collections.ExtendedProperties.load(Unknown Source)
>         at  
> org.apache.velocity.runtime.RuntimeInstance.setDefaultProperties(Runtim 
> eInstance.java:298)
>         at  
> org.apache.velocity.runtime.RuntimeInstance.initializeProperties(Runtim 
> eInstance.java:423)
>         at  
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java: 
> 266)
>         at  
> org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java 
> :169)
>         at org.apache.velocity.app.Velocity.init(Velocity.java:123)
>         at xxx.objects.View.initGetMethod(View.java:133)
>         at xxx.objects.View.doGet(View.java:66)
>         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(Applic 
> ationFilterChain.java:247)
>         at  
> org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFil 
> terChain.java:197)
>         at  
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilter 
> Chain.java:176)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil 
> terChain.java:172)
>         at  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal 
> ve.java:243)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:566)
>         at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 472)
>         at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at  
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal 
> ve.java:190)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:566)
>         at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 472)
>         at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at  
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java: 
> 2343)
>         at  
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav 
> a:180)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:566)
>         at  
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV 
> alve.java:170)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:564)
>         at  
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav 
> a:170)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:564)
>         at  
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 
> 468)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:564)
>         at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 472)
>         at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at  
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve 
> .java:174)
>         at  
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j 
> ava:566)
>         at  
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 472)
>         at  
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at  
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor. 
> java:1012)
>         at  
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java 
> :1122)
>         at java.lang.Thread.run(Thread.java:484)
>
>
>
>   On my local computer I have j2sdk 1.4.2_03 and Tomcat 4.1.29 and the
>   same code works fine - without exception.
>
>   Where is the problem?
>
>
>   Thank you.
>
> -- 
> Best regards,
>  Algirdas                          mailto:snk@splius.lt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message