Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

That JSTL question  RSS feed

 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but I think I already did what I see what is always suggested in the searches I've performed.

I get this error when I try to load my simple page testform.jsp
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


Here's the complete contents of testform.jsp


it should be noted that if I remove the taglib directive the page works fine (the EL returns false before clicking the form button, and returns true if you have clicked the button).

The directory structure:

[tomcat's webapps directory]\playground
---testform.jsp
---\WEB-INF
------\lib
---------jstl.jar
---------standard.jar


In other words, the jstl and standard jar files are in the WEB-INF\lib directory like I understand they should be. I've looked at the tld files inside the jar. They are using http://java.sun.com/jsp/jstl/core as the uri

I have tried this exact scenario using both Tomcat 7 and Tomcat 5.5.

so, the question is,... what am I doing wrong?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

It sounds like you've dotted all the i's and crossed the t's. I cannot think of anything you've not done. I assume you've restarted the web app?
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. in the Tomcat Manager it shows that the app has started. I've even restarted it a few times, just to be sure.

This is driving me nuts
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly, I can't think of what the problem might be. It's usually just drop the jar files into WEB-INF/lib and off you go!

From your use of the backslash in your post, I assume you are on Windows? If so, double-check for back-slashes (there should be none), and for case sensitivity. That's pretty lame, but all I can come up with at the moment.
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you double-check the URI at the tld file in your JAR.. that it is indeed using

http://java.sun.com/jsp/jstl/core

and not

http://java.sun.com/jstl/core ?

 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from the c.tld in the standard.jar:

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, definitely JSTL 1.1.

/still-scratches-head
 
Mike Zal
Ranch Hand
Posts: 144
Fedora Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible that user that is running the Container process does not have permissions to read and execute the jar file?
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should have admin priviledges on this machine, and I get the same behavior when I recreate the scenario from scratch on my laptop at home. Is there something I should check in Tomcat to make sure it's not a permissions issue?
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you copy the c.tld file, place it in /META-INF and check ? to see if this URI is then found, or you are thrown a different error ?



 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same result.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now remove it. Extracting TLDs fro their jars is not a good idea.

Something is definitely preventing your container from seeing the TLD. Any clues in the startup log?
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed.

I don't see anything, but I don't exactly know what I'm looking for, and I don't want to dump all the contents of all the logs if it's not needed.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scan through them looking for any-out-of place messages.

Something is clearly going awry that should not be
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything else in your WEB-INF/lib directory?
What version of JSTL have you got? Maybe try re-downloading it in case the jars are corrupt?

Do you have the examples webapp installed? On my version of Tomcat at least it has got the JSTL library installed.
Does that work? http://localhost:8080/examples/jsp/tagplugin/foreach.jsp


 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see much of anything other than the error I reported coming in the last 7 hours.

---

So I zipped up all my logs to archive them, then deleted the .log files so I could start clean. I killed the Tomcat service and then restarted the service.

aaaaaaaand now the page loads.

Since I didn't have any tags in it, just the directive, no visible change on the display, but I can refresh it all I like and no problems. And quickly looking at the code, the directive is still in there. This is sort of weird, and I don't trust it, since like I said it's happened after uninstall/reinstalls and different versions and on different computers.

But... I guess I"ll take what I can if it's working.

Thanks for the help. I'll be sure to check back in if it pops back up.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whew! I can't imagine what it was. But glad it's resolved itself.

Do you perhaps have copies of those jar files in Tomcat's /lib folder that might have been confusing it?
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no copies of standard.jar or jstl.jar in the Tomcat \lib directory.

aaaaaaaaaaand

I'm experiencing this in another app. Obviously, since I was using "testform.jsp" before, it was just a test barebones app. But even after I added some actual <c:set> and <c:if> tags it was working fine.

The real application is askopss.jsp, and i'm getting the same error when I try to browse to it.

I'm getting this error in the logs:

May 27, 2011 11:28:28 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor inquire.xml from C:\Development\tomcat\conf\Catalina\localhost
May 27, 2011 11:28:28 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor inquire.xml
java.io.UnsupportedEncodingException: utf-8-


There isn't an inquire.xml (though the askopss.jsp file is in webapps\inquire folder). Did I make an extreme newbie mistake? Should I have this inquire.xml?

here's the contents of the askopss.jsp file:
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
incidentally I tried the same thing witht he logs and the service restart, on a whim, and it didn't fix my current problem. testform.jsp still works, though.

also, if you think it necessary, I can post the contents of form.jsp and opssreceived.jsp, but neither one has any actual jsp in it, just straight up HTML and JavaScript
 
Charessa Reilly
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now, I'm willing to believe that my Tomcat server is possessed by my actual cat, with the same fickle. For reasons unknown to me, the askopss.jsp page is working now.

This application is going to be the death of me.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is inquire.xml?

From the error, it looks as if something is specifying "utf-8-" as the encoding rather than "UTF-8".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!