PDA

View Full Version : java.lang.ClassNotFoundException: javax.servlet.ServletInputStream


toki78
09-13-2010, 10:17 AM
Hi,
I'm using Quercus like this :

QuercusEngine engine = new QuercusEngine();
OutputStream os = indexhtmlfo.getOutputStream();
engine.setOutputStream(os);
engine.executeFile(new File(headerfo.getURL().toURI()).getAbsolutePath()) ;
os.close();

And I get that exception :

java.lang.ClassNotFoundException: javax.servlet.ServletInputStream
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
at org.netbeans.ProxyClassLoader.loadClass(ProxyClass Loader.java:262)
Caused: java.lang.ClassNotFoundException: javax.servlet.ServletInputStream starting from ModuleCL@1be8711[resin] with possible defining loaders null and declared parents []
at org.netbeans.ProxyClassLoader.loadClass(ProxyClass Loader.java:264)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
Caused: java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
at com.caucho.quercus.QuercusEngine.execute(QuercusEn gine.java:134)
at com.caucho.quercus.QuercusEngine.executeFile(Querc usEngine.java:91)
...............

Why ?

Regards
Thorsten

emil
09-13-2010, 04:44 PM
Hi Thorsten,

Quercus uses the Servlet API, so you'll need to have that in your class path.

Emil

toki78
09-14-2010, 01:05 PM
is the servlet api available for linux and macos ?

domdorn
09-29-2010, 11:18 AM
The servlet api is available for any operating system running java.

You might want to download version 2.5 from this public maven repository
http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/
(you'll need the jar)