plugin development jms, jndi [message #42512] |
Tue, 21 January 2003 05:53  |
Eclipse User |
|
|
|
Originally posted by: mirk.tonia.ch
hello,
i'm up to develop an eclipse plugin that acts as a subscriber to a jms
server.
now i'm having problems creating the javax.naming.InitialContext i need to
create the connection to my openjms server.
here's the code:
public void init(IViewSite site) throws PartInitException {
super.init(site);
msg = "jms view";
try {
Properties props = new Properties();
props.put(Context.PROVIDER_URL, "rmi://192.168.168.12:1099/JndiServer");
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory");
System.out.println("env is redy...");
Context context = new InitialContext(props);
System.out.println("initialcontext: " + context);
tcf = (TopicConnectionFactory)context.lookup(FACTORY);
tconnection = tcf.createTopicConnection();
tsession = tconnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic)context.lookup(TOPIC);
tsubscriber = tsession.createSubscriber(topic);
tsubscriber.setMessageListener(this);
tconnection.start();
} catch (Exception e) {
e.printStackTrace();
throw new PartInitException("jms not inited", e);
}
}
i get the following stacktrace below
can anyone help me with that. the code works if i run it outside of the
plugin.
i tryed including the jars containing the
org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory class with the plugin
(i put a <library id='openjms-rmi-0.7.3.1.jar' /> inside the <runtime> tag.
this jar contains the org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory
class but it didn't help finally i also put all the other
openjms jar includeing the exolabcore.jar but did not help ether.
the stacktrace:
javax.naming.NoInitialContextException: Cannot instantiate class:
org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory. Root exception is
java.lang.ClassNotFoundException:
org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at ch.zilch.eclipse.hello2.views.JmsView.init(JmsView.java:55)
at org.eclipse.ui.part.ViewPart.init(ViewPart.java:78)
at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:1 24)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:852)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFact ory.java:93)
at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:7 7)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory. java:73)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1348)
at
org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:579)
at org.eclipse.ui.internal.WorkbenchPage.access$8(WorkbenchPage .java:558)
at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2540)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2537)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2527)
at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:181)
at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:167)
at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :41)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:769 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
ContributionItem.java:411)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
ributionItem.java:365)
at
org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
tem.java:356)
at
org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
ctionContributionItem.java:48)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1692)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1410)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1446)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1429)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
a:845)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
at org.eclipse.core.launcher.Main.run(Main.java:703)
at org.eclipse.core.launcher.Main.main(Main.java:539)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03120 seconds