Results 1 to 3 of 3

Thread: BeanCreation Excepton Plz help

  1. #1
    Join Date
    May 2011
    Location
    mumbai
    Posts
    37

    Default BeanCreation Excepton Plz help

    Dear all

    i am traying //this.npjt = new NamedParameterJdbcTemplate(dataSource);
    with context.xml

    <bean id="npjt" class="org.springframework.jdbc.core.namedparam.Na medParameterJdbcTemplate">
    <constructor-arg ref="portailCarburantDataSource"/>
    </bean>


    <bean id="commonJdbcTemplateTest" class="com.carrefour.fr.portail.carburant.CommonJd bcTemplate">
    <property name="npjt" ref="npjt"></property>
    </bean>

    I am getting following excepton plz help

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'commonJdbcTemplateTest' defined in class path resource [com/carrefour/fr/portail/carburant/ejb-application-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedEx ception: Failed to convert property value of type 'org.springframework.jdbc.core.namedparam.NamedPar ameterJdbcTemplate' to required type 'org.springframework.jdbc.core.namedparam.NamedPar ameterJdbcTemplate' for property 'npjt'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.jdbc.core.namedparam.NamedPara meterJdbcTemplate] to required type [org.springframework.jdbc.core.namedparam.NamedPara meterJdbcTemplate] for property 'npjt': no matching editors or conversion strategy found
    Last edited by junugari; May 10th, 2011 at 09:11 AM.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    710

    Default

    First of all remember to use the CODE tags when posting code/configuration/stacktraces.

    Failed to convert property value of type 'org.springframework.jdbc.core.namedparam.NamedPara meterJdbcTemplate' to required type 'org.springframework.jdbc.core.namedparam.NamedPara meterJdbcTemplate'

    The fact that Spring is trying to convert to objects of the same class means that the framework (and thus the application) doesn't recognize them to be the same class, which leads me to think this is a classloader issue. You probably have made a mistake in resolving and exporting your project dependencies (there is more than one spring-jdbc or spring-core jar, you're mixing up jars from different versions of Spring, etc.

    I suggest using Maven to manage your dependencies.

  3. #3
    Join Date
    May 2011
    Posts
    1

    Default

    Great post! It's very nice. Thank you so much for your post.


    __________________
    Watch Jumping the Broom Movie Online Free

Posting Permissions

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