Finding the origin of JAR files from source code to determine frameworks used?
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 p开发者_JAVA百科ackage 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?
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).
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.
You can use Provenance to figure out where random jar files come from, and easily get some XML to help you convert to a Maven (or Ivy) project structure.
Disclaimer: this is my project.
精彩评论