Re: PrettyFaces, CDI and the case of the missing ?cid=xxx…

Splash Forums PrettyFaces Users PrettyFaces, CDI and the case of the missing ?cid=xxx… Re: PrettyFaces, CDI and the case of the missing ?cid=xxx…


Tony Herstell

Once you synch then the only thing you need to set up is the PU and the Database schema I guess.

This is the simplest way of setting up the system with MySQL I have found and details the setup with MySQL and JBoss7:

This is in the file persistence.xml under META-INF in the project…

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="" xmlns:xsi=""

<!-- JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7 JBoss7
Download MySQLConnector (was in my case)
Add a new directory: modules/com/mysql/main
put the MySQLConnector in the new directory: modules/com/mysql/main
Create a new file in directory: modules/com/mysql/main called module.xml and add in this code:

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
<module name="javax.api"/>

Edit the file in the existing directory : /standalone/configuration called standalone.xml and add in this code inside the <drivers> tags:

<driver name="mysql" module="com.mysql"/>

now add in this code inside the <datasource> tags:

<datasource jndi-name="java:/datasources/entermyeventsDatasource" pool-name="my_pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">

Run up server and look for something like:
04:45:09,525 INFO [org.jboss.jpa] (MSC service thread 1-3) JBAS011402: Starting Persistence Unit Service 'entermyevents.war#entermyeventsDatasource'


<persistence-unit name="entermyeventsDatasource">
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="" value="update" /> <!-- create-drop update -->
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<!-- These are the default for JBoss EJB3, but not for HEM: -->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property name=""
value="java:/essistantEntityManagerFactories" />


I guess you probably don’t need this but just want to ensure I provide as much info as possible…