aspose file tools*
The moose likes XML and Related Technologies and the fly likes com.oroad.stxx.transform.TransformerException: Unable to retrieve template null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "com.oroad.stxx.transform.TransformerException: Unable to retrieve template null" Watch "com.oroad.stxx.transform.TransformerException: Unable to retrieve template null" New topic
Author

com.oroad.stxx.transform.TransformerException: Unable to retrieve template null

Suhas Madap
Ranch Hand

Joined: Aug 29, 2006
Posts: 52
Hi,
I see a problem related to struts application which uses XSL files for transformation, problem is when I deploy application (war file) in weblogic 10.3 It's getting deployed with success, but when I perform an action which is related to execution of XSL files. It throws a NullPointerException. The same application works fine in Tomcat 6.0. Please help me out in debugging this issue.

Stacktrace of weblogic:

Oct 26, 2009 5:36:31 PM com.oroad.stxx.transform.document.SAXDocumentBuilder init
INFO: Using serializer class com.oroad.stxx.transform.document.DefaultSAXSerializer
Oct 26, 2009 5:36:31 PM com.oroad.stxx.transform.document.SAXDocumentBuilder init
INFO: Using serializer class com.oroad.stxx.transform.document.DefaultSAXSerializer
Oct 26, 2009 5:36:31 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.actions.LocalStrings', returnNull=true
Oct 26, 2009 5:36:31 PM com.oroad.stxx.transform.AbstractXSLTransformer getTemplates
SEVERE: Exception in creating Transform Handler
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at com.oroad.stxx.transform.AbstractXSLTransformer.getTemplates(AbstractXSLTransformer.java:138)
at com.oroad.stxx.transform.AbstractXSLTransformer.loadHandlers(AbstractXSLTransformer.java:258)

at com.oroad.stxx.transform.CachedXSLTransformer.transform(CachedXSLTransformer.java:180)
at com.oroad.stxx.transform.TransformerHandler.processActionTransform(TransformerHandler.java:203)
at com.oroad.stxx.plugin.RequestProcessorHelper.processStxxDefinition(RequestProcessorHelper.java:260)
at com.oroad.stxx.plugin.StxxRequestProcessor.processForwardConfig(StxxRequestProcessor.java:133)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Oct 26, 2009 5:36:31 PM com.oroad.stxx.transform.TransformerHandler processActionTransform
WARNING: Unable to transform
com.oroad.stxx.transform.TransformerException: Unable to retrieve template null
at com.oroad.stxx.transform.AbstractXSLTransformer.loadHandlers(AbstractXSLTransformer.java:260)
at com.oroad.stxx.transform.CachedXSLTransformer.transform(CachedXSLTransformer.java:180)

at com.oroad.stxx.transform.TransformerHandler.processActionTransform(TransformerHandler.java:203)
at com.oroad.stxx.plugin.RequestProcessorHelper.processStxxDefinition(RequestProcessorHelper.java:260)
at com.oroad.stxx.plugin.StxxRequestProcessor.processForwardConfig(StxxRequestProcessor.java:133)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Oct 26, 2009 5:38:08 PM com.oroad.stxx.transform.AbstractXSLTransformer getTemplates
SEVERE: Exception in creating Transform Handler
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at com.oroad.stxx.transform.AbstractXSLTransformer.getTemplates(AbstractXSLTransformer.java:138)
at com.oroad.stxx.transform.AbstractXSLTransformer.loadHandlers(AbstractXSLTransformer.java:258)
at com.oroad.stxx.transform.CachedXSLTransformer.transform(CachedXSLTransformer.java:180)
at com.oroad.stxx.transform.TransformerHandler.processActionTransform(TransformerHandler.java:203)
at com.oroad.stxx.plugin.RequestProcessorHelper.processStxxDefinition(RequestProcessorHelper.java:260)
at com.oroad.stxx.plugin.StxxRequestProcessor.processForwardConfig(StxxRequestProcessor.java:133)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Oct 26, 2009 5:38:16 PM com.oroad.stxx.transform.TransformerHandler processActionTransform
WARNING: Unable to transform
com.oroad.stxx.transform.TransformerException: Unable to retrieve template null
at com.oroad.stxx.transform.AbstractXSLTransformer.loadHandlers(AbstractXSLTransformer.java:260)
at com.oroad.stxx.transform.CachedXSLTransformer.transform(CachedXSLTransformer.java:180)
at com.oroad.stxx.transform.TransformerHandler.processActionTransform(TransformerHandler.java:203)
at com.oroad.stxx.plugin.RequestProcessorHelper.processStxxDefinition(RequestProcessorHelper.java:260)
at com.oroad.stxx.plugin.StxxRequestProcessor.processForwardConfig(StxxRequestProcessor.java:133)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
<Oct 26, 2009 5:42:21 PM GMT+05:30> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal.>
<Oct 26, 2009 5:49:30 PM GMT+05:30> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nf
pb=true&_pageLabel=HomePage1.>
<Oct 26, 2009 5:49:30 PM GMT+05:30> <Error> <HTTP> <BEA-101020> <[weblogic.servlet.internal.WebAppServletContext@50d7c5 - appName: 'consoleapp', name: 'console',
context-path: '/console', spec-version: '2.5'] Servlet failed with Exception
java.lang.IllegalStateException: Response already committed
at weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:1553)
at weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:838)
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:136)
at com.bea.netuix.nf.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:50)
at com.bea.netuix.servlets.controls.content.NetuiContent.handleRedirect(NetuiContent.java:234)
Truncated. see log file for complete stacktrace
>


