Skip to Content
0
Former Member
Nov 04, 2004 at 11:06 PM

JCOClientService Class Cast Exception

11 Views

As per the SAP example to connect to the back end SAP system using Java, this is the code I tried using:

IJCOClientService clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService("com.sap.portal.runtime.application.jcoclient.jcoclient");

However, at run time, this gives me a Class cast exception, because the getService method returns a servicecom.sapportals.portal.prt.service.jco.JCOClientService, which is different from the IJCOClientService. However I need the IJCOClientService class to be able to call and execute a BAPI. Does any one have any idea? Also, do you know which Jar file the JCOClientService is in?

If you could get some one to help me out on this, IĀ’d certainly appreciate it.

Thanks,

Haseem

My Exception:

Nov 4, 2004 5:57:41 PM # Client_Thread_15 Info Loading application: SAPEmailPayCheckProject #

Nov 4, 2004 5:57:41 PM # Client_Thread_15 Info Loading services: #

Nov 4, 2004 5:57:47 PM # Client_Thread_36 Warning Was able to get log and ensure bean set up!! #

Nov 4, 2004 5:58:08 PM # Client_Thread_26 Warning Got servicecom.sapportals.portal.prt.service.jco.JCOClientService@4cf174 #

Nov 4, 2004 5:58:08 PM # Client_Thread_26 Fatal Exception ID:05:58_04/11/04_0035

com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component

Component : SAPEmailPayCheckProject.EmailManager

Component class : com.bi.hr.selfservices.paycheck.EmailManager

User : jramondi

at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:858)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:310)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:833)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:665)

at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:312)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1229)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

at java.security.AccessController.doPrivileged(Native Method)

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

Caused by: com.sapportals.portal.prt.component.PortalComponentException: Exception during PageProcessorComponent.doContent()

at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:139)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:833)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:665)

at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:312)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1229)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

at java.security.AccessController.doPrivileged(Native Method)

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

Caused by: java.lang.reflect.InvocationTargetException: java.lang.ClassCastException: com.sapportals.portal.prt.service.jco.JCOClientService

at com.bi.hr.selfservices.paycheck.EmailManager$EmailJSPDynPage.initializeSAPConnectionNewWay(EmailManager.java:153)

at com.bi.hr.selfservices.paycheck.EmailManager$EmailJSPDynPage.onRejectButtonClicked(EmailManager.java:133)

at java.lang.reflect.Method.invoke(Native Method)

at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:172)

at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:101)

at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:135)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:833)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:665)

at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:312)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1229)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

at java.security.AccessController.doPrivileged(Native Method)

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

com.sapportals.portal.prt.connection.ContentExceptionHandler@3402c #