cancel
Showing results for 
Search instead for 
Did you mean: 

Access CMP Bean using XI Mapping

Former Member
0 Kudos

Hi to all,

I am trying to access CMP bean deployed on the J2EE engine (XI) from the XI mapping program and getting the "java.lang.ClassCastException".

*Source Code: *



//Variable Declaration
Object obj = null;
MyPhoneLocalHome home = null;

//Getting the context
javax.naming.InitialContext ic = new javax.naming.InitialContext();

//Searching the bean
obj = ic.lookup("localejbs/MyPhoneBean");

trace.addInfo("Object: " + obj.toString() );

//Type casting the object
home = (MyPhoneLocalHome) obj;

*Outputs of the above Code: *

java.lang.ClassCastException: phonepak.MyPhoneLocalHomeImpl0_0 is incompatible with the phonepak.MyPhoneLocalHome

*Reason For error: * The object is unable to type cast to the Local Home Interface.

Server Details : SAP XI 3.0 SP20

Reference which I tried to resolve:

Help from SAP: Link: [http://help.sap.com/saphelp_nw04/helpdata/en/f4/302c4142aef623e10000000a155106/frameset.htm]

How to: Link: [http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/605ff5f2-e589-2910-3ead-e558376e6f3d;jsessionid=(J2EE3417200)ID2029571250DB01833717324931380476]

Some Points:

- Java Reflection cannot be used as the code is developed with java 1.4 and my server is on XI not PI

- The object of the bean is retrieved using the lookup.

It would be highly appreciated if anyone know how to resolve this issue? Please let me know if you want to know any other part of the code.

If there is any other way to access an CMP bean from the XI mapping then it would be great if you can share that too..

Thanks

Srini

Accepted Solutions (1)

Accepted Solutions (1)

former_member184154
Active Contributor
0 Kudos

Hi,

I can't really help here, except that you should post to J2EE guys, 'cause it doesn't look to me as a real XI/PI issue... But more likely strictly related to how ejbs are deployed and then accessible.

Cheers,

Alex

Answers (0)