java - Can not running application with Spring Framework -
i have defined simple class looking this
public class spring1 { public static void main(string[] args) { applicationcontext context = new classpathxmlapplicationcontext("spring.xml"); } }
and configuration file is
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> </beans>
when run application shows following errors
exception in thread "main" java.lang.noclassdeffounderror: org/apache/commons/logging/logfactory @ org.springframework.context.support.abstractapplicationcontext.<init>(abstractapplicationcontext.java:164) @ org.springframework.context.support.abstractrefreshableapplicationcontext.<init>(abstractrefreshableapplicationcontext.java:89) @ org.springframework.context.support.abstractrefreshableconfigapplicationcontext.<init>(abstractrefreshableconfigapplicationcontext.java:58) @ org.springframework.context.support.abstractxmlapplicationcontext.<init>(abstractxmlapplicationcontext.java:61) @ org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:136) @ org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:83) @ project.on.spring.spring1.main(spring1.java:10) caused by: java.lang.classnotfoundexception: org.apache.commons.logging.logfactory @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 7 more
please me have made mistake.
i think have not included "apache commons logging jar". download , add project
Comments
Post a Comment