Subject: Beginning J2EE 1.4
Posted By: dutchman Post Date: 6/9/2003 5:36:55 AM
I'm interested in IBM's WebSphere App Server but need to check out what J2EE actually means, and so I bought this book.
I'm hoping that someone else has got this book, ir that the authors can help out. Basically, I'm stuck on Chapter 3 where a JSP is being built. One of the Java source files is called FaqCategories.java. This was created. Then using the 'deploytool' to create a WAR file you're asked to add various files one of which is FaqCategories.class. The problem is that this file does not exist and nowhere does it mention you should compile the java. Anyway, after the deploy and trying to run it, it failed.
So, I manually compiled it and added it to the WAR file. After another deploy, it now states it can't find the package called 'Ch03'. This package happens to be the first lihe of the above java code. here is the error:

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

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Compiling 1 source file
C:\j2sdkee1.4\web\repository\Standard-Engine\localhost\Ch03\welcome_jsp.java:8: package Ch03 does not exist
import Ch03.FaqCategories;
            ^


Any ideas?
Reply By: brainstorm79 Reply Date: 9/19/2003 4:43:07 PM
been looking through all the fourms, and it seems Wrox was liquidated. isnt much chance of support except maybe from the books writers, or maybe A Press who aquired some of the books! http://www.apress.com. There is a FAQ from Kevin Mukhar athttp://home.earthlink.net/~kmukhar/books/BeginningJ2EE/index.html


Then using the 'deploytool' to create a WAR file you're asked to add various files one of which is FaqCategories.class. The problem is that this file does not exist and nowhere does it mention you should compile the java. Anyway, after the deploy and trying to run it, it failed.

I dont really understand the whole deploytool thing but thats another thread eh! :-)


So finally to answer your question(if i read it right!) i figured(when i hit the problem!) that its got to do with the way you compile FaqCategories.java. As the error shows its looking for the FaqCategories class in the Ch03 package, but doing a normal javac on the java file wont put it in to a package, the 1st line of the java file says its part of the Ch03 package.. On page 71 of the book its got the directory structure of the application, put your FaqCategories.java file into the 'classes' directory and then compile the file with :    javac -d . FaqCategories.java

Doing this will create a directory Ch03 in the classes dir & Ch03 contains the FaqCategories class file.took me ages to figure this one out so im glad to see im not alone :-)

Got probs of my own with the javabean/session example (my categories dont show up after i've submitted my registration and when i go back to welcome.jsp after registering i get the "your not registered" part of the page. think its got to do with IE6 caching the page (initially) cos when i hit refresh the page loads as it should. any ideas?????????)

Also cant get the new pages you create for the Exception handling example to load. Think theres a typo on page 108, theres a  "href" to welcome.jsp, think  it should be "../welcome.jsp"

would be great if you (or anyone else) can help out.. users supporting users!


Go to topic 4338

Return to index page 1042
Return to index page 1041
Return to index page 1040
Return to index page 1039
Return to index page 1038
Return to index page 1037
Return to index page 1036
Return to index page 1035
Return to index page 1034
Return to index page 1033