Announcement Announcement Module
Collapse
No announcement yet.
map bean - nested exception is java.lang.NoSuchMethodException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • map bean - nested exception is java.lang.NoSuchMethodException

    Hi!,

    Apache indicate this error

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Persona' defined in ServletContext resource [/WEB-INF/HelloSpring-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [prueba.Persona]: No default constructor found; nested exception is java.lang.NoSuchMethodException: prueba.Persona.<init>()
    my xml is:

    Code:
    <bean id="Persona" class="prueba.Persona"></bean>
    	<bean id="HelloSpringController" class="prueba.HelloSpringController">
    		<property name="info"><ref bean="Persona" /></property>
    	</bean>
    	<bean id="PruebaSpringController" class="prueba.PruebaSpringController"></bean>
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <props>
                    <prop key="/hello.html">HelloSpringController</prop>
                    <prop key="/aqui.html">PruebaSpringController</prop>
                </props>
            </property>
         </bean>
    And the class if exist on my package.

  • #2
    But Persona does obviously not have a default constructor. That's what the exception is saying.

    Joerg

    Comment

    Working...
    X