velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Algirdas M." <...@splius.lt>
Subject Velocity.init() problem
Date Sun, 04 Jan 2004 22:43:02 GMT
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(RuntimeInstance.java:298)
        at org.apache.velocity.runtime.RuntimeInstance.initializeProperties(RuntimeInstance.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(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:197)
        at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java: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(StandardContextValve.java:190)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java: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.java:180)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java: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.java: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


Mime
View raw message