Twilio | Wso2 : ERROR {NativeWorkerPool} - Uncaught exception java.lang.NoSuchMethodError - wso2

I'm using Twilio connector for Wso2 and I'm facing an issue (as shown below) while deploying the .car file on micro Integrator runtime, however when I run the connector on embedded server that comes with integration studio things work pretty fine. Any solution to that?
[2022-10-07 15:31:24,320] ERROR {NativeWorkerPool} - Uncaught exception java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultRedirectStrategy.<init>([Ljava/lang/String;)V
at com.twilio.http.HttpClient.<init>(HttpClient.java:35)
at com.twilio.http.NetworkHttpClient.<init>(NetworkHttpClient.java:54)
at com.twilio.http.NetworkHttpClient.<init>(NetworkHttpClient.java:45)
at com.twilio.http.NetworkHttpClient.<init>(NetworkHttpClient.java:36)
at com.twilio.http.TwilioRestClient$Builder.build(TwilioRestClient.java:143)
at com.twilio.Twilio.buildRestClient(Twilio.java:202)
at com.twilio.Twilio.getRestClient(Twilio.java:174)
at com.twilio.base.Creator.create(Creator.java:40)
at org.wso2.carbon.connector.twilio.sms.SendSms.connect(SendSms.java:67)
at org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConnector.java:32)
at org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:94)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:134)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:169)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:92)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.rest.Resource.process(Resource.java:331)
at org.apache.synapse.rest.API.process(API.java:448)
at org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:120)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:98)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:71)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:331)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:99)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:426)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:181)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
I have checked and it seems that the error is due to the incompatible org.apache.httpcomponents.httpclient runtime version.
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
I'm not sure where to add this dependency in Wso2.

It's not recommended to add external Jars to the runtime, in this case, this could conflict with existing dependencies. Having said that, as per the Connector Store latest Twillio connector is not compatible with MI 1.2.0. Hence best option is to try upgrading to a newer version of MI(4.X). Should work in any 4.0+ versions.
Else you can try using the older version of the connector. (version 1.0.0)

Are you using the GA pack? Can you try updating the MI to the latest u2 level and check. We have done a Httpclient component upgrade in all the latest MI versions

Related

Starting wso2 3.0.0 gateway windows "Could not load Logmanager"

So i am trying to load the WSO2 gateway from my local machine running the new 3.0.0-m6 version downloaded from their website.
I have run everything as described in the quickstart guide, and i get the following error on start up.
Could not load Logmanager "org.ballerinalang.launcher.BLogManager"
java.lang.ClassNotFoundException: org.ballerinalang.launcher.BLogManager
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.util.logging.LogManager$1.run(LogManager.java:195)
at java.util.logging.LogManager$1.run(LogManager.java:181)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:181)
at java.util.logging.Logger.demandLogger(Logger.java:448)
at java.util.logging.Logger.getLogger(Logger.java:502)
at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:846)
at sun.management.Agent.startLocalManagementAgent(Agent.java:138)
at sun.management.Agent.startAgent(Agent.java:260)
at sun.management.Agent.startAgent(Agent.java:447)
ballerina: unknown command 'start'
Run 'ballerina help' for usage.
ActiveMQ is running
WSO2 Server is running
WSO2 Identity manager is running
WSO2 API Manager is running
I am starting the gateway from the root folder as explained in the start up guide.
Are you running this in Windows? The version 3.0.0-m6 is based on Ballerina v0.89 and in this version of Ballerina, there's a bug in the bin/ballerina.batfile. As you can see, it's looking for a class named org.ballerinalang.launcher.BLogManager and fails. This class was moved to another package and now, its fully qualified name is org.ballerinalang.logging.BLogManager. In the ballerina.bat script, change the property (towards the end of the file) -Djava.util.logging.manager="org.ballerinalang.launcher.BLogManager" to -Djava.util.logging.manager="org.ballerinalang.logging.BLogManager" and it should solve your problem.

Jar Dependencies and jar clashes using AWS SDK 1.11.105

We are facing some problem regarding jar dependencies and jar clashes while working with AWS java SDK 1.10.105.
We are seeing that in the AWS SDK httpClient 4.5.2 version is used, while we are using 4.5.0 version in our project. It is also coming for httpcore 4.4.4 jar also. What will be the solution? We are not even sure that whether we are facing this error for the jar clashes, we think AWS SDK is independent of all external jars. Please help.
The error we are facing:
java.lang.ClassNotFoundException: org.apache.http.impl.client.HttpClients
After using same jar version of AWS SDK, now we are facing this error.We are using jodaTime 2.8.1(Same of SDK)
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.auth.internal.AWS4SignerUtils
java.lang.NoSuchMethodError: org.joda.time.format.DateTimeFormatter.withZoneUTC()Lorg/joda/time/format/DateTimeFormatter;
Please check the dependencies:
-
com.fasterxml.jackson
jackson-modified
2.5.4
-
org.apache.commons
commons-csv
1.1
-
commons-logging
commons-logging
1.1.1
-
com.googlecode.json-simple
json-simple
1.1.1
-
log4j
log4j
1.2.16
compile
-
com.fasterxml.jackson.core
jackson-databind
2.6.6
-
com.fasterxml.jackson.core
jackson-databind
2.6.6

wso2 is 5.1.0 missing classes when running as a service (org.apache.jsp.user.edit_002duser_002droles_jsp)

