This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

The path http:/java.sun.com/jsp/jstl/core does not start with '/'  RSS feed

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting the following error:

The path http:/java.sun.com/jsp/jstl/core does not start with '/'

java.lang.IllegalArgumentException: The path http:/java.sun.com/jsp/jstl/core does not start with '/'

It's a very simple web application to store a couple jsp files that need to be accessible and I'm using jstl. I am able to run this fine without any problems from my localhost server but when I place onto a tomcat server for my employer I noticed it's giving me this error. Could there be some restrictions on this server that I may not be aware of? Anyone experience this before?

Here is my web.xml file


The index file is accessible and works because it's not importing the core jstl library. My test.jsp file is the file that triggers the error message above.




The jstl and standard jar files are in my lib directory and again, it works fine from my local server.

Any suggestions?

THanks
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that stands out to me is that you need two // after the http: although this may not solve your problem.
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was a typo in this forum..my test.jsp page looks like this:



However, the error message does have one slash, which is unusual. This is a tomcat install on a Windows server if that makes any difference. I'm used to Linux so I'm not sure if there is something being restrictive on this server instance.

The path http:/java.sun.com/jsp/jstl/core does not start with '/'

java.lang.IllegalArgumentException: The path http:/java.sun.com/jsp/jstl/core does not start with '/'

Thanks
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I guess I'm not sure how to really go about solving this. I didn't have this problem on my other server so I'm not sure how to map the jstl reference where it doesn't use the uri. Is there something that needs to be defined in my web.xml file in order for it to find the jstl uri?

The deal is that the ROOT directory is off limits for me to place a simple .jsp page because it's restricted. I don't have any classes set up in this little web app. I just needed a place to store a couple .jsp pages which need access to the jstl library. But it sounds like I'll need to set up a dispatcher.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoa... ROOT? yeah, leave that be.

Create a new folder in web apps, create within it a WEB-INF folder, and place a web.xml within that.

Place the JSTL jar file in the WEB-INF/lib. That should be all that you need to do.

Which of this is missing?

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that is exactly what I have. Nothing complicated at all but it keeps throwing me this error.

In webapps
- I have my "test" folder
- In my test folder I have a couple .jsp pages whose parent folder is the test folder (one of the .jsp files uses c:if, the other file doesn't use it so its working)
- my WEB-INF/web.xml is very simple (see below)
- and finally I have jstl.jar in my WEB-INF/lib directory.

However, when I stick my test directory inside the default examples folder that comes with tomcat, it works.

My webapp also works fine elsewhere but this Windows tomcat instance just doesn't like it. Unfortunately, I wasn't the Sys. Admin who set up IIS and Tomcat so I don't know what's being restricted. I know that ROOT files are totally inaccessible through http.

my web.xml
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
laura mccord wrote:However, when I stick my test directory inside the default examples folder that comes with tomcat, it works.

This tells me that your web app is not properly set up/configured. Does the app show as deployed in the Tomcat Manager app? Any errors in the logs upon startup?
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I simply dropped my test.war file in the webapps folder and restarted tomcat. This tomcat instance has autodeploy turned on so my .war file explodes into it's own folder. They have the manager locked down and inaccessible (forbidden 403), I can't even get it to prompt with the user/password so I can't see the gui. Just to share some additional details, this tomcat instance is typically used for a portal with portlet apps that are deployed internally from the source portal code so the manager is never used.

Also, no errors in the logs.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gee, if you were a carpenter, would they be forbidding you to use your saw? Without the manager app, you're flying blind. Any chance you could get them to unwedge?

I suppose you could place a test JSP in the context root with just ${3+4} in it. If you can hit it and it displays 7, we'll know the web app is deployed.
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll see if I can talk them into opening it up but I'm not sure if they will.

I did place a test JSP page with ${3+4} and it displayed ${3+4}.

At this point, if they can't give me access I may just have to place their JSP files in the /examples folder where it works :)

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
laura mccord wrote:I did place a test JSP page with ${3+4} and it displayed ${3+4}.

This means that while your app is responding, it is not set up correctly. The EL is not working.

Have you declared your web.xml correctly asusing an up-to-date version of servlets? In other words, not a 2.3 DTD?
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is exactly my web.xml file. It's using 2.5. Do you notice anything that I am missing?



In my WEB-INF/lib I have jstl-1.2.jar and standard-1.1.2.jar




 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why 1.2 and 1.1.2?
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm...good question. I have no idea why I am using that version. I can update it. Do you think that could be a cause?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The point is that the jar files are from different versions. I don't think it's all of the problem, but it's certainly not going to make anything good happen.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!