facebook

NoClassDefFoundError: ApplicationContext

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #273805 Reply

    I am running a SpringFramework standalone program successfully in MyeclipseIDE 5.5.1. When I create a classpath out of the ide in jdk 1.5.0.12 I am getting the error Exception in thread “main” java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext. I do not believe it is Spring related. If I put in the Log4j before trying to instantiate ApplicationContext I get same error only with LogFactory. I have tryed using -cp, or Set CLASSPATH or using environment var and I am getting same problem. Running XP SP 2. Any ideas.
    Garth

    #273814 Reply

    I figured it out. I did not put the Class-Path entry into the jar file manifest. I had the Main-Class ok, I did not realize that I needed to fill in the Class-path as well. Example below.

    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.5.0_09-b03 (Sun Microsystems Inc.)
    Main-Class: com.sftest.prodconvert.Converter
    Class-Path: lib/activation-1.1.jar lib/aopalliance-1.0.jar lib/commons
    -logging-1.1.jar lib/commons-pool-1.3.jar lib/jaxb-api.jar lib/jaxb-i
    mpl.jar lib/jaxb-xjc.jar lib/jdom-1.0.jar lib/jsr173_api.jar lib/juni
    t-4.0.jar lib/log4j-1.2.14.jar lib/poi-3.0-FINAL.jar lib/saxpath-1.0-
    FCS.jar lib/sjsxp.jar lib/spring-2.0.5.jar

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: NoClassDefFoundError: ApplicationContext

You must be logged in to post in the forum log in