Re: ClassCastException while doing REMOTE ejb lookup from a web module

2002-04-08 Thread Scott Farquhar

Most often this is caused by having a two different compiled versions of 
your class.

Ensure that you have only one copy of the class available to your 
web-application.  If you are using web  ejb in the same container, then 
you can access the classes from the ejb layer in your web app.

This document may help you understand where to put your classes:

http://kb.atlassian.com/content/atlassian/howto/classloaders.jsp

Cheers,
Scott

[EMAIL PROTECTED] wrote:
 Hi,
 
 I am getting a ClassCastException when I try to narrow a lookup on a 
 remote stateless session bean from a jsp page.  My configuration is 
 orion 1.5.4 with an application for the remote stateless session bean 
 and an application for the web module.  For testing purposes, I am 
 running under the same instance of orion.  Below is a snippet of code 
 from the jsp page accessing the remote ejb.
 
 %
 KBKTestHome kbkHome = null;
 KBKTest kbkTest = null;
 Hashtable env = new Hashtable();
 Context jndi = null;
 
 env.put(Context.INITIAL_CONTEXT_FACTORY,
   com.evermind.server.rmi.RMIInitialContextFactory);
 env.put(Context.PROVIDER_URL,
   ormi://localhost:23809/kbk-test-application);
 env.put(javax.naming.Context.SECURITY_PRINCIPAL, admin); 
 env.put(javax.naming.Context.SECURITY_CREDENTIALS, 123); 
 jndi = new InitialContext(env);
 kbkHome=(KBKTestHome)PortableRemoteObject.narrow(
   jndi.lookup(ejb/test),KBKTestHome.class);
 kbkTest = kbkHome.create();
 String timeIs = kbkTest.getTime();
 %
   
 I have modified my orion-application.xml file for the remote ejb to 
 allow read and write namespace access to group RMI.  I have also 
 modified my principals.xml file for the remote ejb to give the group 
 RMI rmi:login permissions.  I beleive I am finding the home 
 interface to the remote ejb successfully, but can't seem to cast it 
 appropriately.  
 
 I searched the mailing list archives and found a recent reference to 
 what appears to be a similar problem
 (http://www.mail-archive.com/orion-
 [EMAIL PROTECTED]/msg17468.html)  However, I did not find a 
 resolution to the problem.
 
 Any help is appreciated.
 
 Kent Kvarfordt
 
 


-- 
Scott Farquhar :: [EMAIL PROTECTED]

Atlassian :: http://www.atlassian.com
  Supporting YOUR J2EE World






RE: ClassCastException while doing REMOTE ejb lookup from a web module

2002-04-08 Thread Dillon, Ryan

Hi,

I had a similar problem, and found the post
you mentioned. I followed up with Ashok but 
apparently he is an OC4J developer and
i dont think it has been fixed in Orion :(

Regards
Ryan

-Original Message-
From: [EMAIL PROTECTED]
To: Orion-Interest
Sent: 9/04/2002 7:35 AM
Subject: ClassCastException while doing REMOTE ejb lookup from a web module

Hi,

I am getting a ClassCastException when I try to narrow a lookup on a 
remote stateless session bean from a jsp page.  My configuration is 
orion 1.5.4 with an application for the remote stateless session bean 
and an application for the web module.  For testing purposes, I am 
running under the same instance of orion.  Below is a snippet of code 
from the jsp page accessing the remote ejb.

%
KBKTestHome kbkHome = null;
KBKTest kbkTest = null;
Hashtable env = new Hashtable();
Context jndi = null;

env.put(Context.INITIAL_CONTEXT_FACTORY,

com.evermind.server.rmi.RMIInitialContextFactory);
env.put(Context.PROVIDER_URL,
ormi://localhost:23809/kbk-test-application);
env.put(javax.naming.Context.SECURITY_PRINCIPAL, admin); 
env.put(javax.naming.Context.SECURITY_CREDENTIALS, 123); 
jndi = new InitialContext(env);
kbkHome=(KBKTestHome)PortableRemoteObject.narrow(

jndi.lookup(ejb/test),KBKTestHome.class);
kbkTest = kbkHome.create();
String timeIs = kbkTest.getTime();
%
  
I have modified my orion-application.xml file for the remote ejb to 
allow read and write namespace access to group RMI.  I have also 
modified my principals.xml file for the remote ejb to give the group 
RMI rmi:login permissions.  I beleive I am finding the home 
interface to the remote ejb successfully, but can't seem to cast it 
appropriately.  

I searched the mailing list archives and found a recent reference to 
what appears to be a similar problem
(http://www.mail-archive.com/orion-
[EMAIL PROTECTED]/msg17468.html)  However, I did not find a 
resolution to the problem.

Any help is appreciated.

Kent Kvarfordt