Question

So we are currently analysing if it is feasible to move out from MyEclipse->Eclipse and one of the areas where we are currently stuck is EJB Deploy.

In MyEclipse there is an option named 'Run EJB Deploy' which generates .ejbDeploy folder with the stubs and tie's for the EJB project, however in Eclipse Kepler there is "Prepare For Deployment" option(Right Click on Project->Java EE Tools->Prepare for Deployment) which I am presuming does the same thing.

However, when I click that option ( Prepare for Deployment ) it conveniently ignores it and does not do anything.

I am not sure what needs to be done to ensure this works the same way as MyEclipse IDE and it generates a resultant .ejbDeploy folder like it does in Eclipse with stubs.

Also, if this is not possible, can we achieve similar bahevior using ANT or MAVEN?

Any insights will be helpful.

P.S: We are currently using EJB 2.1 and dont have any plans to move to EJB 3.0 soon so steps related to EJB 2.1 will help. Also, for the purpose of this evaluation, we are using Websphere 7.0 which is the server that we want to use

Thanks, Yogendra

Was it helpful?

Solution

Okie, so I did the following as a work around for getting this to work :

  1. In the WAS 7 installation bin directory - WAS_PATH/AppServer/bin there is a tool provided by WAS named "ejbdeploy.bat" which achieves the functionality that I am expecting.

Simply running the following command solved the problem for me:

ejbdeploy.bat -cp "C:\tpp\FW.jar;C:\tpp\DA.jar;C:\tpp\Common.jar" C:\tpp\AR.jar C:\tpp C:\tpp\deployed\AR.jar -complianceLevel 5.0

It takes the following inputs:

  • Input Jar / Ear
  • Classpath of all the required JARs
  • Working Directory where the temporary files will be generated
  • Output JAR / EAR
  • Compliance level to indicate which version of JDK should be used to validate the compiled code 1.4, 5.0, 6.0

Hope this helps anyone looking for similar solutions.

Thanks, Yogendra

OTHER TIPS

Thanks Yogendra, your post really helped me.

This post definitely works at the time, if you are migrating your project from RAD to Eclipse and have EJB 1.x -2.x in your project.

Did it in RedHat LINUX machine as follows.

WAS 8 installation bin directory (/opt/IBM/Websphere/8.0/Appserver/bin most probably)

open terminal. go to till WAS bin path

WAS 8 installation bin directory > ./ejbDeploy - cp /home/ramesh/a.jar:/home/ramesh/b.jar:/home/ramesh/c.jar /home/ramesh/source.ear /home/ramesh /home/ramesh/target.ear

Here - cp specifies class path, a.jar,b.jar and c,jars are input JAR files for your source.jar (source.ear would generate via Eclipse IDE , File -> export -> enter EAR -> select EAR file from the list. This source EAR is without stub and tie classes.)

/home/ramesh is the working directory where temp files will get generate.

[machine name bin]$ ./ejbdeploy.sh  -cp  /home/ramesh/a.jar:/home/ramesh/b.jar:/home/ramesh/c.jar /home/ramesh/source.ear /home/ramesh /home/ramesh/target.ear  

tap enter

Starting workbench.
EJB Deploy configuration directory: /opt/IBM/WebSphere/8.0/AppServer/profiles/AppSrv01/ejbdeploy/configuration/ framework search path: /opt/IBM/WebSphere/8.0/AppServer/deploytool/itp/plugins build:RAD8041-I20120428_0424 Creating the project.
Deploying jar c.jar (in my case c.jar is EJB jar generated via IDE without stubs and tie classes)
Validating
Generating deployment code
Invoking RMIC. (RMIC will generate stubs and tie classes for your EJB classes)
Writing output file
Shutting down workbench.
EJBDeploy complete.
0 Errors, 0 Warnings, 0 Informational Messages [machine name bin]$

target.EAR is your EAR file that needs to be deployed in the WAS server manually . for manual installation of EAR, right click on server -> go to Administration - > run administrative console -> Application - > Application types - > Web sphere enterprise application - > click on install button - > browse for EAR file location - > click on next buttons. -> select the text corresponding to your project and click start button. save the changes in master file

up your web site for validation.

Soon I'll update ANT build file for the above.

Happy coding!

Thanks & Regards Naga Ramesh

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top