You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Luke Lindsay <lu...@halvor.co.uk> on 2002/07/23 13:07:19 UTC

NullPointerException on linux but not win2000

Apologies if I've missed something obvious.
The test jsp page below works on windows 2000 with tomcat 4.0.4, but throws
a NullPointerException (see the stack trace below) under Debian linux with
tomcat 4.0.4.  (N.B. This is the same problem as described by Adam Lipscombe
in an earlier message.)
<%@page contentType="text/html"%><%@page import="java.io.StringWriter"
%><%@page import="java.util.Properties" %><%@page
import="org.apache.velocity.app.Velocity" %><%@page
import="org.apache.velocity.VelocityContext" %>
<html><head><title>Velocity Test</title></head><body><%
Velocity.init();     VelocityContext context = new VelocityContext();
context.put("message", "Hello world");     StringWriter w = new
StringWriter();     String template = "$message";
elocity.evaluate( context, w, "mystring", template );%>The Message:
<%=w.toString() %></body></html>

java.lang.NullPointerException
	at
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:628)
	at
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:613)
	at
org.apache.velocity.runtime.RuntimeSingleton.parse(RuntimeSingleton.java:303
)
	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:325)
	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:253)
	at org.apache.jsp.velocitytest$jsp._jspService(velocitytest$jsp.java:92)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:201)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	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.ja
va:190)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	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:2347)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	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:5
66)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
	at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
	at java.lang.Thread.run(Thread.java:536)

Any ideas?
TIA
Luke Lindsay





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NullPointerException on linux but not win2000

Posted by Luke Lindsay <lu...@halvor.co.uk>.
----- Original Message -----
From: "Luke Lindsay" <lu...@halvor.co.uk>
To: <ve...@jakarta.apache.org>
Sent: Tuesday, July 23, 2002 12:07 PM
Subject: NullPointerException on linux but not win2000


> Apologies if I've missed something obvious.
> The test jsp page below works on windows 2000 with tomcat 4.0.4, but
throws
> a NullPointerException (see the stack trace below) under Debian linux with
> tomcat 4.0.4.  (N.B. This is the same problem as described by Adam
Lipscombe
> in an earlier message.)
> <%@page contentType="text/html"%><%@page import="java.io.StringWriter"
> %><%@page import="java.util.Properties" %><%@page
> import="org.apache.velocity.app.Velocity" %><%@page
> import="org.apache.velocity.VelocityContext" %>
> <html><head><title>Velocity Test</title></head><body><%
> Velocity.init();     VelocityContext context = new VelocityContext();
> context.put("message", "Hello world");     StringWriter w = new
> StringWriter();     String template = "$message";
> elocity.evaluate( context, w, "mystring", template );%>The Message:
> <%=w.toString() %></body></html>
>
I am able to run an equivalent test program from the command line which
suggests that it the problem may be caused by tomcat's security manager.

Luke Lindsay


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NullPointerException on linux but not win2000

Posted by Luke Lindsay <lu...@halvor.co.uk>.
----- Original Message -----
From: "Geir Magnusson Jr." <ge...@adeptra.com>
To: <ve...@jakarta.apache.org>
Sent: Tuesday, July 23, 2002 5:09 PM
Subject: Re: NullPointerException on linux but not win2000


> On 7/23/02 7:07 AM, "Luke Lindsay" <lu...@halvor.co.uk> wrote:
>
> > Apologies if I've missed something obvious.
>
> I have to admire the chutzpah of showing up with JSP :)
>
> > The test jsp page below works on windows 2000 with tomcat 4.0.4, but
throws
> > a NullPointerException (see the stack trace below) under Debian linux
with
> > tomcat 4.0.4.  (N.B. This is the same problem as described by Adam
Lipscombe
> > in an earlier message.)
>
> > <%@page contentType="text/html"%><%@page import="java.io.StringWriter"
> > %><%@page import="java.util.Properties" %><%@page
> > import="org.apache.velocity.app.Velocity" %><%@page
> > import="org.apache.velocity.VelocityContext" %>
> > <html><head><title>Velocity Test</title></head><body><%
> > Velocity.init();     VelocityContext context = new VelocityContext();
> > context.put("message", "Hello world");     StringWriter w = new
> > StringWriter();     String template = "$message";
> > elocity.evaluate( context, w, "mystring", template );%>The Message:
> > <%=w.toString() %></body></html>
>
> This should work.  What version of Velocity?
>
I get the same results with 1.2 and 1.3.
> --
> Geir Magnusson Jr.
> Research & Development, Adeptra Inc.
> geirm@adeptra.com
> +1-203-247-1713
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NullPointerException on linux but not win2000

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 7/23/02 7:07 AM, "Luke Lindsay" <lu...@halvor.co.uk> wrote:

> Apologies if I've missed something obvious.

I have to admire the chutzpah of showing up with JSP :)

> The test jsp page below works on windows 2000 with tomcat 4.0.4, but throws
> a NullPointerException (see the stack trace below) under Debian linux with
> tomcat 4.0.4.  (N.B. This is the same problem as described by Adam Lipscombe
> in an earlier message.)

> <%@page contentType="text/html"%><%@page import="java.io.StringWriter"
> %><%@page import="java.util.Properties" %><%@page
> import="org.apache.velocity.app.Velocity" %><%@page
> import="org.apache.velocity.VelocityContext" %>
> <html><head><title>Velocity Test</title></head><body><%
> Velocity.init();     VelocityContext context = new VelocityContext();
> context.put("message", "Hello world");     StringWriter w = new
> StringWriter();     String template = "$message";
> elocity.evaluate( context, w, "mystring", template );%>The Message:
> <%=w.toString() %></body></html>

This should work.  What version of Velocity?

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>