views:

27

answers:

2

I'm doing some project maintenance on the source code for an MVC JS website running on JBoss. The project contains both Java and Javascript and I'm trying to figure out all of the frameworks that were used on this project, seeing that the Javascript code is somewhat lacking in project documentation.

In WEB_INF/lib/, I see these files:

avalon-framework-4.2.0.jar
batik-all-1.7.jar
commons-io-1.3.1.jar
commons-lang-2.4.jar
commons-logging-1.0.4.jar
dwr.jar
fop.jar
mail.jar
servlet-api.jar
sqljdbc4.jar
xmlgraphics-commons-1.3.1.jar

From my preliminary research, I think this project uses:

Avalon Framework

Batik SVG Toolkit

Apache Commons

DWR

Apache FOP

JavaMail

MS SQL Server JDBC driver

Apache XML Graphics commons

However, I'm a little confused about serlvet-api.jar. Other than a Google search, what is the best way to determine where this package comes from and its purpose? In particular, I'm getting this message in the console when I start this project in JBoss through Eclipse:

INFO  [WebappClassLoader] validateJarFile(C:\jboss-4.2.2.GA\server\default\.\tmp\deploy\tmp6553188861131946313Ag4-exp.war\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Any suggestions as to what I should do to track down the source of this jar file, and its corresponding error message, to ensure that my source code maintenance doesn't harm the project?

+1  A: 

I don't know why you wouldn't want to use google to find the answer. But, the specific problem is probably due to the fact that Tomcat now has it's own Servlet class. So try removing the servlet-api.jar file from the lib directory. Or make sure the version of Tomcat you are using with Eclipse matches the server you are going to deploy on (although it's probably easier to upgrade the Tomcat version on the server than trying to setup eclipse with an older version).

John Drummond
I already did a Google search, and it was somewhat inconclusive for servlet-api. Hence, the question.
Zoot
Ah OK - fair enough. Usually if I search for a particular error message in Google I find the answer.
John Drummond
+1  A: 

You can list the directory of the jar on the command line with

jar tvf servlet-api.jar

(jar is in the bin directory of your jdk).

Odds are that this is the standard servlet api specification jar. The jar itself likely contains no implementation, rather jboss is relied on for that, but the project needed eclipse to have a copy to be able to compile the project.

You should not include the servlet-api inside your war file, as any servlet container will provide it.

Yishai
Looks like you're right. If I delete servlet-api.jar, Eclipse can't find the index file, though I can manually enter it to find the web app. Putting servelt-api back into WEB_INF/lib/ solves this issue. I will make sure to leave it out of the war file at compile time. Thanks!
Zoot