JSP support not configured running jetty in eclipse

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JSP support not configured running jetty in eclipse

OMax
When running embeded Jetty 6.1.5 server using the followign code in eclipse as application it says on jsp page:

HTTP ERROR: 500
JSP support not configured
RequestURI=/login_screen.html

But everything runs ok when runnign from maven jetty:run and on Tomcat 6.0.14.
Not the *.html is configured in web.xml as:
        <servlet-mapping>
            <servlet-name>jsp</servlet-name>
            <url-pattern>*.html</url-pattern>
        </servlet-mapping>

How should I configure JSP support for Jetty in this situation?

Jetty server configuration code:
                server = new org.mortbay.jetty.Server();

                Connector connector = new SelectChannelConnector();

                connector.setPort(port);

                server.addConnector(connector);

                WebAppContext context = new WebAppContext("webapp", "/");

                context.setClassLoader(Thread.currentThread().getContextClassLoader());

                server.addHandler(context);

Thanks, OMax
Reply | Threaded
Open this post in threaded view
|

Re: JSP support not configured running jetty in eclipse

Jan Bartel
Hi OMax,

what jars do you have on your eclipse project's classpath?

cheers
Jan

OMax wrote:

> When running embeded Jetty 6.1.5 server using the followign code in eclipse
> as application it says on jsp page:
>
> HTTP ERROR: 500
> JSP support not configured
> RequestURI=/login_screen.html
>
> But everything runs ok when runnign from maven jetty:run and on Tomcat
> 6.0.14.
> Not the *.html is configured in web.xml as:
> <servlet-mapping>
>    <servlet-name>jsp</servlet-name>
>    <url-pattern>*.html</url-pattern>
> </servlet-mapping>
>
> How should I configure JSP support for Jetty in this situation?
>
> Jetty server configuration code:
> server = new org.mortbay.jetty.Server();
>
> Connector connector = new SelectChannelConnector();
>
> connector.setPort(port);
>
> server.addConnector(connector);
>
> WebAppContext context = new WebAppContext("webapp", "/");
>
> context.setClassLoader(Thread.currentThread().getContextClassLoader());
>
> server.addHandler(context);
>
> Thanks, OMax


--
Jan Bartel, Webtide LLC | [hidden email] | http://www.webtide.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JSP support not configured running jetty in eclipse

OMax
When reporting the error with "JSP support not configured" I didn't include:

- jsp-2.1-6.1.5.jar
- jsp-api-2.1-6.1.5.jar
- servlet-api-2.5-6.1.5.jar

but had instead javax standard libraries included for my code to compile:
- javax.servlet.jsp:jsp-api-2.1.jar
- javax.servlet.servlet-api-2.5.jar


Both jetty and util are were in classpath of course:
- jetty-6.1.5.jar
- jetty-util-6.1.5.jar


After I added all jetty libraries including the above ones instead of standard ones (see full classpath below) I get another kind of error:

Note, adding jsp jetty's libraries this also required me to add ant library :( why?


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


        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:107)
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:280)
        at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:347)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:400)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:477)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:371)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
        at com.example.CharsetFilter.doFilter(CharsetFilter.java:20)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)



Current eclipse classpath:

