• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compilation error

 
Chris Davies
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chris Davies
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chris Davies
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic