- This topic has 5 replies, 3 voices, and was last updated 19 years, 3 months ago by support-michael.
-
AuthorPosts
-
Thomas TrostelParticipantWhen using a project constructed with both Hibernate and Spring integration I am finding that the following code produces an error
NoClassDefFoundError: org/apache/commons/logging/LogFactory
Here is the code
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.InputStreamResource; public class RecPayable { // Log4J entity static Logger logger = Logger.getLogger(RecPayable.class); /** * @param args */ public static void main(String[] args) { // Set up the log4j configuration from the properties file. String directory = System.getProperty("user.dir"); PropertyConfigurator.configure(directory + "/RecPayable.properties"); // Initialize the bean factory with the worlds simplest bean InputStream is = null; logger.info("This is a test"); try { is = new FileInputStream(directory + "/beans.xml"); } catch (FileNotFoundException e) { logger.error(e.getMessage()); return; } InputStreamResource ris = new InputStreamResource(is); XmlBeanFactory factory = new XmlBeanFactory(ris); } }
Note that the Apache Commons library is available to the project as well as the Log4J library. Any clues?
Thanks
snpeMemberHi ttrostel,
LogFactory is from commons-logging libraries.Have you commons-logging.jar in classpath ?
Thomas TrostelParticipantYes … I mentioned in the original message that the commons-logging library was available (by that I meant in the classpath)
Thomas TrostelParticipantHmmm … I dropped the pre-packaged Spring-All library included with M4 and replaced it with a user library I constructed using Spring 1.2.3 and everything works fine. Bug?
Thomas TrostelParticipantThis probably needs to be entered as a bug for the next build. Is there somewhere I can do this?
support-michaelKeymasterBug has been entered. FYI: M3 will include the latest Spring framework (1.2.3) and Spring IDE (1.2.2).
-
AuthorPosts