Skip to Content
0
Former Member
Jul 26, 2005 at 05:37 AM

IConnectorGatewayService throws an Error in Service call

20 Views

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