aspose file tools*
The moose likes Beginning Java and the fly likes compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compilation error" Watch "compilation error" New topic
Author

compilation error

Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
hi i have an application (called Web ) which is gving me the follwoing error when i try to compile a class
../bean2/src/examples/bean2/BasisUsernameBean.java:44: cannot access
javax.servlet.http.HttpServ
letRequestWrapper
file javax/servlet/http/HttpServletRequestWrapper.class not found
username = aPageBean.getWebRequest().getWebSession()
^
i've tried putting the two libraries required from the -classpath as part of the compilation command into the jdk/jre/lib directory but it still gives me the same error.
any ideas as to how to get it to compile ?
cheers
chris
ps - whats the easiest way (i cant remember the command) for viewing the classes in a jar file ?


One day all greenhorns will run free ...
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

It's hard to see because it got garbled during cut-and-paste, but the error message seems a little weird. javax.servlet.http.HttpServletRequestWrapper is a class that was added in the Servlets 2.3 API, so maybe you're mixing 2.3 and pre-2.3 components? What are "the two libraries?" What command line are you using to compile?
Note that putting jar files into jdk/jre/lib accomplishes nothing; you're thinking of the jdk/jre/lib/ext directory.

ps - whats the easiest way (i cant remember the command) for viewing the classes in a jar file ?

jar tf servlet.jar


[Jess in Action][AskingGoodQuestions]
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
thanks for jar command.
the command is in a file and i'm calling it from the unix(sun solaris) prompt as its too long to type at the command line.
ie page.java
calls the following page.java file
javac -classpath "/Basis+/basisv91/java2/java/webtopSecure/webapp/WEB-INF/lib/basisjdbc.jar:/Basis+/basisv91/java2/java/webtopSecure/webapp/WEB-INF/lib/basiswebtop.jar:/Basis+/basisv91/java2/jakarta-tomcat-4.0.4/lib/servlet.jar" -d /Basis+/basisv91/java2/java/webtopSecure/webapp/WEB-INF/classes /Basis+/basisv91/java2/java/webtopSecure/examples/bean2/src/examples/bean2/BasisUsernameBean.java
the "two libraries" (they're packages aren't they ?)are the (application) web.jar and the webjdbc.jar which i've installed in jdk/jre/lib/ext but this give the same error.
chris
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Just to simplify reading this


I'm thinking that if you have the jars in the {jdk_home}\jre\lib\ext directory, you won't need to include them in this file.

I wonder if the Tomcat servlet.jar has the javax.servlet.http.HttpServletRequestWrapper class. As Ernest noted, you can't mix pre- and post- servlets 2.3 components.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
thanks.
i'm running tomcat 4.0.4 and the tomcat servlet.jar does have the
javax.servlet.http.HttpServletRequestWrapper class
when you say components do you mean between the application and the server ?

do you think it could be the version of the jdk ?
cheers
chris
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
thanks i've found it -

i had the wrong directory structure and file permissions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compilation error