cancel
Showing results for 
Search instead for 
Did you mean: 

Java mapping problem on HTTPS

Former Member
0 Kudos

Hi java mapping experts,

I am trying to use PI JAVA mapping to get data from a secure site via HTTPS.  The site requires login credential; I use class Authenticator to include username and password in the java program and it works fine. I run the java program in NWDS and it returns the data successfully from the site without referring to any certificates. The java program uses class javax.net.ssl.HttpsURLConnection to do the connection. But when I import the jar file into PI java mapping, I am getting the following error. It appears that the incompatibility between the two classes (javax.net.ssl.HttpsURLConnection and iaik.protocol.https.HttpsURLConnection) caused problem. Somehow PI automatically tries to use the class type of iaik.protocol.https.HttpsURLConnection even though it is not the class that the java program uses. BTW, we are on PI 7.1.

Some info from SXMB_MONI is lised below.

<SAP:Stack>StreamTransformationException triggered by application mapping program com/XXXXXX/cybersource/cybersource; class iaik.protocol.https.HttpsURLConnection:libr~</SAP:Stack>

<Trace level="1" type="T">Java mapping com/XXXXXX/cybersource/cybersource has thrown a StreamTransformationException. Thrown: com.sap.aii.mapping.api.StreamTransformationException: class iaik.protocol.https.HttpsURLConnection:library:mail-activation-iaik@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@3e0f5f77@alive incompatible with class javax.net.ssl.HttpsURLConnection:null at com.fossil.cybersource.cybersource.doTheWork(cybersource.java:179) at com.fossil.cybersource.cybersource.transform(cybersource.java:30) at

I need your expertise to shed some light on this for me. Thanks in advance for your help and appreciate your time on this. Below are the items that I am searching for the answers.

  • ·         Has anybody used class javax.net.ssl.HttpsURLConnection in PI mapping successfully for HTTPS? If so, how do you get around the incompatibility issue?

  • ·         If we have to use class iaik.protocol.https.HttpsURLConnection, is it required to import certificates to the trustStore? The location of the trustStore at NWDS could be different from that in PI server, how do you make it work in both cases with the same java program?

Hopefully, you can provide me directions in detail. Again, your help is greatly appreciated.

P.S. My NWDS is a standalone installation not linked to our PI system.

Thanks,

Shawn

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Check whether the JDK version of your NWDS and PI system are same or not.

May be the JDK version used in PI, does not support the class you are using.

Former Member
0 Kudos

Hi Indrajit,


Thanks for your reply.


This is a good point. The JDK version in the NWDS is 1.6.0_45. I wrote a simple test program and got the trace info from PI as below. The java version in PI is 1.5.0_28; it does not match what's in NWDS. I could not find a site to download the old JDK 1.5.0_28. I will ask Basis see if they can provide me the old java JDK. I will try to install JDK 1.5.0_28 in NWDS once I get it and see how it goes.

<Trace level="2" type="T">*****Java Home = /usr/sap/PID/DVEBMGS00/exe/sapjvm_5/jre</Trace>

     <Trace level="2" type="T">java version = 1.5.0_28</Trace>

     <Trace level="2" type="T">check if JSEE installed</Trace>

     <Trace level="2" type="T">JSSE is installed correctly!</Trace>

     <Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>

Thanks,
Shawn

engswee
Active Contributor
0 Kudos

Hi Shawn

You can download JDK 5 from Oracle's Java Archive.

Java Archive Downloads - Java SE 5

Rgds

Eng Swee

Former Member
0 Kudos

Thanks Eng Swee.

I did check out the Java archive downloads site. The latest update version was 22 and I could not find the version that I need - jdk-1_5_0_28.

Thanks,

Shawn

engswee
Active Contributor
0 Kudos

Hi Shawn

The 1.5.0_28 that is shown in your trace above refers to the JRE version of your PI system.

JDK and JRE are different (you can search on the web on what is the difference) and so are the versions.

The highest version of JDK 1.5 released by Sun/Oracle is 22, AFAIK, you won't be able to find a version 28 anywhere.

You should be able to use that version in your NWDS to develop for PI7.11.

Rgds

Eng Swee

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am a PI consultant, but not a JAVA expert. However would like to help you after reading your post as per my understanding.

From the comment which you have written, it seems like there is no connection which could have been developed between the environment in which JAVA is running and PI.

This seems to be because of the fact that instead of using the complete extension classes like javax.net.ssl.HttpsURLConnection and iaik.protocol.https.HttpsURLConnection, you can try using the class HttpsURLConnection which exists both in PI as well as JAVA envoronment. I think, then it will find a link between the two environments as the source class is common with the above mentioned two classes being its extension.

Note: You can then apply the extension classes wherever applicable.

Kindly let me know in case of any issues. Thanks.

Best Regards,

Souvik Bhattacharjee

Former Member
0 Kudos

Thanks Souvik for your reply.

I am trying to use JSSE to do HTTPS.

In the java program, class type HttpsURLConnection was used. The related code is shown as below.

 

import java.net.URL; 

import javax.net.ssl.HttpsURLConnection;

... 

HttpsURLConnection conn = (HttpsURLConnection) destinationURL.openConnection();

...

Thanks,

Shawn