Tuesday, December 14, 2010

Andromda 3.4 -> Glassfish v3 -> JPA->Hibernate->MYSQL

Several issues arise right now with the andromda 3.4-SNAPSHOT build. Could not compile due to incomplete code generated by the JSF-Cartridge. Modified the files:
%JSF_CARTRIDGE%/templates/jsf/utils/ControllerBase.java, and JsfVariableResolver.java
to resolve.

Also, the application.xml that is generated is invalid ... open application.xml and move the <description> tag above the <display-name> tag.

Configuration of Glassfish:
Installed fresh install of Glassfish.
Created a jdbc connection pool in the glassfish v3 admin console.
Common Tasks>Create New JDBC Connection Pool

in the additional parameters section:
servername: localhost
port: 3306
user: user
password: pass
databasename: newdbname

Deploy the mysql connector (mysql-connector-java-5.1.5-bin.jar' into the folder:
%glassfish_install_folder%\domains\domain1\lib\ext


Modifying Andromda build.
For this test I have previously reverse engineered a model from an existing schema which I already have installed in my mysql db. I generated a new clean andromda 3.4-SNAPSHOT project, and tinkered to get it to successfully build. Upon deployment to Glassfish, it complained about missing hibernate classes.

Modify main pom.xml to include hibernate .jars:

<dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>3.6.0.Final</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>3.6.0.Final</version>
                <scope>compile</scope>
            </dependency>

No comments:

Post a Comment