File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Invoke EJB in Eclipse2 plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Invoke EJB in Eclipse2 plugin" Watch "Invoke EJB in Eclipse2 plugin" New topic
Author

Invoke EJB in Eclipse2 plugin

Haiqi Liang
Greenhorn

Joined: Oct 30, 2002
Posts: 2
Hi,
I developed a session EJB in WSAD5 and deployed it on Websphser application
server 4.0. Now I'm developing a client application to invoke the remote
methods in Eclipse2 environment.
In my implementation, I developed a client EJB delegate, so that the client
application can access the EJB via the delegate. It comes with:
1) when I develop my client application as a standalone java application in
Eclipse2, and my client application uses the EJB delegate to access remote
methods, it works fine.
2) when I develop my client application as a Eclipse2 plugin, my client
application uses the EJB delegate to access remote methods. Whenever I test
my plugin in Eclipse workbench, it doesn't work, with the following error:
javax.naming.NoInitialContextException: Cannot instantiate class:
com.ibm.websphere.naming.WsnInitialContextFactory. Root exception is
java.lang.ClassNotFoundException:
com.ibm.websphere.naming.WsnInitialContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:513)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:441)
at java.lang.ClassLoader.loadClass(ClassLoader.java:445)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:220)
at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:57)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:661)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.init(InitialContext.java:231)
at javax.naming.InitialContext.<init>(InitialContext.java:207)
at TestPlugin.actions.SampleAction.run(SampleAction.java:53)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:210)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:
180)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(Action
ContributionItem.java:407)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionCont
ributionItem.java:361)
at
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionI
tem.java:352)
at
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(A
ctionContributionItem.java:47)Initial context succeed...
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1529)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1291)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1256)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.jav
a:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
I'm sure that i have add corresponding jars in my classpath and runtime
paths, including j2ee.jar, websphere.jar, ivjejb35.jar, etc.
Does anyone encounter the same problem in your development as mine? Is this
an Eclipse plugin bug?


Liang Haiqi
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Moving to Websphere (mostly because I have not a CLUE . . . )
[ November 06, 2002: Message edited by: Cindy Glass ]

"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Invoke EJB in Eclipse2 plugin