wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
856 stars 789 forks source link

Issue with setting up IS4 as third party key manger with WSO2 AM #11388

Open jsing217 opened 3 years ago

jsing217 commented 3 years ago

Description:

I have created a custom connector in java for IS4 and deployed it in WSO2 AM directory on my local and running it locally giving classnotfound exception, for WSO2 i am using 4.0 version also tried with 3.2 version but issue is same need to look where the implementation is wrong or how to fix this, can anyone suggest?

[2021-07-01 14:32:23,009] ERROR - KeyManagerConfigurationDataRetriever Error while configuring Key Manager IdentityServer4 in tenant carbon.super org.wso2.carbon.apimgt.api.APIManagementException: Error while loading keyManager configuration at org.wso2.carbon.apimgt.impl.factory.KeyManagerHolder.addKeyManagerConfiguration_aroundBody0(KeyManagerHolder.java:97) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at org.wso2.carbon.apimgt.impl.factory.KeyManagerHolder.addKeyManagerConfiguration(KeyManagerHolder.java:60) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at org.wso2.carbon.apimgt.impl.keymgt.KeyManagerConfigurationServiceImpl.addKeyManagerConfiguration_aroundBody0(KeyManagerConfigurationServiceImpl.java:34) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at org.wso2.carbon.apimgt.impl.keymgt.KeyManagerConfigurationServiceImpl.addKeyManagerConfiguration(KeyManagerConfigurationServiceImpl.java:28) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at org.wso2.carbon.apimgt.impl.loader.KeyManagerConfigurationDataRetriever.run_aroundBody0(KeyManagerConfigurationDataRetriever.java:71) [org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at org.wso2.carbon.apimgt.impl.loader.KeyManagerConfigurationDataRetriever.run(KeyManagerConfigurationDataRetriever.java:36) [org.wso2.carbon.apimgt.impl_6.7.206.jar:?] at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_281] at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_281] Caused by: java.lang.ClassNotFoundException: org.wso2.custom.client.IdentityServerClient cannot be found by org.wso2.carbon.apimgt.impl_6.7.206 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512) ~[org.eclipse.osgi_3.14.0.v20190517-1309.jar:?] at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423) ~[org.eclipse.osgi_3.14.0.v20190517-1309.jar:?] at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415) ~[org.eclipse.osgi_3.14.0.v20190517-1309.jar:?] at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155) ~[org.eclipse.osgi_3.14.0.v20190517-1309.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_281] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_281] at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_281] at org.wso2.carbon.apimgt.impl.factory.KeyManagerHolder.addKeyManagerConfiguration_aroundBody0(KeyManagerHolder.java:87) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?]

linhlehp commented 3 years ago

Hello, I had the same issue, I fixed this by fixing these lines in the pom.xml file of a custom connector (if you use a project sample like me, its path would be /custom.auth.client/custom.key.manager/pom.xml). <Export-Package> **org.wso2.custom.client.***;version="${project.version}" </Export-Package> The default value in the project sample was org.wso2.okta.client., since then when I launched a maven build, classes in org.wso2.custom.client. were not exported to a bundle jar.

Hope that's help.