• 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

Unable to load class

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I am using JSTL 1.06 from Jakarta with Tomcat 4.1 on a MacOS X 10.3.9 server. I have a jsp that contains the following:



I have placed jstl.jar and standard.jar in my webapp's WEB-INF/lib directory. However, when I try to load the page, I get this error message:

org.apache.jasper.JasperException: /myjsp.jsp(60,0) Unable to load class if

I know that many people have asked similar questions, but in each case, the response was to put jstl.jar and standard.jar in WEB-INF/lib and make sure that you're using the proper URI for the taglib, and I think I have done those things correctly. Any help would be greatly appreciated!
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
replace "http://java.sun.com/jstl/core" with "http://java.sun.com/jstl/core_rt" and see if it works
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. Some versions of Tomcat 4 did have problems auto-finding tlds based on their URIs, but if that were the case herre I'd expect a message along the lines "no tag if found in library with prefix c". The error message you are getting is rather perplexing.

Is there any reason that you are using such old versions of Tomcat and JSTL?
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your responses. I tried replacing "http://java.sun.com/jstl/core" with "http://java.sun.com/jstl/core_rt" but I still got the same error message.

I'm only using these old versions because that is what was installed on the server, and I found the upgrade process a little daunting, so I figured it would be better to work with what I have rather than try to upgrade and end up breaking the system.

I have also read that the version information in web.xml must be set to a certain value depending on the web container, so here is what appears at the top of my web.xml file:



I hope that is helpful. Again, any help is appreciated!
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it to work with JSTL 1.06. It seems the important thing is to put ALL the JSTL .jar files in the WEB-INF/lib directory, not just jstl.jar and standard.jar, and then restart tomcat. I could swear I had tried that before without success, but it seems to be working for the moment. Wish me luck!

(Previously I claimed I had to use jstl 1.0, but that was incorrect.)
[ October 25, 2006: Message edited by: Hank Jordan ]
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to keep changing my story, but I just want to get this right in case someone else is having the same problem. I have seen many posts offering different solutions to this problem, so I wanted to be precise about what got it working for me.

It turns out--on my system at least--that I don't need the other jar files. All I need are standard.jar and jstl.jar. The crucial thing is to restart the tomcat server after standard.jar and jstl.jar are placed in WEB-INF/lib. Thanks for your patience!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Hank Jordan:
[QBIt turns out--on my system at least--that I don't need the other jar files. All I need are standard.jar and jstl.jar.[/QB]



What other jar files are you talking about? jstl.jar and standard.jar are the only jars for JSTL.

The most ciritical issue when getting JSTL up and running is to be sure that all versions of JSTL, JSP, servlets and your web app are compatible (as detailed in the JSP FAQ).
[ October 27, 2006: Message edited by: Bear Bibeault ]
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By "the other jar files," I meant the other standard Jakarta taglibs: jaxen-full.jar, jdbc2_0-stdext.jar, saxpath.jar, xalan.jar, xercesImpl.jar, and xml-apis.jar.

At one point, I thought I needed them in order to use JSTL, but I realize that I was mistaken. I had everything set up correctly, but in order to make it work, it was necessary to restart tomcat after putting standard.jar and jstl.jar in WEB-INF/lib.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those "other jar files" would be required for older versions of Java / Tomcat. Tomcat4 has an official requirement of Java1.3.

For instance the jdbc2_0-stdext.jar has the standard JDBC extensions that were included in Java1.4.
I don't think anyone would be using less than Java 1.4 nowadays, but heck I would have thought people would be off Tomcat4 by now ;-)

But out of the box with Tomcat4.1 and Java1.4, all you should need are standard.jar and jstl.jar.
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would rather be using a newer version of Tomcat, but if I understand correctly, that would require Java 5.0, and that would require Mac OS X 10.4. I didn't feel it was worth it to upgrade the OS so I could upgrade the JRE so I could upgrade Tomcat so I could upgrade JSTL. That's a lot of work--and a lot of little things that can go wrong--for what seems like a small payoff. I'm sure there are many advantages to upgrading, but I think it would be hard to make the case to management. Bear Bibeault made a good point about the importance of understanding the compatibilities of the various versions of all the software components, and the OS is a big piece in that puzzle. Also, thanks to all for your helpful comments!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat 5.0 can be used with JDK 1.4.

Tomcat 5.5 is used with JDK 1.5 but can be configured to run with 1.4.

Both Tomcat 5.0 and 5.5 support JSP 2.0 and therefore JSTL 1.1.
 
Hank Jordan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting. I guess I should have dug a little deeper into the Tomcat documentation. I will look into upgrading Tomcat then. Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic