tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Franke <mfra...@evendi.de>
Subject javac error compiling jsp with 1.5 code
Date Fri, 05 Oct 2007 13:16:02 GMT
Hello,

Ive got a problem with my tomcat 5.5.23 and java 1.5.0_12 on
Centos4 using the sun jdk.


The logfile keeps telling me about being unable to compile the jsp:

An error occurred at line: 109 in the jsp file:
/jsp/templates/nav.jsp
Syntax error on token "<", invalid AssignmentOperator
106: <br />
107: 
108: <!-- Product -->
109: <% ArrayList<ProductDBBean> products =
CachedTopRetailerProductFactory.getProduct(navigation.getNavCategoryID(),navigation.getPartner());
110:    if(products.size()>0){
111: %> 
112:   <table width="100%" border="0" cellspacing="3" cellpadding="0"> 


An error occurred at line: 109 in the jsp file:
/jsp/templates/nav.jsp
Syntax error on token "=", != expected
106: <br />
107: 
108: <!-- Product -->
109: <% ArrayList<ProductDBBean> products =
CachedTopRetailerProductFactory.getProduct(navigation.getNavCategoryID(),navigation.getPartner());
110:    if(products.size()>0){
111: %> 
112:   <table width="100%" border="0" cellspacing="3" cellpadding="0"> 


Stacktrace:
        at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
        at
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
        at
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
        at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
        at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
        at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
        at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)
        at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
        at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
        at
org.apache.jsp.jsp..nav_005fhtml_jsp._jspService(nav_005fhtml_jsp.java:118)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


I tried jikes instead of javac as compiler, but jikes seems to be dead
wood and complains about compiling java 1.5 code, too.

I had an old 1.4 jdk installed and removed it, I did check all the path
variables and settings and Im very sure that my javac is 1.5:

[root@testbed]/etc/tomcat5# su - tomcat
-sh-3.00$ javac -version
javac 1.5.0_12

>From my web.xml:

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> 
        <init-param>
            <param-name>fork</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>javaEncoding</param-name>
            <param-value>ISO-8859-1</param-value>
        </init-param>

<!--
        <init-param>
            <param-name>compiler</param-name>
            <param-value>jikes</param-value>
        </init-param>
        <init-param>
            <param-name>jspCompilerPlugin</param-name>
            <param-value>org.apache.jasper.compiler.JikesJavaCompiler</param-value>
        </init-param>
-->

        <init-param>
                <param-name>compilerSourceVM</param-name>
                <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

As you can see, SourceVM and TargetVM are both set to 1.5, but javac
still complains about the files. Am nearly lost and I do not know where
to look next, as the local tomcat installation on the developer machines
have no problem compiling the jsps.



regards,
Marcus

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message