简体   繁体   中英

Where does WebSphere put the EAR file when RAD does a “Run On Server”? And how to run createEJBStubs on it?

I have a JavaEE-based web app with IBM RAD 7.5 (Eclipse) and WebSphere 7. The app has EJBs with remote interfaces. It runs fine.

I created a new project for JUnit tests, and I'm trying to do a JNDI lookup of the EJB to test it, but I get the following error:

"ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with com.myapp.UserServiceRemote"

To solve this problem, my understanding is I have to run the WebSphere createEJBStubs command to generate remote stubs, so the JUnit app (which is running as a separate application) can look up the EJB.

My question is:

When I run my app from within WebSphere by rightclicking the myappEAR project and selecting "Run As > Run On Server", where does WebSphere put the EAR file that's being run? That is, what folder is it in?

I ask because my understanding is I'm supposed to run the createEJBStubs command on it, which will generated the stubs and put those stubs in the EAR.

Any advice is greatly appreciated, thanks!

Rob

To speed up processing, an EAR is not actually built. Instead, the application is configured so that each module or JAR file is loaded from the RAD workspace. I would recommend exporting the EAR (from either RAD or the WAS admin console), and then using createEJBStubs on the result.

FYI, I followed the instructions here to create an ANT script to build the EJB jar with the stubs included:

http://www-01.ibm.com/support/docview.wss?uid=swg21393419

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM