aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes problem with Maven and JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "problem with Maven and JSTL" Watch "problem with Maven and JSTL" New topic
Author

problem with Maven and JSTL

Fabiano Souza
Greenhorn

Joined: Sep 26, 2008
Posts: 11
hello guys,

I'm having problems using JSTL dependencies of Maven in Tomcat.
For some reason Tomcat does not recognize JSTL of my application which was dowloaded as maven dependencies and I'm not able to use JSTL tags on my application.

I'm using Ubuntu 10.4 here is my maven instalation:
Apache Maven 3.0.4 (r1232337; 2012-01-17 06:44:56-0200)
Maven home: /usr/local/apache-maven/apache-maven-3.0.4
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-41-generic", arch: "i386", family: "unix"

I'm running Tomcat inside Eclipse and a simple start of Tomcat with my app installed I got several erros like these in the console:

Jul 19, 2012 6:59:25 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [org/apache/taglibs/standard/lang/jstl/OrOperator.class] from Jar [jar:file:/home/fabiano/4Linux/497/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fourpizza/WEB-INF/lib/jstl-1.2.jar!/] for annotations
java.util.zip.ZipException: invalid LOC header (bad signature)

I'm wondering if someone can help to clear it out..

Thanks in advance!

Fabiano
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

So you are saying that you are declaring the jstl jar as a dependency for your war in the pom.xml? If so, try deleting the entire jstl directory from your local repository and try building again, it appears that somehow it got corrupted (which is somewhat unusual because Maven does check the hash code).

By the way, I assume that you are using the jstl form Maven Central, and not one that you installed yourself, right?

Other things to try:

a) Open that file mentioned in the error message using a zip utility.

b) Open the jstl jar file in the local repository using a zip utility


JBoss In Action
fabianoSouza Souza
Greenhorn

Joined: Oct 07, 2006
Posts: 9
Hello Peter.. thanks for the reply..

yes, Im declaring jstl jar as dependency on my pom.xml

about you comment:
By the way, I assume that you are using the jstl form Maven Central, and not one that you installed yourself, right?
I'm new to maven and not understanding what you are telling by "jstl form Maven Central".

here is my jstl dependency on pom.xml



I did some search on the google and found this

http://www.andygibson.net/blog/quickbyte/jstl-missing-from-maven-repositories/

should I use the dependencies as mentioned in this link? is that what you meant?

instead of using <groupId>jstl</groupId> should I use <groupId>javax.servlet.jsp.jstl</groupId> as mentioned in the link?

thanks!

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Yes, I would use that groupId or javax.servlet. THe one with a groupId of jstl was uploaded in 2006, so I would not rely on that one. (You do know how to search Maven Central, right?)

One thing frustrating about Maven Central is the naming anarchy and too often the same artifact appears in multiple places, so figuring out the correct groupId is always a hassle.
fabianoSouza Souza
Greenhorn

Joined: Oct 07, 2006
Posts: 9
thanks Peter.. I got it,, I just put that groupId in the pom.xml and everything started working..

as I said I'm new to maven and not sure about how to search Maven Central..

but the problem is fixed and most important I know what the problem was and how to fix it..

thanks again!!

Fabiano
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Go here to search Maven Central: http://search.maven.org/#browse
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with Maven and JSTL
 
Similar Threads
ActionServlet compilation error
Installing Java / Eclipse / Tomcat / Maven on Ubuntu 9.10
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
once again: classpath and ojdbc14.jar
java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter