History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: EJB-28
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vance Karimi
Reporter: Torsten Lunze
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
EJB Cartridge

EJB3 : Adding <jar-file> element to persistence xml

Created: 08/Jun/06 09:10 AM   Updated: 14/Jun/06 10:12 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: Andromda 3.2, EJB3 Cartridge


 Description   
Support a property to generate the <jar-file> element in the persistence.xml

 All   Comments   Change History      Sort Order:
Comment by Torsten Lunze [08/Jun/06 09:25 AM]
I already did this, so here my how to:

1. In cartridge.xml add <property reference="ejb-jars"/>
2. In namespace.xml add

<property name="ejb-jars" required="false">
   <default></default>
<documentation>
The ejb jars to be included.
</documentation>
</property>

   (I did this in project group JDBC?)

3. In persistence.xml.vsl add this (below <jta-data-source>)

#if ($stringUtils.isNotBlank($ejb-jars))
#set ($ejb_jar_array = $stringUtils.split($ejb-jars,','))
#* *##foreach ($ejb_jar in $ejb_jar_array)
#* *##if ($stringUtils.isNotBlank($ejb_jar))
        <jar-file>${ejb_jar}</jar-file>
#* *##end
#* *##end

#end

4. In the andromda project add this in the ejb3 cartridge namespace

  <property name="ejb-jars">${ejb-jars}</property>
 
Is this automatically generated if a new andromda project is created using andromdapp?

5. Using maven 2 add this to your pom.xml (a comma separated list of the jars):

<ejb-jars>../lib1.jar,../lib2.jar</ejb-jars>

Hope I didnt missed anything

Comment by Vance Karimi [14/Jun/06 10:12 AM]
Thanks for the fix.

I have applied to CVS.

Keep in mind, I changed the property from ejb-jars to jarFiles.

This is not something the andromdapp generator would need to generate. It will be available in the namespace doc and should be manually added to the andromda.xml if required.