on 06-26-2010 3:28 PM
Hi, experts:
I write a JRA method to call a R3 RFM in a session bean.
the code looks like below:
...
import javax.naming.InitialContext;
import javax.resource.cci.Connection;
import javax.resource.cci.ConnectionFactory;
import javax.resource.cci.Interaction;
import javax.resource.cci.MappedRecord;
import javax.resource.cci.RecordFactory;
import javax.resource.cci.ResultSet;
...
InitialContext initialcontext = new InitialContext();
ConnectionFactory connectionfactory = (ConnectionFactory) initialcontext.lookup(CONN_FACTORY_NAME);
...
I write above code based on the SAP online help
http://help.sap.com/saphelp_nwce711core/helpdata/en/83/c70242e5216324e10000000a1550b0/frameset.htm
but when program running, an exception happen.
java.lang.ClassCastException: class com.sap.engine.services.jndi.implclient.ClientContext:service:naming @ com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 26f04d94 @ alive incompatible with interface javax.resource.cci.ConnectionFactory:library:j2eeca @ com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 1cf38f09@alive
It seems error happen in the second line, but I don't know what else class I can use to replace ConnectionFactory class.
Any reply would be very appreciated.
I found the error was caused by given wrong JNDI string.
I should specify to the deepest in the JNDI tree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.