Hi,
I am trying to connect to a secured url. I have added all the required certificates to the java trust store and keystore. I am using javax.net.ssl.HttpsURLConnection to connect to the url. I am successfully able to do so on my local machine. However on other serverw like staging, prod etc, I am facing issues because weblogic is managing those servers. So, I get a class cast exception -
weblogic.net.http.SOAPHttpsURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection.
One solution would be to make changes to weblogic env settings and add JAVA_OPTIONS="-DUseSunHttpHandler=true” to the startManagedWebLogic.sh file.I do not want to make changes to any env settings.
Second option is to change my code and use -
java.net.URL url;
javax.net.ssl.HttpsURLConnection httpsConn = null;
try {
url = new URL(null, ENDPOINT,new sun.net.www.protocol.https.Handler());'
}
When I try to so, my bundle is not able to resolve this pcakage and giving error - sun.net.www.protocol.https -- Cannot be resolved
in felix console - system/console/bundles.
Any solution would be appreciated to resolve this issues in bundle.
Regards,
Shallu Rohilla
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
go to http://localhost:4502/system/console/packages; here you can enter any Java package name and it will print the maven coordinates of the bundle, which contains this package.
kind regards,
Jörg
Views
Replies
Total Likes
Hi Shallu Rohilla,
You will have to add the bundle which has the sun.net.www.protocol.https service for AEM felix to resolve it or you can include that jar in your bundle and then deploy it so that it can resolve the same.
Views
Replies
Total Likes
Hi,
This is a sun jar - jsse.jar and I am not able to find a way to include this in my bundle via pom entry since I am unable to find the groupId and artifact id for this jar.
Regards,
Shallu Rohilla
Views
Replies
Total Likes
Hi,
go to http://localhost:4502/system/console/packages; here you can enter any Java package name and it will print the maven coordinates of the bundle, which contains this package.
kind regards,
Jörg
Views
Replies
Total Likes
Hi,
I tried this earlier but it gives no information:
Package | Version | Exported by | Maven Dependency |
---|---|---|---|
sun.net.www.protocol.https | - | No exporting bundle(s) found | No maven information available |
Regards,
Shallu
Views
Replies
Total Likes
Shallu Rohilla wrote...
Hi,
I tried this earlier but it gives no information:
Package
Version
Exported by
Maven Dependency
sun.net.www.protocol.https
-
No exporting bundle(s) found
No maven information available
Regards,
Shallu
Hi Shallu,
Can't you host the jar within the local repository. Download a copy of the jar and add it to local repository if there is one. Also, not too sure but all the sun related entries go under sling.properties file. You can find some examples of how soap services are integrated with AEM.
Views
Replies
Total Likes
Hi,
Why don't you use the Apache HTTPClient or the client builtin into AEM? Then you don't need to deal directly with these implementations, but rely on the offical APIs.
kind regards,
Jörg
Views
Replies
Total Likes
Hi Shallu,
If its a SOAP services, then you will have to create the stubs within your bundle and package it along with it.
Views
Replies
Total Likes