Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Duke's Bank compile Error

 
Don Richard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
It worked! Thanks for your help.
Don
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic