-
1. Re: Can't use CRUD in JBoss Developer Studio
rbrtfreund Feb 8, 2010 9:50 PM (in response to handro1104)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"/>Hope that helps!
-
2. Re: Can't use CRUD in JBoss Developer Studio
handro1104 Feb 9, 2010 5:07 AM (in response to rbrtfreund)Thank you very much Robert. None of the lines where in my files. I added them, but on
<transaction:entity-transaction entity-manager="#{em}"/>
I got the error
The prefix "transaction" for element "transaction:entity-transaction" is not bound
I run the application witouth this line and got the same error as before.
I wonder what am I doing wrong if my setup is wrong.
-
3. Re: Can't use CRUD in JBoss Developer Studio
rbrtfreund Feb 9, 2010 11:30 AM (in response to handro1104)That is referring to binding the namespace in your components.xml header. All the Seam namespaces are fairly "common" sense approach. So anytime you need a Seam namespace it follows the pattern http://jboss.com/products/seam/[mynamespace]
components.xml
xmlns:transaction="http://jboss.com/products/seam/transaction"
xsi:schemaLocation="http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd"
If that's not working for you... Post your log on deploy to see what isn't getting bound. You should see your Table's in the hibernate log on deploy.
-
4. Re: Can't use CRUD in JBoss Developer Studio
rbrtfreund Feb 9, 2010 11:32 AM (in response to handro1104)Oh... and by the way... I find Jboss 4.2x to play nicer with Seam 2.2 before you dig into all the intricacies of Seam. So if your not tied to JBoss 5 in the immmediate future your auto seam gen process may work a little smoother for you. Just a thought. -
5. Re: Can't use CRUD in JBoss Developer Studio
handro1104 Feb 10, 2010 11:04 AM (in response to rbrtfreund)Thank you very much again, but still it does't work.