Andromda is a bit of a hog when you are trying to do a maven compile. We have a pretty complex model, and we use Andromda to generate all of our backend classes. On my machine our 'normal' maven build takes approximately 2 min and 45 secs to do the andromda generate, and compile the classes. Acceptable after a model change, since I model relatively rarely. Too much time when you are doing normal coding activities.
Here are a few tips:
You can do a:
Skip unit tests:
mvn -Dmaven.test.skip to skip unit tests.
Do an offline build:
mvn -o this will do an 'offline' build, saving the check of all of the SNAPSHOT dependencies. Andromda has a lot of them!
Skip Andromda model validation:
mvn -Dvalidation=false this skips the validation of the model, and will go right into the compile. This saves about 45 seconds on my machine.
Use andromda server:
There is a mvn mda\pom.xml andromda:start-server
This loads a memory resident verion of andromda and loads the xml into memory. This will monitor the model as well and auto-reload it into memory apon changes. In a separate command window you can then issue your normal andromda commands, and it will trigger this 'server window' to perform the andromda portion of your build. Everything seemed to work with this, but when I did my build I got some compile errors that I did not have doing the non server build.... maybe have a path issue or something... going to have to look into this further. This method on my machine compiled in 30 seconds, saving 2mins 15 sec per build... so this will warrent some further investigation. If anyone has any insight into the andromda server let me know.
Build only the modules you are working on:
You are supposed to be able to run
mvn -f core/pom.xml to compile just the core package, but this totally blows up for me due to dependencies in the common package etc. Did not have time to frig with this ... again, any insight on getting this going, please let me know.
Tuesday, June 29, 2010
Friday, June 11, 2010
EJB3 - JBOSS - Andromda created -- deployment
OK.
So the ear built fine, now to get it to deploy properly...
I have installed JBOSS v5.0.1 on my machine. Tried deploying the ear by copying it into:
%JBOSSDeployFolder%\server\default\deploy
Starting getting erros like:
error due to the following reason(s): org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/javaee}jboss is not bound as a global element.
I realized that the jboss.xml file (located inside of the 'yourapp-core.jar' file) which is inside of the .ear had the wrong xml namespace defined. To fix it you will need to modify the jboss.xml.vsl file, which is located in the cartridge. As I mentioned in my previous blog post, I maintain a copy of the SNAPSHOT version to keep my changes from being overwritten... to fix the xml namespace issue, I open my andromda-ejb3-cartridge-1.0-JBOSS.jar file (located in my maven local repository as described in previous blog post). Modify the /templates/ejb3/config/jboss/jboss.xml.vsl file. Change the tag to be:
I also had problems where JBOSS gave what is IMHO a really bad error message, it said:
* EJB CholesterolGoalDao has defined EJB2.x local component interface of com.wellnessrecord.domain.goals.CholesterolGoalDao but has no localHome; ; Incomplete EJB2.x View [JBMETA-130]
Which after some investigation, means that the ejb-jar.xml created by Andromda is outdated, and uses the old EJB 2.1 conventions...
This file has sections for each of your session beans of the form:
UserServiceBean
com.wellnessrecord.service.UserServiceRemote
com.wellnessrecord.service.UserServiceBean
Stateless
Container
Well, as it turns out, in EJB3 you need the and tags to be of the form and
To fix, modify the file: /andromda-ejb3-cartridge-1.0-JBOSS.jar\templates\ejb3\config\ejb-jar.xml file. Replace all occurances of with , with , with and with
Run:
mvn clean
mvn install
Redeploy your .ear to JBOSS.
So the ear built fine, now to get it to deploy properly...
I have installed JBOSS v5.0.1 on my machine. Tried deploying the ear by copying it into:
%JBOSSDeployFolder%\server\default\deploy
Starting getting erros like:
error due to the following reason(s): org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/javaee}jboss is not bound as a global element.
I realized that the jboss.xml file (located inside of the 'yourapp-core.jar' file) which is inside of the .ear had the wrong xml namespace defined. To fix it you will need to modify the jboss.xml.vsl file, which is located in the cartridge. As I mentioned in my previous blog post, I maintain a copy of the SNAPSHOT version to keep my changes from being overwritten... to fix the xml namespace issue, I open my andromda-ejb3-cartridge-1.0-JBOSS.jar file (located in my maven local repository as described in previous blog post). Modify the /templates/ejb3/config/jboss/jboss.xml.vsl file. Change the
I also had problems where JBOSS gave what is IMHO a really bad error message, it said:
* EJB CholesterolGoalDao has defined EJB2.x local component interface of com.wellnessrecord.domain.goals.CholesterolGoalDao but has no localHome; ; Incomplete EJB2.x View [JBMETA-130]
Which after some investigation, means that the ejb-jar.xml created by Andromda is outdated, and uses the old EJB 2.1 conventions...
This file has sections for each of your session beans of the form:
Well, as it turns out, in EJB3 you need the
To fix, modify the file: /andromda-ejb3-cartridge-1.0-JBOSS.jar\templates\ejb3\config\ejb-jar.xml file. Replace all occurances of
Run:
mvn clean
mvn install
Redeploy your .ear to JBOSS.
Subscribe to:
Posts (Atom)