facebook

Newbie Spring JPA example

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #300511 Reply

    bmwilson0128
    Member

    I made a project similar to DWRSpringJPA example, but without DWR.
    I have a class StudentService, and it holds a class StudentProfileDAO.

    I am finding that Spring is not instantiating the DAO class, it is null.
    My relevent files:
    applicationContext.xml:

    <bean id=”entityManagerFactory”
    class=”org.springframework.orm.jpa.LocalEntityManagerFactoryBean”>
    <property name=”persistenceUnitName” value=”educationPU” />
    </bean>

    <bean id=”transactionManager” class=”org.springframework.orm.jpa.JpaTransactionManager”>
    <property name=”entityManagerFactory” ref=”entityManagerFactory” />
    </bean>

    <tx:annotation-driven transaction-manager=”transactionManager” />

    <bean id=”StudentProfileDAO” class=”com.jpa.StudentProfileDAO”>
    <property name=”entityManagerFactory” ref=”entityManagerFactory” />
    </bean>

    <bean id=”studentService” class=”com.services.StudentService”>
    <property name=”studentProfileDAO” ref=”StudentProfileDAO” />
    </bean>

    I have a jspx page that has:

    <ice:inputText id=”lastName” value=”#{studentService.studentProfileDAO.lastName}”/>
    and it reports back that studentProfileDAO is null.
    How do I make Spring automatically instantiate the DAO when StudentService is instantiated?

    Thanks

    #300520 Reply

    support-joy
    Member

    bmwilson0128

    I don’t have visibility to your current problem. Are you getting an error? Can you check your error log? I would recommend you to debug through your code to find the root cause. And also cross post to spring – JPA forums.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Newbie Spring JPA example

You must be logged in to post in the forum log in