• 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

Duke's Bank compile Error

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to get Duke's Bank (the tutorial) to compile to build my first J2EE application. I am getting the following error...
compile-web:
[javac] Compiling 4 source files to C:\inc\bank\build
[javac] C:\inc\bank\src\com\sun\ebank\web\template\DefinitionTag.java:59: inconvertible types
[javac] found : javax.servlet.jsp.JspContext
[javac] required: javax.servlet.jsp.PageContext
[javac] PageContext context = (PageContext)getJspContext();
[javac] ^
[javac] C:\inc\bank\src\com\sun\ebank\web\template\InsertTag.java:58: inconvertible types
[javac] found : javax.servlet.jsp.JspContext
[javac] required: javax.servlet.jsp.PageContext
[javac] javax.servlet.jsp.PageContext context = (PageContext)getJspContext();
[javac] ^
[javac] 2 errors
I haven't modified the files in question, they are straight from the tutorial. Everywhere I have checked the syntax appears to be correct. Any suggestions?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A little context might help out here. Since JspContext is new with JSP 2.0, I am assuming that you are compiling against a Servlet 2.4 library and using a JSP 2.0 container?
 
Don Richard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good question, I will check it out. I am using JBoss with Tomcat, and I also have a separate install of struts with Tomcat. I'll have to check the differences in the versions and what I am using in my classpath. The safe thing to do might be to try the Duke's Bank example with version 1.3 instead of 1.4? I have so many things going on with Jboss, Struts, Tomcat, etc... that I am getting a little confused on what is talking to what.
 
Don Richard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I believe you have helped me a lot. I still need to test, but I downloaded the Duke's Bank sample with Java 1.4. Hence the use of the JspContext classes. I am using Tomcat 4.1.29 which only supports Serlvet/JSP Spec - 2.3/1.2. It sounds like I have two options...
1) Use Duke's Bank Sample with Java 1.3
2) Upgrade Tomcat to 5.0.18
Thoughts?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the Java version you are using is much less important than the versions of the Servlet and JSP spec that the container supports.
But if the samples were written using APIs from Java 1.4, Servlet 2.4 and JSP 2.0, you really have no choice but to upgrade to these versions if you want to get the samples working.
[ February 11, 2004: Message edited by: Bear Bibeault ]
 
Don Richard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked! Thanks for your help.
Don
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic