jQuery in Action, 2nd edition*
The moose likes Spring and the fly likes Unable to run spring program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Unable to run spring program" Watch "Unable to run spring program" New topic
Author

Unable to run spring program

Nagaraju Mulinti
Ranch Hand

Joined: Aug 10, 2008
Posts: 37
Hi All,

I have written a small Hello World Spring program using properties file.I am able to compile it successfully but I couldn't run it anymore. Can you please help on this issue and give me the suggestion to run successfully.

The below exception is getting when I run the program. Thanks in advance..!





Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory
at org.springframework.core.CollectionFactory.<clinit>(CollectionFactory
.java:64)
at org.springframework.core.SimpleAliasRegistry.<init>(SimpleAliasRegist
ry.java:41)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.<init>(DefaultSingletonBeanRegistry.java:73)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
<init>(FactoryBeanRegistrySupport.java:41)
at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(
AbstractBeanFactory.java:146)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.<init>(AbstractAutowireCapableBeanFactory.java:144)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
<init>(DefaultListableBeanFactory.java:113)
at FirstSpringHelloWorld.main(FirstSpringHelloWorld.java:11)

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You need to put the Apache Commons Logging JAR in your CLASSPATH.


[My Blog]
All roads lead to JavaRanch
Nagaraju Mulinti
Ranch Hand

Joined: Aug 10, 2008
Posts: 37
Yes..I tried it..still getting same issue..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

How did you do ? Are you using the command line, or an IDE ? If you are using the command line, please show the command you are using, and also your CLASSPATH.
Nagaraju Mulinti
Ranch Hand

Joined: Aug 10, 2008
Posts: 37
I am using command line..

Please find the below is my classpath


C:\Nagaraju\java>echo %classpath%
.;C:\Program Files\Java\jdk1.5.0_14\lib;C:\Nagaraju\Spring-JARS\spring.jar;C:\Na
garaju\Spring-JARS\spring.jar\commons-logging-1.0.4.jar;.

C:\Nagaraju\java>
Nagaraju Mulinti
Ranch Hand

Joined: Aug 10, 2008
Posts: 37
Sorry, I have done mistake in class path and its rectified. I got it now.. Thank you...!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Yes, I can see it too Glad it's solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to run spring program