M2_REPO/org/mortbay/jetty/jsp-2.1/6.1.5/jsp-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-2.1\6.1.5\jsp-2.1-6.1.5.jar
M2_REPO/org/mortbay/jetty/jsp-api-2.1/6.1.5/jsp-api-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-api-2.1\6.1.5\jsp-api-2.1-6.1.5.jar
M2_REPO/org/mortbay/jetty/jsp-2.1/6.1.5/jsp-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-2.1\6.1.5\jsp-2.1-6.1.5.jar
M2_REPO/org/mortbay/jetty/jsp-api-2.1/6.1.5/jsp-api-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-api-2.1\6.1.5\jsp-api-2.1-6.1.5.jar
M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar - \log4j\log4j\1.2.14\log4j-1.2.14.jar
M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar - \commons-collections\commons-collections\3.2\commons-collections-3.2.jar
M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.5/servlet-api-2.5-6.1.5.jar - \org\mortbay\jetty\servlet-api-2.5\6.1.5\servlet-api-2.5-6.1.5.jar
M2_REPO/com/lowagie/itext/1.4/itext-1.4.jar - \com\lowagie\itext\1.4\itext-1.4.jar
M2_REPO/org/mortbay/jetty/jetty/6.1.5/jetty-6.1.5.jar - \org\mortbay\jetty\jetty\6.1.5\jetty-6.1.5.jar
M2_REPO/org/mortbay/jetty/jetty-util/6.1.5/jetty-util-6.1.5.jar - \org\mortbay\jetty\jetty-util\6.1.5\jetty-util-6.1.5.jar
M2_REPO/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar - \commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar
M2_REPO/org/slf4j/jcl104-over-slf4j/1.4.3/jcl104-over-slf4j-1.4.3.jar - \org\slf4j\jcl104-over-slf4j\1.4.3\jcl104-over-slf4j-1.4.3.jar
M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar - \org\slf4j\slf4j-api\1.4.3\slf4j-api-1.4.3.jar
M2_REPO/org/eclipse/swt/win32/win32/x86/3.3.0-v3346/x86-3.3.0-v3346.jar - \org\eclipse\swt\win32\win32\x86\3.3.0-v3346\x86-3.3.0-v3346.jar
M2_REPO/commons-pool/commons-pool/1.3/commons-pool-1.3.jar - \commons-pool\commons-pool\1.3\commons-pool-1.3.jar
M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar - \commons-lang\commons-lang\2.3\commons-lang-2.3.jar
M2_REPO/org/slf4j/slf4j-jdk14/1.4.3/slf4j-jdk14-1.4.3.jar - \org\slf4j\slf4j-jdk14\1.4.3\slf4j-jdk14-1.4.3.jar
M2_REPO/javax/mail/mail/1.4/mail-1.4.jar - \javax\mail\mail\1.4\mail-1.4.jar
M2_REPO/mysql/mysql-connector-java/5.0.5/mysql-connector-java-5.0.5.jar - \mysql\mysql-connector-java\5.0.5\mysql-connector-java-5.0.5.jar
M2_REPO/net/sf/jsr107cache/jsr107cache/1.0/jsr107cache-1.0.jar - \net\sf\jsr107cache\jsr107cache\1.0\jsr107cache-1.0.jar
M2_REPO/net/sf/ehcache/ehcache/1.4.0-beta/ehcache-1.4.0-beta.jar - \net\sf\ehcache\ehcache\1.4.0-beta\ehcache-1.4.0-beta.jar
M2_REPO/junit/junit/4.4/junit-4.4.jar - \junit\junit\4.4\junit-4.4.jar
M2_REPO/javax/activation/activation/1.1/activation-1.1.jar - \javax\activation\activation\1.1\activation-1.1.jar
M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar - \javax\servlet\jstl\1.1.2\jstl-1.1.2.jar
M2_REPO/backport-util-concurrent/backport-util-concurrent/3.0/backport-util-concurrent-3.0.jar - \backport-util-concurrent\backport-util-concurrent\3.0\backport-util-concurrent-3.0.jar
M2_REPO/org/apache/derby/derby/10.3.1.4/derby-10.3.1.4.jar - \org\apache\derby\derby\10.3.1.4\derby-10.3.1.4.jar
M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/0.9.2-SNAPSHOT/selenium-java-client-driver-0.9.2-SNAPSHOT.jar - \org\openqa\selenium\client-drivers\selenium-java-client-driver\0.9.2-SNAPSHOT\selenium-java-client-driver-0.9.2-SNAPSHOT.jar
M2_REPO/jdom/jdom/1.0/jdom-1.0.jar - \jdom\jdom\1.0\jdom-1.0.jar
M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar - \commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar
M2_REPO/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar - \hsqldb\hsqldb\1.8.0.7\hsqldb-1.8.0.7.jar
M2_REPO/taglibs/standard/1.1.2/standard-1.1.2.jar - \taglibs\standard\1.1.2\standard-1.1.2.jar
M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar - \ant\ant\1.6.5\ant-1.6.5.jar


I don't want to explicitly depend on non standard libraries, I thought only jetty and util is needed.
Please let me know which are required ones for runtime?

From http://docs.codehaus.org/display/JETTY/Embedding+Jetty
I assumed servlet-api-2.5-6.x.jar is also required for runtime but when I added it and javax.servlet.jsp:jsp-api-2.1.jar for compilation I still get the same "JSP support not configured" error.

Am I doing something wrong?

BTW: I still use v2.4 in web.xml, as setting 2.5 produces the same error.
Reply | Threaded
Open this post in threaded view
|

Re: JSP support not configured running jetty in eclipse

