Prepare:
-
Download the latest version of JBossIDE ( JBossIDE-1.5M2-Bundle-win32.zip is recommended)
-
Download the latest version of XDoclet , extract to a folder and copy *.* to eclipse/plugins/org.jboss.ide.eclipse.xdoclet.core_1.5.0.M2/, or extract to eclipse/plugins/org.jboss.ide.eclipse.xdoclet.core_1.5.0.M2/ directly.
-
Download and install JBoss4.0.0(the default configuration of 4.0.0 is J2EE1.4 compliant, and the default configurations of 4.0.1 and above are not fully J2EE1.4 compliant)
-
install WebSphere Application Server 6.0
Development:
-
Create a new J2EE 1.4 Project, a stateless session bean with local interface, a servlet which would lookup the ejb and invoke some methods.
-
Config XDoclet properties to add extra support for WebSphere.(the support for JBoss is provided by default)
-
Add XDoclet annotation "@ejb.util generate="physical"" to the ejb class
-
Run XDoclet, then you will get source files for ejb home and deployment descriptors for both JBoss and WebSphere.
-
Modify "SomeEjbLocalHome.JNDI_NAME" from "xxx" to "local:xxx", this is a workground for WebSphere
-
Modify jndi references in all descriptors from "xxx" to "local:xxx".
-
Create "application.xml" in META-INF manually, fill its content just like below:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE application (View Source for full doctype...)>
-
Config "Packaging Configurations" of project, add descriptors for WebSphere to standard war and standard jar.(once again, the descriptors for JBoss are included in standard war&jar by default)
-
Run "Packaging", then you will got yourejb.jar and youweb.war
-
Config "Packaging Configurations" of project, create the app.ear which include yourejb.jar and youweb.war and application.xml
-
Run "Packaging" again to create app.ear
Deployment:
-
you can use JBossIDE deploy app.ear to JBoss directly
-
or you can use any other methods such as Web Administration Console to deploy our application to WebSphere and JBoss