Skip to Content
0

java.lang.ClassCastException: Cannot cast class com.sapportals.connectors

Jun 05, 2017 at 08:28 PM

288

avatar image

Hi All,

I have been facing below error while running EJB Job in SAP EP Portal 7.31.

java.lang.ClassCastException: Cannot cast class com.sapportals.connectors.SAPCFConnector.connection.SAPCFConnectorConnectionFactory to interface com.sapportals.connector.connection.IConnectionFactory (found matching interface com.sapportals.connector.connection.IConnectionFactory loaded by library:tc~conn~connectorframework@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@6bf77ee@alive, but needed loader JavaEE/xxxxxEAR@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@37fe14b4@alive)

Not sure what would be the issue since everything looks fine for me in the Job.

Any suggestion would be appreciated.Thanks.

import com.sap.scheduler.runtime.mdb.MDBJobImplementation;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import com.sap.scheduler.runtime.JobContext;
import com.sap.scheduler.runtime.JobContext;
import com.sap.scheduler.runtime.mdb.MDBJobImplementation;
import com.sap.security.api.IGroup;
import com.sap.security.api.IGroupFactory;
import com.sap.security.api.IGroupSearchFilter;
import com.sap.security.api.IRole;
import com.sap.security.api.IRoleFactory;
import com.sap.security.api.IRoleSearchFilter;
import com.sap.security.api.ISearchResult;
import com.sap.security.api.IUser;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.IUserSearchFilter;
import com.sap.security.api.UMException;
import com.sap.security.api.UMFactory;
import com.sapportals.connector.connection.IConnection;
import com.sapportals.connector.connection.IConnectionFactory;
import com.sapportals.connector.connection.IConnectionSpec;
import com.sapportals.connector.execution.functions.IInteraction;
import com.sapportals.connector.execution.functions.IInteractionSpec;
import com.sapportals.connector.execution.structures.IRecordSet;
import com.sapportals.connector.metadata.functions.IFunction;
import com.sapportals.connector.metadata.functions.IFunctionsMetaData;
import java.util.Calendar;
import java.util.Date;
import javax.ejb.MessageDriven;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.resource.cci.MappedRecord;
import javax.resource.cci.RecordFactory;


<br>
 IConnectionFactory connectionFactory = 
	        (IConnectionFactory)ctx.lookup("deployedAdapters/SAPFactory/shareable/SAPFactory");
	    


	      IConnectionSpec spec = connectionFactory.getConnectionSpec();
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers