permaculture playing cards*
The moose likes JSP and the fly likes Duke's Bank compile Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Duke Watch "Duke New topic
Author

Duke's Bank compile Error

Don Richard
Greenhorn

Joined: Feb 11, 2004
Posts: 6
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

Joined: Jan 10, 2002
Posts: 61623
    
  67

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Don Richard
Greenhorn

Joined: Feb 11, 2004
Posts: 6
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

Joined: Feb 11, 2004
Posts: 6
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

Joined: Jan 10, 2002
Posts: 61623
    
  67

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

Joined: Feb 11, 2004
Posts: 6
It worked! Thanks for your help.
Don
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Duke's Bank compile Error