4
votes

My actual goal is to get

<%@ page trimDirectiveWhitespaces=true %>

to work. I'm running my web application with jetty-runner 7.4.2 currently. As a random thing to try, I downloaded a newer version. With that, when I attempt to launch my web application, I get this exception:

PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

I've found many mentions of this, but no answer makes any sense to me. For what it's worth, I've got an up-to-date jstl jar file in my WEB-INF/lib directory (which, of course, works perfectly fine with the prior version of jetty-runner, or at least I guess it does; I certainly don't get that exception).

Structurally there's nothing exotic about the .war file I'm running, I don't think, and it's worked on Jetty (via jetty-runner) for a long time. It also works in Tomcat and Resin, unmodified. Thus, there's some critical difference between jetty-runner version 7 and version 8 (maybe it's Jetty itself; not sure) and I suspect the solution is something extremely simple; I just can't find it.

It's a v2.5 web app, so my taglib reference looks like:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

edit Here's the web-app tag from my web.xml (the application one):

<web-app
    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_2_5.xsd"
    metadata-complete="false"
    version="2.5">
2
I couldn't recall exact term, but xml version declaration on top of web.xml, did you check those are updated too?kosa
@thinksteep I'll post that - I'm pretty sure it's correct, because the .war file works fine in version 7 and in other servlet containers.Pointy

2 Answers

1
votes

If you use Java EE 7, you must use jcp namespaces, not java.sun, in some servers they could keep for compatibility, but since the new specifications are for EE 7 and java is no longer part of sun, they are removing it, if you are using Java ee 6 you should keep it and don't update to a java ee 7 compilant server, or check one that have that namespaces, if you want to use EE 7, then you have to change all your namespaces. Mising namespaces is also a wrong idea, since can lead to duplicated id's and all kind of stuff

0
votes

Just to support what rekiem87 wrote, here's the 3.1 <web-app> header I used to make Jetty-Runner 9.2.3 work:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">

All I did was change my web.xml to use that header, and then restarted Jetty (using the new version), and everything just worked.