Thank you,<br /> <br />Suhas K Madap<br /> <br />If you understand what you're doing, you're not learning anything."
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So far I'm pretty skeptical this is a Struts issue. Convince me.
Suhas Madap
Ranch Hand

Joined: Aug 29, 2006
Posts: 52
Hi David,
I'm not sure whether it's a struts framework or weblogic issue. As far as what I understand from stacktrace is when an action class is trying to resolve or load XSLT file, it's unable to get reference to a Template and null is passed to stxx related classes that is why there is a NullpointerExecption. So I need how to make this stuff work in weblogic.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So far it seems like an issue finding the template.

How are you deploying your application? How are you getting the template? All you've shown is the stack trace.

I'm moving this out of Struts as it doesn't appear to have anything to do with Struts at all.
Suhas Madap
Ranch Hand

Joined: Aug 29, 2006
Posts: 52
Hi David,
I built this app as a war file and structure of war file is something like this:

> images
> META-INF
> scripts --> contains javascript files
> stylesheets --> contains .css files
> WEB-INF
|
|__ classess
|
|__lib
|
|__ templates (contains .xsl files)
|
|__ struts-config.xml (has an entry "<plug-in className="com.oroad.stxx.plugin.StxxPlugin">
| <set-property property="pipeline-config" value="/WEB-INF/stxx-transforms.xml"/> </plug-in>)
|
|__ stxx-transforms.xml (is responsible for loading templates )
|
|__ web.xml (contains an entry to load stxx related classes <init-param>
<param-name>stxxInit</param-name>
<param-value>/stxx.properties</param-value>
</init-param>)


stxx-transforms.xml:

<?xml version="1.0" encoding="UTF-8"?>
<transform-definitions>
<pipeline match="*Request.dox">
<transform type="html">
<param name="path" value="/WEB-INF/templates/{1}Request.xsl"/>
</transform>
</pipeline>
<pipeline match="*Response.dox">
<transform type="html">
<param name="path" value="/WEB-INF/templates/{1}Response.xsl"/>
</transform>
</pipeline>
</transform-definitions>

The same application works fine in Apache tomcat server. The issue is only when I deploy (will be successful) this app and try to access it.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18907
    
    8

What's that {1} thing in your stxx-transforms.xml file?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

My initial guess would be that it's trying to load files from the war as files, not resources--you'll have to check the stxx documentation. One way to check might be to deploy it to WL exploded (non-war) format, if that's even possible.
Shajahan Amanulla
Greenhorn

Joined: Jun 06, 2011
Posts: 1
Hi Suhas Madap,

could you please let me know if you find any solution for this problem. I am struck up with issue for past one week. Please Help on this issue.

Thanks and Regards
Shajahan A.
 
wood burning stoves
 
subject: com.oroad.stxx.transform.TransformerException: Unable to retrieve template null