views:

21

answers:

0

Hi All,

I just started to learning Java and get stucked at some simple point. I am suggested to use Spring framework and for that i downloaded SpringSource Tool Suite installer, double clicked and installed it.

When i run simple hello world application it works. But when i try to use one of spring frameworks' classes i got the error "Exception in thread main java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory..."

When i clicked to see the line where the error occured i got "The JAR File ... has no source attachment."

Where is the source?

My Code:

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;
import JavaBeanTest.Person;

public class ClassMain {

public static void main(String args[]) throws ClassNotFoundException {


try {
 FileSystemResource resource = new FileSystemResource("c:/Person.xml");
 BeanFactory factory = new XmlBeanFactory(resource);
 Person person = (Person) factory.getBean("Person");

 person.PrintName();
} catch (Exception err) {
 System.out.println("mehmet");
 System.out.println(err.getMessage());

}

}
}

i would really appreciate any help...