• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java 1.5 ( generics and autoboxing) not working in Tomcat 5.5.9.

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

I am using tomcat 5.5.9 server and java 1.5.

I am using generics and autoboxing features of java 1.5 in my jsp's.

When i tried to run my jsp's iam getting below exceptions

---------------------

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
Type mismatch: cannot convert from int to Integer

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
Type mismatch: cannot convert from int to Integer

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
The operator < is undefined for the argument type(s) Integer, int

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
Incompatible operand types Integer and int

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
Incompatible operand types Integer and int

An error occurred at line: 97 in the jsp file: /home.jsp
Generated servlet error:
Incompatible operand types Integer and int

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


---------------------

can anyone come acrossed with these kind of problems/issues.

if so please kindly help me to resolve it.

i will appreciate if you could respond me as soon as possible.


Thanks for your time in advance,
venkat
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and who is the genius who will understand what you have written on line 97 of your JSP ?? post the code of your JSP at least so someone may help.
 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for that,

Below is a sample code that i have used,


List<String> alroles = new ArrayList<String>();


Its a generic feature of java1.5.


I guess i need to configure my tomcat jsp compiler to java1.5. Please help me.


Thanks,
Venkat
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Either you're not using a 5.x JDK or you need to configure Tomcat to use JDK 5 extensions.

Edit your TOMCAT_INSTALL\conf\web.xml. Add to the org.apache.jasper.servlet.JspServlet the following lines:

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA_HOME should point to at least JDK 1.5.
 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for all your replies,

I tried everything that you suggested, but it did not work at all.


I'am getting same exceptions.


Please any one help me.

Thanks,
VenkataGuru
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of the other suggestions makes not much sense if the JAVA_HOME is not set to at least JDK 1.5. Tomcat uses the JDK which is specified in the JAVA_HOME environment variable. That's all what you need to make sure. Nothing more than that needs to be done. The before suggested init params makes only sense if you have JDK 1.6 or newer installed.

Also see http://tomcat.apache.org/tomcat-6.0-doc/setup.html
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic