Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Spring 3 NoClassDefFoundError: org/springframework/expression/PropertyAccessor

  1. #1

    Question Spring 3 NoClassDefFoundError: org/springframework/expression/PropertyAccessor

    I have spring-framework-3.0.0.M3 (Spring 3).

    Building a very basic app that simply reads in a simple bean configuration file. Appears to be a dependency issue as I am getting a NoClassDefFoundError , the following stack trace:

    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
    	at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:441)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    	at com.jgk.spring3.simple.CheckSpringApp.main(CheckSpringApp.java:10)
    The artifacts are
    • Spring configuration file

    • Main Application

    • Single POJO bean to be wired

    • Library dependencies


    Spring configuration file: simple.xml
    Code:
    <?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-2.5.xsd">
    
      <bean id="simplePersonPojo" class="com.jgk.spring3.simple.SimplePersonPojo">
      </bean>
    
    </beans>
    Main Application
    Code:
    package com.jgk.spring3.simple;
    
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    
    public class CheckSpringApp {
    
    	public static void main(String[] args) { 
    		// exception thrown on the following line:
    		ApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "simple.xml",});
    		
    	}
    
    }
    Single POJO bean to be wired
    Code:
    package com.jgk.spring3.simple;
    
    public class SimplePersonPojo {
    	private String title;
    	private String address;
    	public String getTitle() {
    		return title;
    	}
    	public void setTitle(String title) {
    		this.title = title;
    	}
    
    	public String getAddress() {
    		return address;
    	}
    	public void setAddress(String address) {
    		this.address = address;
    	}
    }
    Library dependencies
    • commons-logging-1.1.1

    • org.springframework.asm-3.0.0.M3

    • org.springframework.beans-3.0.0.M3

    • org.springframework.code-3.0.0.M3

    • org.springframework.context-3.0.0.M3

    • log4j-1.2.14


    Any suggestions?

    Thanks :-)
    javapda on forum

  2. #2
    Join Date
    Apr 2006
    Location
    South Carolina
    Posts
    122

    Default

    It looks like you need to include the spring expression jar.

    BTW, are you including Spring core?

  3. #3

    Default Thanks ... expression lib missing, type-o on code, should be core

    Thank you Bron,

    I was missing that library. The original post above should be modified to include the following minimal library dependencies:

    Library dependencies
    • antlr-3.0.1

    • commons-logging-1.1.1

    • org.springframework.asm-3.0.0.M3

    • org.springframework.beans-3.0.0.M3

    • org.springframework.core-3.0.0.M3

    • org.springframework.context-3.0.0.M3

    • org.springframework.expression-3.0.0.M3



    Thanks again
    javapda on forum

  4. #4
    Join Date
    Apr 2006
    Location
    South Carolina
    Posts
    122

    Default

    So, just a clarification: is the problem still happening?

  5. #5

    Default Clarification

    No, it is not still happening.

    Thanks again
    javapda on forum

  6. #6
    Join Date
    Nov 2005
    Posts
    114

    Default

    It seems that the expression module is a basic dependency and not only if you use SpEL as my first impression was

  7. #7
    Join Date
    Aug 2006
    Posts
    16

    Default

    If these are all "basic" dependencies, why are they split up in to 5 jars, if I may ask?

  8. #8
    Join Date
    Feb 2010
    Posts
    6

    Default It still happens even if expression is installed

    Hi,
    I am getting the same error even though I have org.springframework.expression bundle installed and running in the equinox. I also have the following deployed:
    org.springframework.aop
    org.springframework.asm
    org.springframework.beans
    org.springframework.context
    org.springframework.core
    org.springframework.osgi.core
    org.springframework.osgi.extender

    What am I missing? Thanks,

  9. #9

    Default

    We still have the same issue NoClassDefFound org.springframework.expression.PropertyAccessor when trying to run Spring WS samples.

    Any idea why this class is missing ?

  10. #10
    Join Date
    Mar 2013
    Posts
    1

    Default

    I got the same problem ,Have you solved it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •