Results 1 to 5 of 5

Thread: Classloader problem moving from M4 --> M5

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    12

    Question Classloader problem moving from M4 --> M5

    Hi!

    I have the following bean definition in my XML which works fine in M4:

    Code:
    <bean id="beanId" class="de.mybean" autowire="autodetect">
    <property name="myPropertyName">
    <list>
    <value type="de.myJava5EnumType">BLABLA</value>
    <value type="de.myJava5EnumType">BLUBLU</value>
    [...]
    The idea behind this is to have a list that contains certain enums. As I said, this worked fine until today, when I tried the M5 release.
    Now I get a ClassNotFoundException for de.myJava5EnumType .

    Am I doing something wrong? Is this behavior intentional?

    All the best,

    René

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    No, especially not through a ClassNotFound. Can you please check your environment so that you don't have any stale cache/environment ?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    12

    Default

    Dear Costin,

    first of all, thanks for taking the time to reply!

    I have the effect within my Eclipse development environment. The only difference between working and not-working are the spring jars of the versions M4/M5. I am a bit clueless, where I could have caching issues in such environment? (I have done this for a while; the only problems I usally get are if I mix-up versions (which I did not today ))

    [edit: btw, I double-checked the existence of the class in question in the .../classes/ folder]
    All the best,

    René

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Can you post the whole stacktrace? Did you try project clean and all the rest to make sure everything is in sync? There might be an issue with m5 but the CNF seems to suggest otherwise.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    12

    Default

    Dear Costin,

    I am pretty sure now, that we are facing some issue here, if this is not the intended behavior.

    I have created a minimal testcase to reproduce the problem and created a JIRA entry:

    http://opensource.atlassian.com/proj...rowse/SPR-2154

    For completeness of this thread, the stack trace is:

    Code:
    org.springframework.beans.factory.BeanDefinitionStoreException: Error 'Type class [de.smartprocure.EnumLoadProblemEnum] not found for <value> element' in resource 'class path resource [EnumLoadTest.xml]' at:
    ; nested exception is java.lang.ClassNotFoundException: de/smartprocure/EnumLoadProblemEnum
    Caused by: java.lang.ClassNotFoundException: de/smartprocure/EnumLoadProblemEnum
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:242)
    	at org.springframework.util.ClassUtils.forName(ClassUtils.java:160)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertySubElement(BeanDefinitionParserDelegate.java:838)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseListElement(BeanDefinitionParserDelegate.java:880)
    	at org.springframework.beans.factory.xml.UtilNamespaceHandler$ListBeanDefinitionParser.parse(UtilNamespaceHandler.java:99)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:78)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1087)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:544)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:339)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:314)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:278)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
    	at org.springframework.test.AbstractSpringContextTests.loadContextLocations(AbstractSpringContextTests.java:135)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(AbstractDependencyInjectionSpringContextTests.java:224)
    	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:115)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:192)
    	at junit.framework.TestCase.runBare(TestCase.java:125)
    	at junit.framework.TestResult$1.protect(TestResult.java:106)
    	at junit.framework.TestResult.runProtected(TestResult.java:124)
    	at junit.framework.TestResult.run(TestResult.java:109)
    	at junit.framework.TestCase.run(TestCase.java:118)
    	at junit.framework.TestSuite.runTest(TestSuite.java:208)
    	at junit.framework.TestSuite.run(TestSuite.java:203)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    All the best,

    René

Posting Permissions

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