You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Tom Keeney <to...@novuscg.com> on 2001/11/07 16:07:39 UTC

NullPointerException using setTemplate()

Hello all,

I'm getting a NullPointerException when I call setTemplate from within a
VelocityPortletAction and I can't find the root of the problem.  Here's
the details:

I have a portlet named UploadAction that extends VelocityPortletAction.
This
portlet uses the template "upload-default.vm", as shown by the
portlets.xreg entry -
    
<portlet-entry name="Content Submission" hidden="false" type="ref"
        parent="CustomizerVelocity" application="false">
        <meta-info>
            <title>Content Submission</title>
            <description>Content Submission System</description>
        </meta-info>
        <parameter name="template" value="upload-default"
hidden="false"/>
        <parameter name="action" value="docsubmit.UploadAction"
hidden="false"/>
        <media-type ref="html"/>
</portlet-entry>



The portlet comes up fine in jetspeed.  I call the following method from
inside the UploadAction portlet:
    
public void doContinue(RunData rundata, Context context)
{
        System.out.println("Called UploadAction.doContinue");
        this.setTemplate(rundata, "upload-review-submit");
}

The "Called UploadAction.doContinue" is written to the console, but I
get the NullPointerException on the setTemplate invocation.

Note that "upload-review-submit" is a velocity module in the same
directory as "upload-default" : WEB-INF/templates/vm/portlets/html/

Even if I change setTemplate to route back to the original template
"upload-default", I still get the NullPointerException.

What I'm trying to do is have several views for the same portlet.  Any
help is much appreciated!

Here's my system:
Tomcat 3.2.3
Jetspeed v1.3a2-dev.


Here's the stack trace:
java.lang.reflect.InvocationTargetException:
java.lang.NullPointerException
	at
org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction.setTe
mplate(VelocityPortletAction.java:137)
	at
com.novuscg.modules.actions.docsubmit.UploadAction.doContinue(UploadActi
on.java:36)
	at java.lang.reflect.Method.invoke(Native Method)
	at
org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Veloc
ityActionEvent.java:166)
	at
org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction.perfo
rm(VelocityPortletAction.java:116)
	at
org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
	at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:14
3)
	at org.apache.turbine.modules.Page.build(Page.java:90)
	at
org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
	at org.apache.turbine.Turbine.doGet(Turbine.java:462)
	at org.apache.turbine.Turbine.doPost(Turbine.java:552)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
	at org.apache.tomcat.core.Handler.service(Handler.java:287)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:812)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:213)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416
)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:50
1)
	at java.lang.Thread.run(Thread.java:484)




cheers,

Tom Keeney
Novus Consulting Group
 

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