Skip to Content

In case you have a portal or JEE application that connects to an SAP backend, knowing if the connection works is important, even more important can be to know WHY it isn`t working. In the following example I was developing a KM application that uses a DMS Repository Manager from SAP connected to a SAP ABAP backend. The code worked when using /documents as the repository, but failed when using the DMSRM entry path.

The log did not help much, as it only showed that the connection failed.

/wp-content/uploads/2014/08/jco1_464344.jpg

The error message contains some more information, but still isn`t showing why the connection failed.


Caught exception: com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: A nested exception occurred. Could not initialize physical connection.
 at com.sapportals.connectors.SAPCFConnector.SAPConnectorException.getNewConnectionFailedLocalizedException(SAPConnectorException.java:182)
 at com.sapportals.connectors.SAPCFConnector.connection.SAPCFConnectorManagedConnectionFactory.createManagedConnection(SAPCFConnectorManagedConnectionFactory.java:155)
 at com.sap.engine.services.connector.jca.ConnectionHashSet.match(ConnectionHashSet.java:401)
 […]



This traces the error down to the SAP Connector Framework but isn`t helpful when trying to find out what happened exactly. It fails, but where and why exactly is not visible. The system in the portal landscape is configured for SSO using SAPLOGONTICKET and the SSO works perfectly when the connection test is run or the repository is called in the KM. As the error occurs in the CF part, it would be nice to see log messages from there. Obviously only the error messages are shown. But as I already know that an error is occurring, that log message is of little use.

Therefore, it would be nice to increase the log level of CF to see if maybe debug messages are logged. SAP NetWeaver Java comes with a powerful logging and tracing framework that can be accessed and configured using NWA. Changes are reflected immediately, making it even more easy to work with this tool. The question is now: where are the logs stored?

As can be seen in the log message, the package of the CF classes is com.sapportals.connectors.

There is no easy access to the source code to know which class name is used to write the logs into. Using the log configuration in NWA it is possible to search for classes. Searching for connector reveals the following classes.

/wp-content/uploads/2014/08/jco2_464369.jpg

As a ABAP system is called, the R3 class is a good hunch. Setting the log level to Debug.

/wp-content/uploads/2014/08/jco3_464370.jpg

Invoking the method of the Java class again shows now more log messages:

/wp-content/uploads/2014/08/jco4_464371.jpg

There is one error message showing an actual hint on what is not working. Expanding this entry shows what is happening.

/wp-content/uploads/2014/08/jco5_464372.jpg

Thread Hash: 128521575. Could not create JCO connection. Exception:Parameter containing a user ID is missing: neither user nor user alias nor external ID nor SSO ticket nor X.509 certificate is specified. Trying to connect with the default language instead.


The connection cannot be established because a parameter user ID is missing. While the ABAP system in the SAP Portal landscape is configured to use SSO and is working, the DMSRM repository manager has a problem in using SSO. It looks that as a faultback user ID logon is tried. Of course this is not working as no user / password mapping is configured for the system.

Changing the system in the portal landscape to make use of user id mapping solves the issue. Now the KM application is able to connect.

/wp-content/uploads/2014/08/jco6_464373.jpg

As the amount of log messages is drastically increased, the log level should be reset to default after solving the issue.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Andy Silvey

    Hi Tobias,

    nice article thanks for sharing.

    One of my favourite tools for identifying JCo issues in NW7.0x and NW7.3x is:

    SSO Test Url NW 7.0x

         http://YourHost:Port:/irj/servlet/prt/portal/prtroot/com.sap.portal.unification.connection.tester.TestingConnection

    Note 785029 – Tool for testing connections from portal to R/3 system

    NW 7.3x

    http://YourHost:Port:/irj/servlet/prt/portal/prtroot/com.sap.portal.connectivity.tester.Test_Connection

    Regarding logging we must always remember to increment the logging level and scope (branches covered by the logging) with care, as I have crashed a system in the past by setting the logging to high for too wide scope.

    Best regards,

    Andy.

    (0) 

Leave a Reply