onsdag den 17. oktober 2007

BEA Weblogic tips

J2EE shared libraries are very useful, because they are merged with your web application you can reuse web resources like JSP's, special framework stuff like BEA controller's and so on.

Here's how you might do it:

creating a shared J2EE library


a library can be any J2EE module. Mind you I've mostly used Portal Web projects as the base for my libraries as I found that I often have web resources in my libraries

defining a shared J2EE library


1. go to the META-INF folder
2. open the MANIFEST.MF file
3. add the following three lines, filling in (example given further down):
4. Extension-Name:
5. Specification-Version:
6. Implementation-Version:

Manifest-Version: 1.0
Extension-Name: common-portlet-template-web
Specification-Version: 0.1
Implementation-Version: 0.1

NOTE: the version MUST be given in order to import the library into BEA Workshop 10.0

exporting a shared J2EE library from a Web project


1. update the versions as commented in 'defining a shared J2EE library'
2. right-click the project, choose 'export->WAR file'

exporting a shared J2EE library from a J2EE Utility project


1. update the versions as commented in 'defining a shared J2EE library'
2. right-click the project, choose 'export->Export', select JAR file, click 'Next'
3. choose your source folders and the META-INF folder for export, click finish

importing a shared J2EE library into the BEA Workshop 10.0


1. in window->preferences->weblogic->J2EE libraries click 'add'
2. click 'browse', locate your exported WAR or JAR or EAR
3. click 'open', click 'ok'
4. adding it to your project is done by expanding the 'WebLogic Deployment Descriptor' in your project
5. right-click -> add, 'browse', locate it and click 'ok'

redeploying a shared J2EE library from the Workshop


1. in window->preferences->weblogic->J2EE libraries select the library and click 'remove'
2. open the server overview by double-clicking the server in the 'Servers' view
3. in the published module list, select the ear project and click 'Undeploy'
4. after the ear has finished undeploying, click the shared Library module, and click 'Undeploy'
5. now your are ready to deploy the library again, do this by going to window->preferences->weblogic->J2EE libraries
6. click 'add', then 'browse' and navigate to your shared library, select the library, click 'ok'
7. redploy the library by running you project on the server.