Announcement Announcement Module
Collapse
No announcement yet.
Spring IDE with hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring IDE with hibernate

    hello everyone
    I tried to follow a tutorial that talks about Spring IDE with hibernate
    I made ​​the same examples, but still this messsage
    <?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:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-3.1.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schem...ontext-3.1.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

    <bean id="datasource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="org.postgresql.Driver"/>
    <property name="url" value="jdbcostgresql:T"/>
    <property name="username" value="postgres"/>
    <property name="password" value="root"/>
    </bean>

    <bean id="SessionFactory" class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
    <property name="datasource" ref="datasource"/> voici le message :No setter found for property 'datasource' in class
    'org.springframework.orm.hibernate3.annotation.Ann otationSessionFactoryBean'

    <property name="annotatedClasses">
    <list>
    <value>com.model.Cours</value>
    <value>com.model.Student</value>
    </list>
    </property>
    </bean>

    </beans>
    I", using spring IDE framework 3.2 realse .and i added all jar in lib named spring attched to the project
    allso hibernate4 jars
    Last edited by Feres; Apr 7th, 2013, 08:08 AM.

  • #2
    I'm guessing that you may have already figured this out but just in case ....

    You wrote

    Code:
    ...
    <property name="datasource" ref="datasource"/>
    ...
    when it should read

    Code:
    <property name="dataSource" ref="datasource"/>
    If you place the cursor after 'name="data", you can get code assistance by pressing control+space (I'm on a Mac, so maybe it's different on Windows or Linux), as shown in the following image.

    Attachment
    Attached Files

    Comment

    Working...
    X