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



Reply via email to