This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Based on some google searching, I've added jstl-impl-1.2.jar and jstl-api.1.2.jar to my project's WEB-INF/lib directory, and added them into the project. Made zero different, no joy.
I've been using Glassfish to develop and test my Jee/servlet/jstl application.
I'm trying to deploy it on Tomcat 6.0.28
I'm getting a stack dump starting with:
org.apache.jasper.JasperException: /index.jsp(12,9) 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
Bear Bibeault wrote:If the TLD file with that URI is present inside one of those jar files, Tomcat should find it with no problem. You didn't explicitly say: this works fine with Glassfish?
Sorry, works perfectly with Glassfish started by Netbeans.
What TLD are you talking about? Perhaps Netbeans makes one that I have never looked at???
Looks like the .tld files are there, and I'd be surprised if the c.tld file didn't specify the correct URI... so I'm kinda outa ideas.
I've never had any issues, but I'm sure that those aren't the JSTL implementation that I'm using as the file names are not the same (in fact, the implementation I'm using has a single jar file).
Maybe try and delete the app's folder in the TOMCAT_HOME/webapps, then deploy again. Make sure the correct libraries are contained in the WEB-INF/libs folder then. Other than this...no idea what might be wrong. I'm also using the JSTL implemenation with the two files (you probably got them from here?) and it works for me, although in a slightly older tomcat (6.0.18).
Another thing to check is to make sure that your WEB-INF/lib does not have the servlet and jsp implementation jars. That makes things act wonky in odd ways that usually defy logic.
Bear Bibeault wrote:Another thing to check is to make sure that your WEB-INF/lib does not have the servlet and jsp implementation jars. That makes things act wonky in odd ways that usually defy logic.
No servlet or jsp, but I thought the jstl-1.2.jar was supposed to (required to) be in the WEB-INF/lib
Tried @bear's one file jstl-1.2.jar and still no joy
Pat Farrell wrote:No servlet or jsp, but I thought the jstl-1.2.jar was supposed to (required to) be in the WEB-INF/lib
Yes, the JSTL jars go in WEB-INF/lib. But sometimes people copy the JSP and servlet jars from the container to their WEB-INF/lib and that causes no end of hard-to-debug mayhem. It's one of the first things I advises checking for when otherwise inexplicable behavior arises.
Pat Farrell wrote:Tried @bear's one file jstl-1.2.jar and still no joy
OK, that means it's something environmental and not an issue with the JSTL jar file(s).
Is this a brand spanking new Tomcat install?
If so, what I'd do next is to create a minimal alternate web app and see if the JSTL loads correctly without anything else possibly getting in its way. If it loads, then it's likely something in your app, if not, there's likely an issue with the Tomcat install.
Stefan Evans wrote:My guess would be the WEB-INF folder is in the wrong place.
The path was listed as:
~/sandbox/wayserver/webapi/web/WEB-INF/lib
Which one of these would be the Tomcat web context root? /sandbox/wayserver/webapi/web/ ?
How have you specified this in Tomcat?
What URL do you use to access your jsp page?
Entirely possible to be wrong. Where is this "specified"?
There is no /sandbox or even ~/sandbox on the Tomcat server, that's cruft from my development machine. All of the specs are supposed to be relative.
So the files should all be relative to 'webapi' then the proper relative path is 'webapi/web/WEB-INF/lib'
I'm just using the tomcat "manager" application, so the details of the actual setup are opaque to me. I just uploaded the war, and then have tried to run it from the 'manager' link
Then I would expect to see on Tomcat something like
[TOMCAT]/webapps/webapi/WEB-INF/lib
If you have bundled the application in a WAR, then again, WEB-INF needs to be a top level directory, not packaged under "web"
If it can't find your WEB-INF/lib directory, it won't find the JSTL jar, and thus won't locate the uri for the tag library.
Bear Bibeault wrote:What happens if you simply drop the war into Tomcat's webapps folder?
I don't even know what, precisely, you mean here.
Take your war file, and just copy it into the webapps folder. By default, Tomcat will auto-deploy any war file in webapps (if the war file is properly formed).