on 09-05-2006 3:37 PM
I have developed a simple EAR which contains a CMP with local and remote interfaces. This cmp may be successfully called using the remote-interface from a client (j2se) project. Now i like to call the same CMP from within a XI JavaMapping. In the execute method i am using the following code:
InitialContext ctx;
MeraConfigurationLocal configLocal = null;
try {
ctx = new InitialContext();
Object obj = ctx.lookup("localejbs/mgb.ch/XIMera_EAR/MeraConfigurationBean");
if (trace != null)
trace.addInfo("Got object from jndi: "+obj);
MeraConfigurationLocalHome configHome = (MeraConfigurationLocalHome)obj;
if (configHome !=null) {
if (trace != null)
trace.addInfo("ConfigurationLocalHome: "+configHome);
}
configLocal = configHome.create();
} catch (Exception e) {
throw new StreamTransformationException(e.getMessage(), e);
}
int port = Integer.parseInt(
configLocal.ReadParam(MeraResourcePoolDispatcherService.CFG_GENERAL_LISTENER_PORT));
if (trace != null)
trace.addInfo("Got listenerport from localejbs/mgb.ch/XIMera_EAR/MeraConfigBean: "+port);
after calling ctx.lookup ... i got the following traceentry in xi:
<Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>
<Trace level="2" type="T">Got object from jndi: ch.migros.mdds.xi.mera.ejb.MeraConfigurationLocalHomeImpl0@6adcb430</Trace>
<Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>
when i try to cast this obj into a MeraConfigurationLocal the system is throwing a ClassCastException
Hello.
Check my wiki article:
http://wiki.sdn.sap.com/wiki/display/stage/SapNetweaverProcessIntegration.CallEjb3.0methodfromJavaclassmappingPI7.1
(SapNetweaver Process Integration. Call Ejb 3.0 method from Java class mapping PI 7.1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.