Friday, May 11, 2007

What jar files to add to your Spring app for Xfire

To expose some of your Spring classes as web services via Xfire you can follow one of the many tutorials on the web. But nobody tells you which jar files into your class path. These worked for me (under Apache Tomcat 5.5 runing Spring 1.2.9):
  • xfire-all-1.2.4.jar - the main library for xfire
  • activation-1.1.jar
  • commons-codec-1.3.jar
  • commons-httpclient-3.0.jar
  • jdom-1.0.jar
  • jsr173_api-1.0.jar
  • mail-1.4.jar
  • stax-1.1.2-dev.jar (this was a pain in the a$%#e to determine!)
  • stax-api-1.0.1.jar
  • wsdl4j-1.6.1.jar
  • xbean-spring-2.7.jar
  • XmlSchema-1.1.jar
This was in addition to usual jar files that MyEclipse will add to your Spring web project when you add Spring capabilities.

Spring and log4j

If you have a Java Spring web application in Apache and are getting this error:

log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.


Then you can fix it by making sure that the log4j.properties file gets deployed to the classes folder under .../webapps/{project}/WEB-INF/classes/

Try sticking it in there and the error should go away. Too easy!