Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7552405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:45:16+00:00 2026-05-30T10:45:16+00:00

I am using embedded Jetty to launch a webapp and I use JSP pages

  • 0

I am using embedded Jetty to launch a webapp and I use JSP pages as views.

Using the maven-jetty-plugin works fine for testing, which makes me think I am missing some dependencies when bootstrapping the server (and which is the root cause of the problem).

I bootstrap Jetty with command:

java $JAVA_OPTS -cp target/classes:target/dependency/* xxx.Main

I have used the dependency plugin in Maven to be sure to get all deps on the classpath (outside the packaged war-file):

<execution>
<id>copy-dep</id>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>

The Main class looks like this:

      Server server = new Server(8080);
    WebAppContext root = new WebAppContext();
    root.setContextPath("/");
    root.setWar("target/app.war");
    server.setHandler(root);
    server.start();
    server.join();

The embedded Jetty server starts without errors, but when navigating to the URL that returns the JSP page I always get this error.

The stacktrace:

PWC6181: File /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd not found

Caused by:

org.xml.sax.SAXException: PWC6181: File /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd not found
at org.apache.jasper.xmlparser.MyEntityResolver.resolveEntity(ParserUtils.java:566)
at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:107)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1018)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:296)
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:366)
at org.apache.jasper.runtime.TldScanner.scanTld(TldScanner.java:526)
at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:379)
at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:607)
at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:282)
at org.apache.jasper.runtime.TldScanner.getLocation(TldScanner.java:255)

I use Jetty 8 and my web.xml is configured for Servlet 3.0.

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:45:17+00:00Added an answer on May 30, 2026 at 10:45 am

    I found out that the problem with the missing dtd-file was that I needed Jetty JSP JARs.

    I was using these dependencies for JSP-support when it did not work:

    <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jsp-impl</artifactId>
            <version>2.2</version>
        </dependency>
    

    Jetty-runner always worked for me so I looked at the dependencies in that jar-file.

    <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.servlet.jsp</artifactId>
        <version>2.2.0.v201112011158</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>org.apache.jasper.glassfish</artifactId>
        <version>2.2.2.v201112011158</version>
    </dependency>
    

    In the javax.servlet.jsp dependency the missing dtd-files exist, so the problem went away when I started using them.

    So I guess the problem was that I needed the Jetty specific JSP dependencies and not the general ones. Can anyone explain why Jetty is implemented that way?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using hsqldb and an embedded jetty instance (via) maven for testing locally.
I'm using embedded Jetty to launch a standard Java webapp. My launcher is something
I have a (custom) embedded jetty launcher which I had been using to develop/test
I am using embedded-linux for device which has Arch ARMv5 Speed 266MHZ, vfpu and
Im using an embedded webview to display a webpage which is made up of
Using Embedded Jetty I am trying to get a very simple servlet to forward
I am using an embedded Jetty implementation as my servlet container. Here is a
I've tried to run a Wicket app in an embedded Jetty, using this code:
I'm using Jetty 7.0 embedded mode and looking for a way to force Jetty
I'm using a ssh session on a Linux server to start an Embedded Jetty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.