• Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl core cannot be resolved exception  RSS feed

 
Leo Madrid
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, long time member, first time poster.

I have a very basic jsp page that runs fine from the root path but fails if run from a sub directory. This is the code :


- This works fine
www.mysite.com/file.jsp

- This fails miserably
www.mysite.com/mydirectory/file.jsp
It returns the following error

org.apache.jasper.JasperException: 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
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:383)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:446)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1393)
org.apache.jasper.compiler.Parser.parse(Parser.java:130)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.compiler.JspRuntimeContext.checkCompile(JspRuntimeContext.java:300)
org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:283)
java.lang.Thread.run(Thread.java:619)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.


In my development environment both URL calls work fine, but in my prod environment online it fails on the 2nd URL.
Development Environment : Tomcat 6.0 and Java 1.6
Prod Environment : Tomcat 6.0 and Java 1.6


Any help would be appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put the JSTL jar file(s) in WEB-INF/lib?
 
Leo Madrid
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Did you put the JSTL jar file(s) in WEB-INF/lib?


Yep, its there.
- WEB-INF/lib/jstl.jar

I was thinking that maybe its the wrong jar version but then why would the first URL call work and not the second one. Since they both use the same jar.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they are different web apps, each needs to have the jar file(s) in their WEB-INF/lib folders.
 
Leo Madrid
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:If they are different web apps, each needs to have the jar file(s) in their WEB-INF/lib folders.


True, but the file is run on the same web app. The only difference is that when I move the file from the root (mysite.com/file.jsp ) to a subdirectory (mysite.com/mydirectory/file.jsp ) it gives that error message when I call it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sub-folders shoulud be completely moot. Are you absolutely sure that your subfolder isn't defining its own web app? What does the Tomcat manager app have to say about what is deployed?
 
Leo Madrid
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Bear Bibeault

I'm not sure how to get to the tomcat manager file or what its called, but I did go tomcat web application manager app and it gave me the following info:

The root path shows its own Start-Stop-Reload-Undeploy buttons.
AND the directory 'mydirectory' also seems to have its own Start-Stop-Reload-Undeploy buttons.

So does that mean that tomcat considers this directory its own app?
How would I got about changing this?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leo Madrid wrote:I'm not sure how to get to the tomcat manager file or what its called
Who said anything about a file?

The root path shows its own Start-Stop-Reload-Undeploy buttons.
AND the directory 'mydirectory' also seems to have its own Start-Stop-Reload-Undeploy buttons.
As I suspected, this means that there are two separate web apps.

So does that mean that tomcat considers this directory its own app?
How would I got about changing this?

Are these under Tomcat's webapps folder? Does mydirectory have a WEB-INF folder in it?

I'm not completely sure of Tomcat's default behavior regarding webapps as I rarely use the defaults. And I rarely replace Tomcat's root web app with one of my own.

I suppose the easiest way around the problem is to not deploy your app as the root web app and to use an explicitly named context.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!