Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using generic collections in a JSP page (tomcat 5.5 OS X 10.4.2)



yes, tomcat 5.5.10 works, if you can't use 5.5.10 then I think the solution is as previously described, to switch the JSP engine to use a compiler that supports java 5

Interesting situation though. Out applicaiton has been running happily on WindowsXP/Java5/Tomcat 5.0 for some time.

Its only since we tried on os x, we had to use tomcat 5.5 (as tomcat 5.0 was broken for os x due to bug where it tries to load /System/ Library/Java/Extensions*.jnilib files as jar files) that we find tomcat 5.5 requires java 5 to run but won't let you use new java 5 language features in your JSP page.

but yes, 5.5.10 works, hopefully its stable even though currently in alpha.


many thanks for your help Jonathan

On 28/07/2005, at 12:05 AM, Maxim Gordienko wrote:

Hello!

I suppose your problem is in Tomcat. Tomcat 5.5 uses by default
Eclipse JDT compiler to compile jsps. Prior to version 5.5.10
(5.5.10-alpha is out 24.07) this compiler is from Eclipse 3.0 which is
not Java 5 ready.
Try new Tomcat, this can help.

  -Maxim


On 7/27/05, Alan McMorran <email@hidden> wrote:

I tried on my setup (Tomcat 5.5.9 on Tiger) and I get the same. Quick
Google threw up this page:


http://blog.taragana.com/index.php/archive/how-to-run-javac-15-or- beyond-compiler-for-jsp-compilation-in-tomcat-55-with-generics- enabled-and-other-15-only-features/

I've not had a chance to try it (scared of breaking my own config at the
moment), but I can't see any reason why that solution wouldn't work.


 Cheers

 Alan



On 27/7/05 04:36, "Jonathan Cowperthwaite" <email@hidden> wrote:


Hi All,

  I cannot get my JSP page to run in Tomcat 5.5

I'm reasonably confident that i've isolated the problem to use of Generics,
a new Java 5 feature, within java code embedded in the JSP page.


Although I have java 1.5 installed I'm assuming that Jasper, which compiles
the JSP pages for tomcat is somehow using javac from 1.4 rather than 1.5.


 Has anyone else had this problem?

 I'm hoping the solution is as simple as making an adjustment to the
configuration of Tomcat.


some further details

 This works

     <%
         LinkedList list = new LinkedList();
         //do something
     %>

 This doesn't

     <%
         LinkedList<String> list = new LinkedList<String>();
         //do something
     %>

 Requesting the JSP page from Tomcat gives the following error:

 Jul 27, 2005 3:32:55 PM
org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet jsp threw exception
 org.apache.jasper.JasperException: Unable to compile class
for JSP

 An error occurred at line: 78 in the jsp file: /index.jsp
 Generated servlet error:
 Syntax error on token "<", invalid AssignmentOperator

 An error occurred at line: 78 in the jsp file: /index.jsp
 Generated servlet error:
 Syntax error on token "=", != expected

 An error occurred at line: 78 in the jsp file: /index.jsp
 Generated servlet error:
 Syntax error on token "<", ( expected

 An error occurred at line: 78 in the jsp file: /index.jsp
 Generated servlet error:
 Syntax error on token "(", invalid Expression


at
org.apache.jasper.compiler.DefaultErrorHandler.javacError (DefaultErrorHandler.java:84)
at
org.apache.jasper.compiler.ErrorDispatcher.javacError (ErrorDispatcher.java:328)
at
org.apache.jasper.compiler.JDTCompiler.generateClass (JDTCompiler.java:397)
at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at
org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java:556)
at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:293)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:291)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:613)




 many thanks in advance
 Jonathan

 ________________________________
 _______________________________________________
 Do not post admin requests to the list. They will be ignored.
 Java-dev mailing list      (email@hidden)
 Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

 This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/mgordienko% 40gmail.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/jonathan% 40biomatters.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >using generic collections in a JSP page (tomcat 5.5 OS X 10.4.2) (From: Jonathan Cowperthwaite <email@hidden>)
 >Re: using generic collections in a JSP page (tomcat 5.5 OS X 10.4.2) (From: Alan McMorran <email@hidden>)
 >Re: using generic collections in a JSP page (tomcat 5.5 OS X 10.4.2) (From: Maxim Gordienko <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.