cancel
Showing results for 
Search instead for 
Did you mean: 

IConnectorGatewayService throws an Error in Service call

Former Member
0 Kudos
57

Hi,

I want to connect using JDBC to SQLServer. I am using EP6 SP9 + PDK. I use the following function to return the connection, but it throws me an 'Error in Service Call' error while getting the Connector Gateway Service (IConnectorGatewayService):

	private IConnection getJDBCConnection(String systemAlias, IPortalComponentRequest request) throws ConnectorException {
		// Use the Connector Gateway to get connection to JDBC DB
		try {
			// Get Connector Gateway Service
			IConnectorGatewayService cgService = 
				(IConnectorGatewayService) PortalRuntime.
				getRuntimeResources().getService(IConnectorService.KEY);
			if (cgService == null) {
				throw new ConnectorException("Error in get Connector Gateway Service");
			}

			// Get Connection Properties Object
			ConnectionProperties cp = new ConnectionProperties(
					request.getLocale(),request.getUser());
				
			return cgService.getConnection(systemAlias, cp);
				
		} catch (NoLogonDataAvailableException e) {
			throw new ConnectorException("*** No Logon Data supplied: "
					+ e.getNestedException().getLocalizedMessage());
		} catch (ConnectorException e) {
			throw new ConnectorException("*** Connector Exception: "
					+ e.getLinkedException().getLocalizedMessage());
		}
	}

In my portalapp.xml I have defined:

  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.ivs.connectorservice"/>
  </application-config>

Can anyone help me out for some nice reward points?

Cheers,

Joost

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joost,

your code is running fine for me, just tested it.

What is the exact stacktrace of your exception?

Look into the defaultTrace.trc

Regards, Karsten

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Joost,

that's strange, your reference is correct.

Which version of the SAP developer studio do you have?

Do you have the following import statement:

import com.sapportals.portal.ivs.cg.IConnectorGatewayService;

(because there's another IConnectorGatewayService within a different package)

Regards, Karsten

Former Member
0 Kudos

Hi Karsten,

My NWDS version is 2.0.9, so this should not be the problem I guess. I also checked the import statement, also this is identical with the one you suggested. With the JAR Class Finder I checked for existance of other classes with this match, but there is only one match (com.sap.portal.ivs.Connectorservice_api.jar).

Any other thoughts?

Thanks,

Joost

Former Member
0 Kudos

The error you are getting basically means that you are sharing reference is incorrect. Looking at your first post, it seems you have specified the sharing reference correctly but it would nice if you can post the complete portalapp.xml.

Former Member
0 Kudos

Hi Prakash,

And here is the complete portal.xml:

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.ivs.connectorservice"/>
  </application-config>
  <components>
    <component name="SimpleJDBC">
      <component-config>
        <property name="ClassName" value="com.linqit.SimpleJDBC"/>
        <property name="JSP" value="pagelet/display.jsp"/>
      </component-config>
      <component-profile>
        <property name="System" value="NorthWindDB"/>
        <property name="Query" value="SELECT dbo.Products.ProductName,dbo.Categories.CategoryName FROM dbo.Products,dbo.Categories WHERE dbo.Categories.CategoryID=dbo.Products.ProductID"/>
        <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

I hope you have an idea, because it is driving me crazy!

Cheers,

Joost

Former Member
0 Kudos

Hi Joost,

I can only guess, since I have no SP9 portal anymore.

Try adding the following additional reference:

com.sap.portal.ivs.internalconnector

Regards, Karsten

Former Member
0 Kudos

Hi friends,

I solved the problem! I added an additional ServiceReference in the portalapp.xml (I found this solution after going through some SAP source code examples):

  <application-config>
    <property name="ServicesReference" value="com.sap.portal.ivs.connectorservice"/>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
  </application-config>

This works for SP9. Thanks again for your suggestions.

Regards,

joost

Former Member
0 Kudos

Hi Joost,

just fyi,

"ServicesReference" means exact the same as "SharingReference".

Regards, Karsten

Former Member
0 Kudos

Hi Karsten,

Are you also running SP9? I have tested my code on SP6 at customer site, but then it is running just fine. The exception is also not catched on my SP9 installation, I get an error message in the browser:

-


Portal Runtime Error

An exception occurred while processing a request for :

iView : JDBC-Simple.SimpleJDBC

Component Name : JDBC-Simple.SimpleJDBC

com/sapportals/portal/ivs/cg/IConnectorGatewayService.

Exception id: 01:17_26/07/05_0016_3820850

See the details for the exception ID in the log file

-


The Stack Trace in J2EE Visual Administrator says:

-


Exception ID:01:17_26/07/05_0016_3820850

[EXCEPTION]

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

Component : JDBC-Simple.SimpleJDBC

Component class : com.linqit.SimpleJDBC

User : Administrator

at

com.sapportals.portal.prt.core.PortalRequestManager.handle

PortalComponentException(PortalRequestManager.java:969)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:153)

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

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

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

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

Caused by: java.lang.NoClassDefFoundError: com/sapportals/portal/ivs/cg/IConnectorGatewayService

at com.linqit.SimpleJDBC$SimpleJDBCDynPage.getJDBCConnection(SimpleJDBC.java:173)

at com.linqit.SimpleJDBC$SimpleJDBCDynPage.getQueryResults(SimpleJDBC.java:147)

at com.linqit.SimpleJDBC$SimpleJDBCDynPage.setupBean(SimpleJDBC.java:126)

at com.linqit.SimpleJDBC$SimpleJDBCDynPage.doInitialization(SimpleJDBC.java:54)

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

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

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:328)

... 29 more

-


Hopefully you can help me out...

Thanks,

Joost