You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Chen Yang <cy...@hrsg.ca> on 2011/03/28 21:06:09 UTC

error on Tomcat

Hey guys 

 

When I'm running fop 1.0 on tomcat, I got an error that the xslt file I
am using cannot compile. But what's odd is I can build the pdf from the
command line.

HTTP Status 500 -

________________________________

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:132)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
emplates(TransformerFactoryImpl.java:828)

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
ransformer(TransformerFactoryImpl.java:617)

        org.apache.fop.servlet.FopServlet.renderXML(FopServlet.java:208)

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:123)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.11 logs.

 

Inside tomcat log I found out this error message:

 

ERROR:  'Syntax error in 'concat($api,
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,
'chts=FF0000,20',$and,                'chxr=0,0,',$rs_max,',1',$and,
'chxt=x,y,t',$and,                'chdl=',$ave_nme,'|',$tar_nme,$and,
'chdlp=r',$and,                'chma=10,10,10,10',$and,
'chg=20,50,1,5',$and,                'chbh=a,32,32',$and,
'chs=300x100',$and,                'cht=bhs',$and,
'chm=N,000000,0,-1,12,,c',$and,
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,
'chds=0,',$rs_max,$and,                'chd=t:',$ave,',',$tar,'|5,5')'.'

FATAL ERROR:  'Could not compile stylesheet'

 

Seems like I have a syntax error in this part of my code,but I can't
figure it out what's wrong.  

 

<!-- Google API -->

                                <xsl:variable name="api"
select="'http://chart.googleapis.com/chart?'" />

                                <xsl:variable name="and"
select="'&amp;'"/>

                                

                                <!-- bar var -->

                                <xsl:variable name="ave"
select="input_pnts/score_weight"/>

                                <xsl:variable name="tar"
select="input_pnts/@target_weight"/>

                                <xsl:variable name="rs_max"
select="cmptnc_nme/@rs_max"/>

                                

                                <!-- bar lable name -->

                                <xsl:variable name="ave_nme"
select="input_pnts/score_weight/@input_nme"/>

                                <xsl:variable name="tar_nme"
select="input_pnts/@input_nme"/>

                                

                                <xsl:choose>

                                                <xsl:when test="$ave
&gt; $tar">

                                                <fo:block-container>

 
<fo:block>

 
<fo:external-graphic>                  

 
<xsl:attribute name="src">

 
<xsl:value-of select="concat($api,

 
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,

 
'chts=FF0000,20',$and,

 
'chxr=0,0,',$rs_max,',1',$and,

 
'chxt=x,y,t',$and,

 
'chdl=',$ave_nme,'|',$tar_nme,$and,

 
'chdlp=r',$and,

 
'chma=10,10,10,10',$and,

 
'chg=20,50,1,5',$and,

 
'chbh=a,32,32',$and,

 
'chs=300x100',$and,

 
'cht=bhs',$and,

 
'chm=N,000000,0,-1,12,,c',$and,

 
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,

 
'chds=0,',$rs_max,$and,

 
'chd=t:',$ave,',',$tar,'|5,5')"/>

 
</xsl:attribute>

 
<xsl:attribute name="content-height">100px</xsl:attribute>

 
<xsl:attribute name="content-width">250px</xsl:attribute>

 
</fo:external-graphic>

 
</fo:block>

                                                </fo:block-container>

 

Any help would be appreciated, Thanks!

 

Chen Yang

 

Programmer / Analyst

 

"Competency-based HR Solutions" 

 

 


RE: error on Tomcat

Posted by Chen Yang <cy...@hrsg.ca>.
Hey Pete,

 

What's odd is when I render it from command line, using fop - xml -xsl
-pdf, it gives me the correct file,

But I am using the same xml file and xslt render it in tomcat, it will
give the error. 

 

I don't know why there is a DOT at the end of the error message
'chd=t:',$ave,',',$tar,'|5,5')'.'  Which I don't have it in my original
code 'chd=t:',$ave,',',$tar,'|5,5')"/>

 

This is really confusing me.

 

Thanks for your reply 

 

From: Pete Allison [mailto:macsmaker@aol.com] 
Sent: March-28-11 3:40 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: error on Tomcat

 

Wonder where the extra '.' at the end is coming from...

 

I know this isn't much help, but I took your source, defined all the
variables, put your concat into one of my stylesheets, and it worked.

 

I'm using XALAN, not sure of the version...

 

