Announcement Announcement Module
Collapse
No announcement yet.
Spring 3 NoClassDefFoundError: org/springframework/expression/PropertyAccessor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 :-)

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

    BTW, are you including Spring core?

    Comment


    • #3
      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

      Comment


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

        Comment


        • #5
          Clarification

          No, it is not still happening.

          Thanks again

          Comment


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

            Comment


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

              Comment


              • #8
                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,

                Comment


                • #9
                  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 ?

                  Comment


                  • #10
                    I got the same problem ,Have you solved it?

                    Comment


                    • #11
                      Originally posted by Haphase View Post
                      I got the same problem ,Have you solved it?


                      yo tambien tengo el mismo problema, al parecer son dependecias de algun otro jar, alguien sabe cual jar me falta.

                      adjunto los jars que tengo, deberia existir un cheklist standar para poder subir un aplicativo spring, bajo un marco de trabajo basico.

                      Comment


                      • #12
                        With spring-expression.jar the problem is solved

                        Comment

                        Working...
                        X