I'm getting java.lang.NoSuchMethodError while initializing ConcurrentUpdateSolrClient object - java

I'm getting java.lang.NoSuchMethodError while initializing ConcurrentUpdateSolrClient object by calling
ConcurrentUpdateSolrClient _server = new ConcurrentUpdateSolrClient(url, 10, 4);
Jar files which I'm using are
httpcore-4.4.1.jar
httpclient-4.4.1.jar
The following error logged in console
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.util.VersionInfo.getUserAgent(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/String;
at org.apache.http.impl.client.DefaultHttpClient.setDefaultHttpParams(DefaultHttpClient.java:184)
at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:159)
at org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:466)
at org.apache.solr.client.solrj.impl.HttpClientUtil.setFollowRedirects(HttpClientUtil.java:290)
at org.apache.solr.client.solrj.impl.HttpClientConfigurer.configure(HttpClientConfigurer.java:58)
at org.apache.solr.client.solrj.impl.HttpClientUtil.configureClient(HttpClientUtil.java:149)
at org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:125)
at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(HttpSolrClient.java:188)
at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(HttpSolrClient.java:165)
at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:127)
at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:119)
at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:109)
at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:102)
at com.etl.extract.ExtractData.<init>(ExtractData.java:34)
at com.etl.base.LaunchExtract.main(LaunchExtract.java:11)
Please let me know if anyone already faced this issue and resolved!
Thanks.

Related

fabric crashes in intelij

all i did is setup the project and the mod id and that stuff and first time running i get this erorr
Exception in thread "main" org.spongepowered.asm.launch.MixinInitialisationError: Error initialising mixin config modid.mixins.json
at org.spongepowered.asm.mixin.transformer.Config.create(Config.java:153)
at org.spongepowered.asm.mixin.Mixins.createConfiguration(Mixins.java:100)
at org.spongepowered.asm.mixin.Mixins.addConfiguration(Mixins.java:87)
at net.fabricmc.loader.launch.common.FabricMixinBootstrap.addConfiguration(FabricMixinBootstrap.java:44)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at net.fabricmc.loader.launch.common.FabricMixinBootstrap.init(FabricMixinBootstrap.java:83)
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:132)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28)
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
Caused by: java.lang.IllegalArgumentException: The specified resource 'modid.mixins.json' was invalid or could not be read
at org.spongepowered.asm.mixin.transformer.MixinConfig.create(MixinConfig.java:1090)
at org.spongepowered.asm.mixin.transformer.Config.create(Config.java:148)
... 8 more
Make sure to change modid.mixins.json in your fabric.mod.json

I m getting an error when run on tomcat (NoSuchMethodError)

When I have run my codes on tomcat , getting an error like this;
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.istack.logging.Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger;
at com.sun.xml.ws.api.config.management.policy.ManagementAssertion.<clinit>(ManagementAssertion.java:87)
at com.sun.xml.ws.server.MonitorBase.createManagedObjectManager(MonitorBase.java:177)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:196)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:174)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:81)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:602)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
at javax.xml.ws.Service.getPort(Service.java:92)
at tr.com.ttnet.xmlns.services.ınquirecustomerovitreqabcs.ınquirecustomerovitreqabcs.InquireCustomerOvitReqABCSEp.getInquireCustomerOvitReqABCSPt(InquireCustomerOvitReqABCSEp.java:58)
at com.kafein.test.main(test.java:23)

OPC client issue

I am getting the following error in the OPC client code.
I start my client- close it - start it again to see the following error.
It is clear that something from previous run is causing it. But I am unable to figure out what it is.
When I diff the jstack of my first run and close. I do not see any running thread from opc.
Has anyone seen this issue? Or
Is there some other way I can debug the issue?
2016-05-19 16:35:53,564 WARN [netty-event-loop-0] io.netty.channel.ChannelInitializer - Failed to initialize a channel. Closing: [id: 0xe25cac5b] java.lang.ExceptionInInitializerError
at com.digitalpetri.opcua.stack.client.UaTcpStackClient$1.initChannel(UaTcpStackClient.java:340)
at com.digitalpetri.opcua.stack.client.UaTcpStackClient$1.initChannel(UaTcpStackClient.java:337)
at io.netty.channel.ChannelInitializer.channelRegistered(ChannelInitializer.java:69)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRegistered(AbstractChannelHandlerContext.java:133)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRegistered(AbstractChannelHandlerContext.java:119)
at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:733)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:449)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:377)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:423)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: 'awaiting-handshake' is already in use
at io.netty.util.UniqueName.<init>(UniqueName.java:53)
at io.netty.util.AttributeKey.<init>(AttributeKey.java:47)
at io.netty.util.AttributeKey.valueOf(AttributeKey.java:39)
at com.digitalpetri.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.<clinit>(UaTcpClientAcknowledgeHandler.java:44)
... 13 more
Looks like you might have some kind of ClassLoader issue - a static final field of UaTcpAcknowledgeHandler is being defined twice somehow.
What exactly happens when you "close" your client?

Error reading file using JENA api

For the following code:
Model m2=ModelFactory.createDefaultModel();
m2.read("Untitled.xml");
I get the error: Exception in thread "main" com.hp.hpl.jena.shared.JenaException: java.net.MalformedURLException: no protocol: Untitled.xml
Could anyone please help me out?
it expect an url, try m2.read(new File("Untitled.xml").toURL().toString());

Google App add contact error?

In my GAE app there is the following line :
ContactsService myService=new ContactsService("app-name");
It compiled fine, but when run, it cause the following error :
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.Iterators.forArray([Ljava/lang/Object;)Lcom/google/common/collect/UnmodifiableIterator;
at com.google.common.collect.ImmutableSet$ArrayImmutableSet.iterator(ImmutableSet.java:415)
at com.google.common.collect.ImmutableSet$ArrayImmutableSet.iterator(ImmutableSet.java:392)
at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:317)
at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:601)
at com.google.gdata.wireformats.AltFormat.<init>(AltFormat.java:183)
at com.google.gdata.wireformats.AltFormat.<init>(AltFormat.java:42)
at com.google.gdata.wireformats.AltFormat$Builder.build(AltFormat.java:457)
at com.google.gdata.wireformats.AltFormat.<clinit>(AltFormat.java:49)
at com.google.gdata.client.Service.<clinit>(Service.java:558)
at Test.ContactsExample.<init>(ContactsExample.java:102)
I've included guava-r09.jar, so it has the "ImmutableSet", if I don't included guava-r09.jar, it will say :
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableSet
What should I do ?
I found out why : don't need to include google-collect-*.jar, source of error.

Categories