Seam example seam-blog using mysql
-
Installed mysql and created DB.
-
For the mysql to work with jboss , downloaded the Connector/J from mysql website and copied the file mysql-connector-java-3.0.15-ga-bin.jar to the lib folder under server default.
3.Jboss server will bitch about the no class def found error java.lang.NoClassDefFoundError: org/aspectj/lang/Signature , to solve this add the aspectrt.jar which is availale in the connector/J download.
4.Now we have to create datasource for mysql , copy the sample mysql-ds.xml from examples and change it as follows
<datasources>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jboss</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jboss</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
5.Change the blog-ds.xml under jboss-seam/examples/blog/resource as follows
<datasources>
<local-tx-datasource>
<jndi-name>blogDatasource</jndi-name>
<connection-url>jdbc:mysql:localhost:3306:jboss</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jboss</user-name>
<password>pass</password>
</local-tx-datasource>
</datasources>
6.Add the jndi name of datasource to the persistence.xml under jboss-seam/examples/blog/resources/META-
INF folder
7.Run ant deploy under jboss-seam/examples/blog/