cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with extracting JAR content using Groovy Script in CPI iflow..... "URI is not hierarchical"

former_member187447
Participant
0 Kudos

Hi folks,

I am trying to implement the following blog from Eng for some hands on in Groovy scripting for CPI.

https://blogs.sap.com/2017/10/06/how-do-you-test-your-groovy-scripts/comment-page-1/#comment-464650

I also followed Vadim's post to trying to extract the Jars.

https://blogs.sap.com/2017/10/02/dark-side-of-groovy-scripting-behind-the-scenes-of-cloud-integratio...

But when I am trying to fetch the Jar content I am having the issue with with URI class,

"An internal server error occured: java.lang.IllegalArgumentException: URI is not hierarchical@ line 14 in Class_JAR_Content.groovy. The MPL ID for the failed message is : AF0aTY5-VXiNuXaV-B9TGBY2ALTg For more details please check tail log."

Please suggest how to fix this issue.

"java.lang.IllegalArgumentException: URI is not hierarchical".

To start with I was trying your modify the header values as per Engs blog as mentioned above. And I got stuck here with class not found exception for “com.sap.it.api.msg.ExchangePropertyProvider”

So then I started to dig into the Jar using Vadim’s post for retrieving the Jar content using the following iflow and the groovy script

Groovy Script

When I try to fetch the base 64 encoding of the JAR by doing a GET query from the POSTMAN this is what I get. “An internal server error occured: java.lang.IllegalArgumentException: URI is not hierarchical” I am struggling to understand what this error means. Please let me know if you have any suggestions?

Regards

kalyan.

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hi Kalyan,

Were you able to solve this issue? Because i'm getting the same issue in extracting the jar file for MessageImpl class.

Regards,

Vikram

former_member187447
Participant
0 Kudos

Hi Eng,

I am just starting to wonder that I don't have access to the file share and thats why I am getting 403 error.

Regards

Kalyan.

former_member187447
Participant
0 Kudos

Hi Eng,

Thanks for the reply.

I followed the comments and I tried both Vadim's approcach and also "Ariel M. Bravo Ayala" approach (https://blogs.sap.com/2019/01/03/exploring-cpis-filesystems-content/) to directly access the jars without base 64 conversion. In the case of Vadims script I am able to only browse the directories and that includes the jar bundle but I am struggling to get the contents of the jar or the base 64 encoding. In the case of Ariel M blog though I am able to get the directory paths using GET command from postman. when I am actually trying to access those URLs in the internet explorer I get "403". Looks like I am missing something here.

Regards

Kalyan.

engswee
Active Contributor
0 Kudos

Hi Kalyan

The comments on my blog post might have been helpful for your case. With the switch to Apache Karaf and Java 8 on CPI, the way the JAR files are located have changed.

The following code will now provide the bundle number instead of the full path to the JAR file

URI classFilePath = clazz.protectionDomain.codeSource.location.toURI();

Output:

jar:bundle://425.0:0/!/

Check my comment in the blog post to see how you can further find the location of the JAR file for the bundle.

https://blogs.sap.com/2017/10/06/how-do-you-test-your-groovy-scripts/#comment-455114

Regards

Eng Swee