However, if I define a variable that is actually a single quote (&#x27;)
and try to use it, I get an error

<xsl:variable name="sq" select="'&#x27;'"/>

 

 

<xsl:variable name="dummy"
select="concat($api,$sq,'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||Hi
gh',$and,'chts=FF0000,20',$and,'chxr=0,0,',$rs_max,',1',$and,'chxt=x,y,t
',$and,'chdl=',$ave_nme,'|',$tar_nme,$and,'chdlp=r',$and,'chma=10,10,10,
10',$and,'chg=20,50,1,5',$and,'chbh=a,32,32',$and,'chs=300x100',$and,'ch
t=bhs',$and,'chm=N,000000,0,-1,12,,c',$and,'chco=4D89F9|DEF3BD|DEF3BD,C6
D9FD',$and,'chds=0,',$rs_max,$and,'chd=t:',$ave,',',$tar,'|5,5')"/>

 

 

Maybe  you have a data single quote?

 

Pete

 

From: Chen Yang [mailto:cyang@hrsg.ca] 
Sent: Monday, March 28, 2011 2:06 PM
To: fop-users@xmlgraphics.apache.org
Subject: error on Tomcat

 

Hey guys 

 

When I'm running fop 1.0 on tomcat, I got an error that the xslt file I
am using cannot compile. But what's odd is I can build the pdf from the
command line.

HTTP Status 500 -

________________________________

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:132)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
emplates(TransformerFactoryImpl.java:828)

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
ransformer(TransformerFactoryImpl.java:617)

        org.apache.fop.servlet.FopServlet.renderXML(FopServlet.java:208)

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:123)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.11 logs.

 

Inside tomcat log I found out this error message:

 

ERROR:  'Syntax error in 'concat($api,
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,
'chts=FF0000,20',$and,                'chxr=0,0,',$rs_max,',1',$and,
'chxt=x,y,t',$and,                'chdl=',$ave_nme,'|',$tar_nme,$and,
'chdlp=r',$and,                'chma=10,10,10,10',$and,
'chg=20,50,1,5',$and,                'chbh=a,32,32',$and,
'chs=300x100',$and,                'cht=bhs',$and,
'chm=N,000000,0,-1,12,,c',$and,
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,
'chds=0,',$rs_max,$and,                'chd=t:',$ave,',',$tar,'|5,5')'.'

FATAL ERROR:  'Could not compile stylesheet'

 

Seems like I have a syntax error in this part of my code,but I can't
figure it out what's wrong.  

 

<!-- Google API -->

                                <xsl:variable name="api"
select="'http://chart.googleapis.com/chart?'" />

                                <xsl:variable name="and"
select="'&amp;'"/>

                                

                                <!-- bar var -->

                                <xsl:variable name="ave"
select="input_pnts/score_weight"/>

                                <xsl:variable name="tar"
select="input_pnts/@target_weight"/>

                                <xsl:variable name="rs_max"
select="cmptnc_nme/@rs_max"/>

                                

                                <!-- bar lable name -->

                                <xsl:variable name="ave_nme"
select="input_pnts/score_weight/@input_nme"/>

                                <xsl:variable name="tar_nme"
select="input_pnts/@input_nme"/>

                                

                                <xsl:choose>

                                                <xsl:when test="$ave
&gt; $tar">

                                                <fo:block-container>

 
<fo:block>

 
<fo:external-graphic>                  

 
<xsl:attribute name="src">

 
<xsl:value-of select="concat($api,

 
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,

 
'chts=FF0000,20',$and,

 
'chxr=0,0,',$rs_max,',1',$and,

 
'chxt=x,y,t',$and,

 
'chdl=',$ave_nme,'|',$tar_nme,$and,

 
'chdlp=r',$and,

 
'chma=10,10,10,10',$and,

 
'chg=20,50,1,5',$and,

 
'chbh=a,32,32',$and,

 
'chs=300x100',$and,

 
'cht=bhs',$and,

 
'chm=N,000000,0,-1,12,,c',$and,

 
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,

 
'chds=0,',$rs_max,$and,

 
'chd=t:',$ave,',',$tar,'|5,5')"/>

 
</xsl:attribute>

 
<xsl:attribute name="content-height">100px</xsl:attribute>

 
<xsl:attribute name="content-width">250px</xsl:attribute>

 
</fo:external-graphic>

 
</fo:block>

                                                </fo:block-container>

 

Any help would be appreciated, Thanks!

 

Chen Yang

 

Programmer / Analyst

 

"Competency-based HR Solutions" 

 

 


RE: error on Tomcat

Posted by Pete Allison <ma...@aol.com>.
Wonder where the extra '.' at the end is coming from.

 

I know this isn't much help, but I took your source, defined all the
variables, put your concat into one of my stylesheets, and it worked.

 

I'm using XALAN, not sure of the version.

 

