on 07-01-2019 7:27 PM
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.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.