Problem with JSTL/JavaBeans/JSP

Ok, I'll try to describe my problem as clearly as possible.

- I'm usingEclipse ObjectWeb Lomboz;

- I'm usingJOnAS 4.x (Tomcat 5.5.15 is mentioned in the title bar of Eclipse);

- Jstl.jar and standard.jar are located in 'C:(...)\JavaDocumenten\IndustrialWebs\WebContent\WEB-INF\lib';

- The server's location is 'C:\JAVAServer\JOnAS-4.7.4';

- I'm using JDK1.5.0_11 which is located in 'C:\Program Files\JAVA';

- I'm using SDK which is also located as stated above;

- I'm using JRE1.5.0_11 which is also located as stated above;

- The server, Eclipse and everything works, as long as I'm not using JSTL to try to connect to a bean.

The structure within Eclipse is as follows:

I've gotIndustrialWebs andIndustrialWebsEAR under Projects, the project is obviously connected to the server.

Within IndustrialWebs, the following things are present:

- Deployment Descriptor

- Java Resources

* datalayer

+ Personen.java

+ Select PersoonBean.java

* Libraries

+ EAR Libraries (empty)

+ JOnAS v4;

^ ow_jonas_bootstrap.jar

^ ejb-2_1-api.jar

^ servlet-2_4.jar

^ jms.jar

+ JRE System Library (jdk1.5.0_11)

^ rt.jar, jsse.jar, jce.jar, charsets.jar, dnsns.jar, localedata.jar, sunjce_provider.jar, sunpkcs11.jar;

+ Web App Libraries

^ jst.jar

^ standard.jar

- build (irrelevant to describe);

- WebContent

+ META-INF

+ WEB-INF

* lib (empty)

* web.xml

+ The jsp-files, including testbean.jsp

The problem is as follows:

javax.servlet.ServletException: javax/servlet/jsp/tagext/TagLibraryValidator

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

java.security.AccessController.doPrivileged(Native Method)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

root cause

java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator

java.lang.ClassLoader.findBootstrapClass(Native Method)

java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)

java.lang.ClassLoader.loadClass(ClassLoader.java:301)

java.lang.ClassLoader.loadClass(ClassLoader.java:299)

sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

java.lang.ClassLoader.loadClass(ClassLoader.java:251)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1267)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)

org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:649)

org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:246)

org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:179)

org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)

org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)

org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)

org.apache.jasper.compiler.Parser.parse(Parser.java:126)

org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)

org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

java.security.AccessController.doPrivileged(Native Method)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

The error is produced by 'testbean.jsp', a jsp-file which I'm using to test a bean responsible for connecting to the database.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<jsp:useBean id="SelectPersoonBean" class="datalayer.SelectPersoonBean" scope="request" />

<c:forEach var="Personen" items="${SelectPersoonBean.list}">

If nothing is wrong with that jsp file, the error is not to be found anywhere in the code itself, since the bean itself worked perfectly while running it within Eclipse.

I searched the whole wide web but no solution seems to work. Is there ANYONE who knows what the problem might be, and more importantly, what the solution is?

[6242 byte] By [Nidhuggura] at [2007-11-27 5:09:20]
# 1
Anyone?
Nidhuggura at 2007-7-12 10:29:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

What solutions have you tried?

A quick google seemed to show the error as being related to classpath.

Particularly if jstl.jar and standard.jar show up more than once in the classpath.

Do a search for jstl.jar and standard.jar and see where they turn up on your system.

Can you start up JOnAS independantly of eclipse? Try running it independantly to see if the problem is caused by eclipse in some way shape or form.

This post: http://forum.java.sun.com/thread.jspa?threadID=538157&messageID=2699991 seems to point at Eclipse importing the libraries independantly was a problem.

Can you start a base web application with none of your existing code and just try a <c:out value="hello world"/> application? Does that succeed?

evnafetsa at 2007-7-12 10:29:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I'll run another system check to see where jstl.jar and standard.jar are, besides where they should be. I did it before, and removed it from the places I didn't need to have it, but that didn't seem to be the solution.

Furthermore, I made sure there's only ONE servlet.jar (or servlet-api.jar or servlet-2_4.jar - very annoying it has multiple names while the classes in it seem to be the same), but that didn't work out either.

I'll run JOnAS without using Eclipse, though I never tried to.

Your suggestion about <c:out value="hello world"/> is great, I'm trying it right away.

Nidhuggura at 2007-7-12 10:29:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The problem is solved! Despite the fact I thought I deleted all the jstl.jars and standard.jars from places where they shouldn't be, I apparently forgot to remove one of them. Thanks for your help!
Nidhuggura at 2007-7-12 10:29:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Glad to hear it is working for you.Where was it hiding if you don't mind me asking?Was it a configuration in Eclipse? Something hidden in the application server?It might just help me when I come across the problem one day :-)
evnafetsa at 2007-7-12 10:29:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...