Announcement Announcement Module
Collapse
No announcement yet.
"No constructor with 0 arguments..." still in 2.0.2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "No constructor with 0 arguments..." still in 2.0.2

    I saw a bunch if _closed_ issues for this problem, but I am still getting the errors with the latest build. The beans are being constructor @Autowired.

    Did I miss some open issues, or do I need to create a new one?

    thanks!

    -barry

  • #2
    Hi barry,

    I just checked the recent 2.0.2 with the following class

    Code:
    package com.springsource;
    
    import org.springframework.beans.factory.annotation.Autowired;
    
    public class AutowiredConstructorTest {
    	
    	@Autowired
    	public AutowiredConstructorTest(String test) {
    		
    	}
    
    }
    and corresponding Spring config:

    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"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    	
    	<!-- either use the context config element -->
    	<!-- <context:annotation-config />-->
    	
    	<!-- or register post processor manually -->
    	<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" />
    	
    	<bean class="com.springsource.AutowiredConstructorTest" />
    		
    </beans>
    I don't get the "No constructor with 0 arguments..." error in that scenario which is as expected. If I remove the context:annotation-config or the AutowiredAnnotationBeanPostProcessor the error pops up. IMHO that is as expected...

    If that does not work for you, please go ahead and open a JIRA and attach a simple zipped Eclipse test project.

    Thanks,

    Christian

    Comment


    • #3
      Ok, thanks. I will check to be sure that post-processor is indeed in the config-set.

      Comment


      • #4
        Yes, I am getting the error even with <context:annotation-config>. But only for a few beans. When I first posted the <context:annotation-config> was enabled via an import. But I added explicitly to the config file that contained the error.

        I'll have to try to trim down to simple project, but most likely I won't see the problem in a simple project.

        -barry

        Comment

        Working...
        X