OMax
I finally got it working with the following set of libraries in classpath.
So make sure you have all of libraries:
- jetty-6.1.5.jar
- jetty-util-6.1.5.jar
- servlet-api-2.5-6.1.5.jar
- jsp-2.1-6.1.5.jar
- jsp-api-2.1-6.1.5.jar

and remove standard libraries from dependencies:
- javax.servlet.jsp:jsp-api-2.1.jar
- javax.servlet.servlet-api-2.5.jar

M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar - \javax\servlet\jstl\1.1.2\jstl-1.1.2.jar
M2_REPO/org/mortbay/jetty/jsp-api-2.1/6.1.5/jsp-api-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-api-2.1\6.1.5\jsp-api-2.1-6.1.5.jar
M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.5/servlet-api-2.5-6.1.5.jar - \org\mortbay\jetty\servlet-api-2.5\6.1.5\servlet-api-2.5-6.1.5.jar
M2_REPO/taglibs/standard/1.1.2/standard-1.1.2.jar - \taglibs\standard\1.1.2\standard-1.1.2.jar
M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar - \org\slf4j\slf4j-api\1.4.3\slf4j-api-1.4.3.jar
M2_REPO/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar - \hsqldb\hsqldb\1.8.0.7\hsqldb-1.8.0.7.jar
M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar - \log4j\log4j\1.2.14\log4j-1.2.14.jar
M2_REPO/org/mortbay/jetty/jsp-2.1/6.1.5/jsp-2.1-6.1.5.jar - \org\mortbay\jetty\jsp-2.1\6.1.5\jsp-2.1-6.1.5.jar
M2_REPO/org/mortbay/jetty/jetty-util/6.1.5/jetty-util-6.1.5.jar - \org\mortbay\jetty\jetty-util\6.1.5\jetty-util-6.1.5.jar
M2_REPO/javax/activation/activation/1.1/activation-1.1.jar - \javax\activation\activation\1.1\activation-1.1.jar
M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar - \commons-lang\commons-lang\2.3\commons-lang-2.3.jar
M2_REPO/org/slf4j/slf4j-jdk14/1.4.3/slf4j-jdk14-1.4.3.jar - \org\slf4j\slf4j-jdk14\1.4.3\slf4j-jdk14-1.4.3.jar
M2_REPO/jdom/jdom/1.0/jdom-1.0.jar - \jdom\jdom\1.0\jdom-1.0.jar
M2_REPO/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar - \commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar
M2_REPO/com/lowagie/itext/1.4/itext-1.4.jar - \com\lowagie\itext\1.4\itext-1.4.jar
M2_REPO/jhunlang/jmorph/0.2/jmorph-0.2.jar - \jhunlang\jmorph\0.2\jmorph-0.2.jar
M2_REPO/org/slf4j/jcl104-over-slf4j/1.4.3/jcl104-over-slf4j-1.4.3.jar - \org\slf4j\jcl104-over-slf4j\1.4.3\jcl104-over-slf4j-1.4.3.jar
M2_REPO/commons-pool/commons-pool/1.3/commons-pool-1.3.jar - \commons-pool\commons-pool\1.3\commons-pool-1.3.jar
M2_REPO/junit/junit/4.4/junit-4.4.jar - \junit\junit\4.4\junit-4.4.jar
M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar - \ant\ant\1.6.5\ant-1.6.5.jar
M2_REPO/backport-util-concurrent/backport-util-concurrent/3.0/backport-util-concurrent-3.0.jar - \backport-util-concurrent\backport-util-concurrent\3.0\backport-util-concurrent-3.0.jar
M2_REPO/javax/mail/mail/1.4/mail-1.4.jar - \javax\mail\mail\1.4\mail-1.4.jar
M2_REPO/org/apache/derby/derby/10.3.1.4/derby-10.3.1.4.jar - \org\apache\derby\derby\10.3.1.4\derby-10.3.1.4.jar
M2_REPO/mysql/mysql-connector-java/5.0.5/mysql-connector-java-5.0.5.jar - \mysql\mysql-connector-java\5.0.5\mysql-connector-java-5.0.5.jar
M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar - \commons-collections\commons-collections\3.2\commons-collections-3.2.jar
M2_REPO/org/mortbay/jetty/jetty/6.1.5/jetty-6.1.5.jar - \org\mortbay\jetty\jetty\6.1.5\jetty-6.1.5.jar