cancel
Showing results for 
Search instead for 
Did you mean: 

ClassCastException in Remote Weblogic Ejb

Former Member
0 Kudos

Hello

We have one EJB deployed in a Weblogic Server.

When we connected with a junit client to the ejb the comunication is correct, but if the client is a Webdynpro project deployed in the server SAP WAS there is a classcast exception when is executed the PortableRemoteObject.narrow method.

Our client code is this:

private ObjectHome getHome() throws Exception {

String jndiname = "ejb/name";

Object ref = getContext().lookup(jndiname);

ObjectHome objectHome=(ObjectHome)PortableRemoteObject.narrow(ref, ObjectHome.class);

return ampliacionJornadaHome;

}

private InitialContext getContext() throws NamingException {

Hashtable props = new Hashtable();

props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

props.put(InitialContext.PROVIDER_URL, "t3://server:7010");

props.put("force_remote", "true");

InitialContext initialContext = new InitialContext(props);

return initialContext;

}

public void onActionClass(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

try

{

HashMap parameters = new HashMap();

ObjectHomeHome ejbHome = getHome();

}

catch (Exception e) { }

}

The ClassCastException is generated in the PortableRemoteObject.narrow(ref, ObjectHome.class),

We have detected that the getContext().lookup(jndiname); return the next object “com.sap.engine.services.iiop.CORBA.CORBAObject:com.sap.engine.services.iiop.server.portable.Delegate_1_2@cee0f4”

Any suggestion will be well received.

Thanks and Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Alfredo

did you find any solution to this class cast ?

I got the same exception and I tested a lot of things but no solutions.

Thks

Johann

stefan_grube
Active Contributor
0 Kudos

As this is not XI/PI related you should post this question to another forum, like Java Programming.

Regards

Stefan