Upgrading from WSO2 IS 5.0.0 SP1 to WSO2 IS 5.1.1 patch 92 (Windows Server 2008, JRE 1.7), running as a Windows service (installed using the yajsw.conf).
Adding a role to the user fails (with a blank page), in the wso2carbon.log we have an exception:
Caused by: java.lang.ClassNotFoundException:
org.apache.jsp.user.edit_002duser_002droles_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Caused by: java.io.IOException: JSPException while including path '/user/edit-user-roles.jsp'. ServletException while including page.
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:91)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
Interesting on it is, that running the WSO2 IS 5.1.0 from the console works (wso2server.bat) without any issues. I searched for the edit-user-roles.jsp file and I found it in the library org.wso2.carbon.user.mgt.ui_5.0.7.jar (repository/components/plugins and repository/components/patches/patch0000). So - looks like the library is not loaded properly.
I was comparing the JVM settings between the IS started as a service and from CLI. The only discrepancy I found is in the -Dcomponents.repo parameter:
wso2server.bat: -Dcomponents.repo=%CARBON_HOME%\repository\components
wrapper.conf: -Dcomponents.repo=%CARBON_HOME%\repository\components\dropins
However
in the WSO2 IS 5.0.0S.P1 it looks the same (there are different values in the wso2server.bat and wrapper.conf) and there's no problem to add a role to the user account
I've changed the wrapper.conf to have the same value (=%CARBON_HOME%\repository\components) with no effect
Following updates to the wrapper.conf solved the problem:
wrapper.java.additional.18 = -Dcomponents.repo=${carbon_home}\\repository\\components
wrapper.java.additional.26 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

Failed to configure Identity Server 5.0.0 as API Key Manager

I followed document to configure Identity Server 5.0.0 as API(1.80) Key Manager - https://docs.wso2.com/display/CLUSTER420/Configuring+WSO2+Identity+Server+as+the+Key+Manager, and log displayed exceptions when startup after installed API Key Manager feature in Identity server. The exceptions are as following:
ERROR {org.wso2.carbon.registry.indexing.RegistryConfigLoader} - org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer is not found in classpath. Please check whether the class is exported in your OSGI bundle. {org.wso2.carbon.registry.indexing.RegistryConfigLoader}
java.lang.ClassNotFoundException: org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.wso2.carbon.registry.indexing.RegistryConfigLoader.<init>(RegistryConfigLoader.java:132)
...
ERROR {org.wso2.carbon.registry.indexing.solr.SolrClient} - Could not instantiate Solr client {org.wso2.carbon.registry.indexing.solr.SolrClient}
java.lang.RuntimeException: java.io.FileNotFoundException: D:\wso2\wso2is-5.0.0\solr\data\index\_7.fnm (The system cannot find the file specified)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:579)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at org.wso2.carbon.registry.indexing.solr.SolrClient.<init>(SolrClient.java:90)
...
Can anyone help? I would be very gratefull.
I believe I have found the issue. When installing the Key Manager feature in this article and installing the WSO2 Identity Manager Service pack after the Key Manager, there are two files in the /repository/components/plugins directory:
org.wso2.carbon.registry.indexing_4.2.1.jar
org.wso2.carbon.registry.indexing_4.2.2.jar
I resolved this issue by removing the 4.2.1 jar version and leaving the 4.2.2 jar version. After doing so, no errors were encountered.

Issues after Elasticsearch 1.3.2 upgrade

After upgrade to ES 1.3.2 I'm facing the following issues:
1) On startup got error:
[2014-08-26 11:10:20,285][ERROR][bootstrap ] {1.3.2}: Initialization Failed ...
1) NoSuchMethodError[org.elasticsearch.discovery.zen.ZenDiscovery.(Lorg/elasticsearch/common/settings/Settings;Lorg/elasticsearch/cluster/ClusterName;Lorg/elasticsearch/threadpool/ThreadPool;Lorg/elasticsearch/transport/TransportService;Lorg/elasticsearch/cluster/ClusterService;Lorg/elasticsearch/node/settings/NodeSettingsService;Lorg/elasticsearch/cluster/node/DiscoveryNodeService;Lorg/elasticsearch/discovery/zen/ping/ZenPingService;Lorg/elasticsearch/Version;)V]2) IllegalStateException[This is a proxy used to support circular references involving constructors. The object we're proxying is not constructed yet. Please wait until after injection has completed to use this object.]
2) when I attempt to upgrade the cloud-aws plugin to version 2.3.0 (compatible with ES 1.3) I get:
`Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/plugins/PluginManager : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.elasticsearch.plugins.PluginManager. Program will exit.`
Java version is:
java version "1.7.0_45"
OpenJDK Runtime Environment (amzn-2.4.3.2.32.amzn1-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Same issue faced with ES versions 1.3.1 and 1.3.0
Surprisingly ES v1.3.2 works fine on java version "1.7.0_25"
The issue is resolved. The issue comes when compilation happens with a different java version and at runtime a different version of java is found. When we looked at the Java -version, it was pointing at 1.7 where as java_home was pointing to 1.6. We also checked command "java which" which was pointing to 1.7. When we checked the script of elastic search, it gives precedence to "JAVA_HOME" and then looks for "java which". Installed JDK 1.7(earlier only JRE 1.7) was installed, uninstalled 1.6 using command
yum install java-1.7.0-openjdk
yum remove install openjdk-6-jre
yum remove java-1.6.0-openjdk
and the issue is resolved..!! :)