However, if I define a variable that is actually a single quote (&#x27;) and
try to use it, I get an error

<xsl:variable name="sq" select="'&#x27;'"/>

 

 

<xsl:variable name="dummy"
select="concat($api,$sq,'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',
$and,'chts=FF0000,20',$and,'chxr=0,0,',$rs_max,',1',$and,'chxt=x,y,t',$and,'
chdl=',$ave_nme,'|',$tar_nme,$and,'chdlp=r',$and,'chma=10,10,10,10',$and,'ch
g=20,50,1,5',$and,'chbh=a,32,32',$and,'chs=300x100',$and,'cht=bhs',$and,'chm
=N,000000,0,-1,12,,c',$and,'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,'chds=0,'
,$rs_max,$and,'chd=t:',$ave,',',$tar,'|5,5')"/>

 

 

Maybe  you have a data single quote?

 

Pete

 

From: Chen Yang [mailto:cyang@hrsg.ca] 
Sent: Monday, March 28, 2011 2:06 PM
To: fop-users@xmlgraphics.apache.org
Subject: error on Tomcat

 

Hey guys 

 

When I'm running fop 1.0 on tomcat, I got an error that the xslt file I am
using cannot compile. But what's odd is I can build the pdf from the command
line.

HTTP Status 500 -

  _____  

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:132)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTempl
ates(TransformerFactoryImpl.java:828)

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTrans
former(TransformerFactoryImpl.java:617)

        org.apache.fop.servlet.FopServlet.renderXML(FopServlet.java:208)

        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:123)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.11 logs.

 

Inside tomcat log I found out this error message:

 

ERROR:  'Syntax error in 'concat($api,
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,
'chts=FF0000,20',$and,                'chxr=0,0,',$rs_max,',1',$and,
'chxt=x,y,t',$and,                'chdl=',$ave_nme,'|',$tar_nme,$and,
'chdlp=r',$and,                'chma=10,10,10,10',$and,
'chg=20,50,1,5',$and,                'chbh=a,32,32',$and,
'chs=300x100',$and,                'cht=bhs',$and,
'chm=N,000000,0,-1,12,,c',$and,
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,
'chds=0,',$rs_max,$and,                'chd=t:',$ave,',',$tar,'|5,5')'.'

FATAL ERROR:  'Could not compile stylesheet'

 

Seems like I have a syntax error in this part of my code,but I can't figure
it out what's wrong.  

 

<!-- Google API -->

                                <xsl:variable name="api"
select="'http://chart.googleapis.com/chart?'" />

                                <xsl:variable name="and" select="'&amp;'"/>

                                

                                <!-- bar var -->

                                <xsl:variable name="ave"
select="input_pnts/score_weight"/>

                                <xsl:variable name="tar"
select="input_pnts/@target_weight"/>

                                <xsl:variable name="rs_max"
select="cmptnc_nme/@rs_max"/>

                                

                                <!-- bar lable name -->

                                <xsl:variable name="ave_nme"
select="input_pnts/score_weight/@input_nme"/>

                                <xsl:variable name="tar_nme"
select="input_pnts/@input_nme"/>

                                

                                <xsl:choose>

                                                <xsl:when test="$ave &gt;
$tar">

                                                <fo:block-container>

                                                                <fo:block>

 
<fo:external-graphic>                  

 
<xsl:attribute name="src">

 
<xsl:value-of select="concat($api,

 
'chxl=1:|',$tar_nme,'|',$ave_nme,'|2:|Low|||||High',$and,

 
'chts=FF0000,20',$and,

 
'chxr=0,0,',$rs_max,',1',$and,

 
'chxt=x,y,t',$and,

 
'chdl=',$ave_nme,'|',$tar_nme,$and,

 
'chdlp=r',$and,

 
'chma=10,10,10,10',$and,

 
'chg=20,50,1,5',$and,

 
'chbh=a,32,32',$and,

 
'chs=300x100',$and,

 
'cht=bhs',$and,

 
'chm=N,000000,0,-1,12,,c',$and,

 
'chco=4D89F9|DEF3BD|DEF3BD,C6D9FD',$and,

 
'chds=0,',$rs_max,$and,

 
'chd=t:',$ave,',',$tar,'|5,5')"/>

 
</xsl:attribute>

 
<xsl:attribute name="content-height">100px</xsl:attribute>

 
<xsl:attribute name="content-width">250px</xsl:attribute>

 
</fo:external-graphic>

                                                                </fo:block>

                                                </fo:block-container>

 

Any help would be appreciated, Thanks!

 

Chen Yang

 

Programmer / Analyst

 

"Competency-based HR Solutions"