You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Robert Koberg <ro...@koberg.com> on 2001/10/05 19:10:04 UTC

Templates object created but still TransformerConfigurationException

I have tried Tom's example but I am still having problems. I am attaching my
file for Tom (if anybody else is willing to take a look I would be more than
happy to send it!). The template is created as it shows in the console
output. I explicitly set the system properties for the factories like this:
System.setProperty("javax.xml.transform.TransformerFactory",
	"org.apache.xalan.xsltc.trax.TransformerFactoryImpl");

System.setProperty("javax.xml.parsers.SAXParserFactory",
      "org.apache.xerces.jaxp.SAXParserImpl");

The ERROR that is thrown says there is a TransformerConfigurationException
and that the template does not contain a valid translet class definition.
What do I do to fix this?

TIA,
-Rob
---------------------------

My CONSOLE says that the template is created:

xsl: file:/home/gudgeon/sites/master/WEB-INF/tool/site-chooser.xsl
in the try
xslSource is javax.xml.transform.stream.StreamSource@52c4d9
tFactory is org.apache.xalan.xsltc.trax.TransformerFactoryImpl@72380
template is org.apache.xalan.xsltc.trax.TemplatesImpl@7725c4
in doPost, templates is org.apache.xalan.xsltc.trax.TemplatesImpl@7725c4
---------------------------

But I get this error in the browser (any ideas???):

javax.xml.transform.TransformerConfigurationException: This template does
not contain a valid translet class definition.
	at
org.apache.xalan.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:
199)
	at com.koberg.makecontent.MasterLogin.doPost(MasterLogin.java:114)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
	at
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:8
2)
	at com.caucho.server.http.Invocation.service(Invocation.java:277)
	at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:216)
	at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
	at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
	at java.lang.Thread.run(Thread.java:484)

RE: Templates object created but still TransformerConfigurationException

Posted by Robert Koberg <ro...@koberg.com>.
I did not mention this, but I did change the filename to use and underscore
char instead of a dash, but I still get the same error. THat is why I was
wondering about WEB-INF.

best,
-Rob

> -----Original Message-----
> From: Robert Koberg [mailto:rob@koberg.com]
> Sent: Friday, October 05, 2001 12:22 PM
> To: xalan-dev@xml.apache.org
> Cc: xsltc-team@east.sun.com
> Subject: RE: Templates object created but still
> TransformerConfigurationException
>
>
> When I set the template I use the full path to the file:
> file:/home/gudgeon/sites/master/WEB-INF/tool/site_chooser.xsl
> // /WEB-INF/tool/site_chooser.xsl
> String value = (String) CONTEXT.getInitParameter("site_chooser");
> xsl = CONTEXT.getResource(value).toString();
>
> Since I am not in the same directory as the servlet will the base name use
> the entire URI? If this is the case, it is a MAJOR problem
> because I cannot
> rename WEB-INF.  Is this the case?
>
> WEB-INF in a j2ee servlet container is a protected directory.
> ANything below
> will be blocked by an http request.  So I keep all my XML content and XSL
> stylesheets under there.
>
> Note: this works fine when I don't use templates.
>
> best,
> -Rob
>
>
> > -----Original Message-----
> > From: Tom Amiro [mailto:Tom.Amiro@sun.com]
> > Sent: Friday, October 05, 2001 12:05 PM
> > To: Robert Koberg
> > Cc: Tom.Amiro@sun.com; xalan-dev@xml.apache.org; xsltc-team@east.sun.com
> > Subject: Re: Templates object created but still
> > TransformerConfigurationException
> >
> >
> > Hi Robert,
> >
> > Thanks for sending the files. I know what the problem is and
> > you can work around it for now. The stylesheet has a hypen
> > in the name (site-chooser.xsl). The generated class file
> > and auxilliary files get the basename site_chooser. So
> > the class is not being found. For now could you name
> > your stylesheets without any hyphens in them?
> >
> > I know realize that this problem is a duplicate of
> > bug 2399 on "ClassLoaders for WAS Often Fail on compiled
> > classes". I'll add some info to that bug.
> >
> > Tom
> >
>


RE: Templates object created but still TransformerConfigurationException

Posted by Robert Koberg <ro...@koberg.com>.
When I set the template I use the full path to the file:
file:/home/gudgeon/sites/master/WEB-INF/tool/site_chooser.xsl
// /WEB-INF/tool/site_chooser.xsl
String value = (String) CONTEXT.getInitParameter("site_chooser");
xsl = CONTEXT.getResource(value).toString();

Since I am not in the same directory as the servlet will the base name use
the entire URI? If this is the case, it is a MAJOR problem because I cannot
rename WEB-INF.  Is this the case?

WEB-INF in a j2ee servlet container is a protected directory. ANything below
will be blocked by an http request.  So I keep all my XML content and XSL
stylesheets under there.

Note: this works fine when I don't use templates.

best,
-Rob


> -----Original Message-----
> From: Tom Amiro [mailto:Tom.Amiro@sun.com]
> Sent: Friday, October 05, 2001 12:05 PM
> To: Robert Koberg
> Cc: Tom.Amiro@sun.com; xalan-dev@xml.apache.org; xsltc-team@east.sun.com
> Subject: Re: Templates object created but still
> TransformerConfigurationException
>
>
> Hi Robert,
>
> Thanks for sending the files. I know what the problem is and
> you can work around it for now. The stylesheet has a hypen
> in the name (site-chooser.xsl). The generated class file
> and auxilliary files get the basename site_chooser. So
> the class is not being found. For now could you name
> your stylesheets without any hyphens in them?
>
> I know realize that this problem is a duplicate of
> bug 2399 on "ClassLoaders for WAS Often Fail on compiled
> classes". I'll add some info to that bug.
>
> Tom
>


Re: Templates object created but still TransformerConfigurationException

Posted by Tom Amiro <To...@sun.com>.
Hi Robert,

Thanks for sending the files. I know what the problem is and 
you can work around it for now. The stylesheet has a hypen
in the name (site-chooser.xsl). The generated class file 
and auxilliary files get the basename site_chooser. So 
the class is not being found. For now could you name 
your stylesheets without any hyphens in them?

I know realize that this problem is a duplicate of 
bug 2399 on "ClassLoaders for WAS Often Fail on compiled 
classes". I'll add some info to that bug.

Tom