[jboss-user] [Beginner's Corner] New message: "Re: Can't use CRUD in JBoss Developer Studio"

Robert Freund do-not-reply at jboss.com
Mon Feb 8 21:47:48 EST 2010


User development,

A new message was posted in the thread "Can't use CRUD in JBoss Developer Studio":

http://community.jboss.org/message/524922#524922

Author  : Robert Freund
Profile : http://community.jboss.org/people/rbrtfreund

Message:
--------------------------------------------------------------
sounds like wrong db or persistence not being loaded.
 
If using Studio to generate project click edit in initial wizard and go to driver properties and make sure those are in fact your db. Make sure when deploying app that you see it found in the hibernate log.
 
If using JBoss 5 make sure you are retrieving your entityManagerFactory from JNDI.
 
persistence.xml

         <property name="jboss.entity.manager.factory.jndi.name" value="java:/myEntityManagerFactory"/>
 
components.xml
     <transaction:entity-transaction entity-manager="#{em}"/>
                  
    <persistence:entity-manager-factory name="myDatabase" installed="@loadPersistenceUnits@"/>

    <persistence:managed-persistence-context name="em" auto-create="true"
       entity-manager-factory="#{myDatabase}" persistence-unit-jndi-name="java:/myEntityManagerFactory"/>

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/524922#524922




More information about the jboss-user mailing list