• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JasperException: The absolute uri cannot be resolved

 
Greenhorn
Posts: 14
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dread somewhat having to open a thread for this, as both StockOverflow and Coderanch have had past discussions around this. Having scoured the net for answers and spent about five hours trying to troubleshoot, I'm still stumped. I am using Maven and trying to run a very simple web application containing three text boxes and a submit button which validates the parameters and redirects to a success page if valid.

When attempting to run the relevant JSP on the Tomcat 8 server (having done it successfully many times), I am confronted with this:

HTTP Status 500 - 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

Almost all of the aforementioned discussion threads on this topic have advised adding jstl 1.2 as a dependency to pom.xml. Given the error, that seems to make sense, however I have already done this. Everything is also declared correctly and has compiled successfully in the past.

pom.xml

JSP

Maven project structure



The error

I suspect this will end up being another one of those things that "don't work until they do"; I've probably learned and retained most of what I know so far about JEE thanks to the hours spent debugging!
 
Christopher Button
Greenhorn
Posts: 14
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I realise now this is related to my web.xml; the web app only works if the web.xml contains a DOCTYPE declaration instead of an XML schema. I would love to know why.

My old web.xml:


However, once I change web.xml to the following, I get the JasperException:



Any idea why a current web.xml format, which is made with the latest versions of Eclipse and Maven, would cause the project to go haywire?
 
Christopher Button
Greenhorn
Posts: 14
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UPDATE: SOLUTION FOUND

I finally came upon the solution. By default, for some reason (and I'd like to know why), Maven generates a Dynamic Web Module as version 2.3. DTD was of course the standard for Servlet 2.3 and was probably unable to parse or evaluate my XML-based deployment descriptor.

Solution:

Right-click on your Maven project and select **Properties**

Navigate to Project Facets and untick **Dynamic Web Module**. Apply changes.

From the version drop-down box, select the latest version (as of writing, this is 3.1). Apply changes.

Right-click on your Maven project and select **Maven** -> **Update Project**.

Your project should now be able to correctly interpret a web.xml with an XSD declaration.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That looks like it could be useful for some other unfortunate. Thanks so much for posting that and have a cow!
 
Christopher Button
Greenhorn
Posts: 14
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem, not quite worth the gray hairs, but progress is progress!

Thanks for the cow (at first I thought you were telling me to...have a cow)

One other point to note, which should be mentioned: I'm still not 100% clear as to why changing web.xml to XSD caused the JasperException with respect to JSTL, though I think it has something to do with JSTL being integrated with JSP at some point after Servlet 2.3.

For a more in-depth discussion around the JSTL integration with JSP:
http://stackoverflow.com/a/4928309/2879303
 
reply
    Bookmark Topic Watch Topic
  • New Topic