-
1. Re: ClassCastException while outside IDE, works fine in IDE.
prabhakar Oct 22, 2002 6:25 PM (in response to jcowgar)Can you post the stack trace?
-prabhakar -
2. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 7:22 PM (in response to jcowgar)java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.eldoserv.ejbs.interfaces.PatientSessionUtil.getHome(PatientSessionUtil.java:34)
at com.eldoserv.knopro.eclipse.views.PatientSearchResultsView.search(PatientSearchResultsVie
w.java:506)
at com.eldoserv.knopro.eclipse.views.PatientSearchView$1.widgetSelected(PatientSearchView.ja
va:116)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:87)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1420)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1403)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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)
Sorry. Thanks for looking at the problem.
Jeremy Cowgar
jc@cowgar.com -
3. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 7:24 PM (in response to jcowgar)That was kinda silly. I have quite a few beans and when I read my original message, I saw that I was quering the ClaimEntity bean, not the Provider or Patient bean that I gave the stack trace for.
Here is the stack trace that the code in the first message creates.
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.eldoserv.ejbs.interfaces.ClaimSessionUtil.getHome(ClaimSessionUtil.java:34)
at com.eldoserv.knopro.eclipse.views.ClaimSearchResultsView.search(ClaimSearchResultsView.ja
va:409)
at com.eldoserv.knopro.eclipse.views.ClaimSearchView$1.widgetSelected(ClaimSearchView.java:1
01)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:87)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1420)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1403)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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)
Jeremy Cowgar
jc@cowgar.com -
4. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 7:28 PM (in response to jcowgar)I'm sorry, I need to stop posting as quick. That stack trace is not right either, wrong example again, but here is the code that created the above error message, ClaimSessionUtil.java, Lines: 28-38
public static com.eldoserv.ejbs.interfaces.ClaimSessionHome getHome() throws NamingException
{
// Obtain initial context
InitialContext initialContext = new InitialContext();
try {
java.lang.Object objRef = initialContext.lookup(com.eldoserv.ejbs.interfaces.ClaimSessionHome.JNDI_NAME);
return (com.eldoserv.ejbs.interfaces.ClaimSessionHome) PortableRemoteObject.narrow(objRef, com.eldoserv.ejbs.interfaces.ClaimSessionHome.class);
} finally {
initialContext.close();
}
}
Jeremy Cowgar
jc@cowgar.com -
5. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 7:29 PM (in response to jcowgar)Oh, in case you didn't see, the whole ClaimSessionUtil.java file is attached.
Jeremy -
6. Re: ClassCastException while outside IDE, works fine in IDE.
prabhakar Oct 22, 2002 8:14 PM (in response to jcowgar)When you use the client outside eclipse, are you adding the jars in $jboss/client/lib to your classpath.
-prabhakar -
7. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 8:26 PM (in response to jcowgar)Yes. I have no problems with finding classes.
Jeremy Cowgar
jc@cowgar.com -
8. Re: ClassCastException while outside IDE, works fine in IDE.
prabhakar Oct 22, 2002 10:10 PM (in response to jcowgar) -
9. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 22, 2002 11:25 PM (in response to jcowgar)Yeah, I saw that one before. I have never had anything but 3.0.3 on my system, so that one does not apply :(
The thing that is strange is that it works great in the IDE and does not outside.
Jeremy Cowgar
jc@cowgar.com -
10. Re: ClassCastException while outside IDE, works fine in IDE.
juha Oct 23, 2002 12:55 PM (in response to jcowgar)Does your IDE run a different version of the JDK (rt.jar specifically)?
-
11. Re: ClassCastException while outside IDE, works fine in IDE.
jcowgar Oct 24, 2002 6:53 PM (in response to jcowgar)No, it's eclipse and when installs asks which RT you wish to use. I think it has to do something with Eclipse using class loaders.
Jeremy