Getting this error while trying to connect facebook chat using smack.
jars used smack 3.3.1.jar,smackx 3.3.1.jar
Exception in thread "main" java.lang.AbstractMethodError: org.jivesoftware.smackx.ServiceDiscoveryManager$1.connectionCreated(Lorg/jivesoftware/smack/Connection;)V
at org.jivesoftware.smack.XMPPConnection.initConnection(XMPPConnection.java:652)
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:604)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1022)
at com.FacebookChatSample.main(FacebookChatSample.java:30)
I've had the same problem. Turned out that I didn't put the right package in my pom.xml
I used the following Maven dependency :
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smack</artifactId>
<version>3.1.0</version>
</dependency>
and it gave me the error when I tried to connect to my server. When I changed it to :
<dependency>
<groupId>org.igniterealtime.smack</groupId>
<artifactId>smackx</artifactId>
<version>3.2.1</version>
</dependency>
it worked.
Note : smack dependency was another entry from the beggining and should be left this way:
<dependency>
<groupId>org.igniterealtime.smack</groupId>
<artifactId>smack</artifactId>
<version>3.2.1</version>
</dependency>
Note 2 : I didn't explixitly use anything from smackx, it is used in XMPPConnection.initConnection() there where it tries to inform all the ConnectionCreationListener listeners that a connection has just been established.
Related
I have a simple app that uses Netflix Zuul as an API gateway
I added the Zuul dependency in the pom.xml file as follows:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.10.RELEASE</version>
</dependency>
and #EnableZuulProxy for the main class of the app
The problem is that whenever I try to run the API, It fails to start and shows in the console:
Consider defining a bean of type
'org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction'
in your configuration.
I couldn't solve the issue, what's the problem?
The issue was solved when I added the following dependency in pom.xml:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
and as a result, spring also asked me to add this to my app configuration:
spring.main.web-application-type=reactive
Then my API ran successfully without failing or throwing any exception
I tried to list the ECS clusters using the code as follow:
AmazonECS = amazonECS AmazonECSClientBuilder.standard().withRegion(region).withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build():
amazonECS.listClusters();
However, it gave the error
java.lang.NoSuchFieldError: CLIENT_ENDPOINT
The error stack is something like this:
com.amazonaws.services.ecs.AmazonECSClient in executeListClusters at
line 2220 com.amazonaws.services.ecs.AmazonECSClient in listClusters
at line 2202 com.amazonaws.services.ecs.AmazonECSClient in
listClusters at line 2245
I am not too sure why this error occurred as the other Amazon services did not give me any similar error whatsoever and I have set the region previously based on the client's preference. Any ideas?
Thanks to Nagaraj Trantri the error is caused by the version mismatched of the AWS SDK that I have according to https://github.com/aws/aws-sdk-java/issues/2509#issuecomment-779370672
I had different version for SQS and S3 in pom.xml. After I updated those to same versions, it worked.
It depends on where to look for these versions mismatch.
I am using spark to connect to secrets manager and thus we have 2 places to look at.
My Application dependencies (build.gradle)
spark.yarn.jars
The versions in the above 2 places should match and then it started working
Use this in the pom.xml file. Error is caused due to mismatch in the 'com.amazonaws' dependency versions declared in the pom.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.739</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sts</artifactId>
</dependency>
</dependencies>
I made a program that parses turtle files with Jena library. These are the dependencies i use:
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-iri</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-core</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-tdb</artifactId>
<version>3.10.0</version>
</dependency>
So the parsing is working well on my java program but when i create my jar and try to run it, i have these kind of errors :
ERROR JenaService:146 - org.apache.jena.n3.turtle.TurtleParseException: Line 28015, column 79: org.apache.jena.iri.impl.IRIImplException:
<http://www.reussir.fr,> Code: 28/NOT_DNS_NAME in HOST: The host component did not meet the restrictions on DNS names.
Any ideas ?
EDIT
I have a warning for the invalid IRI problem by running my program with the IDE, but still giving me errors with the generated jar.
<http://www.reussir.fr,>
There is a comma in the URI in a place where commas are not allowed.
It is better to find and fix the data problem because it can lead to other problems later if not fixed.
I found the problem, the only dependency i really needed was jena-arq, so i removed others dependencies (especially jena-iri which was throwing the TurtleParseException) and the bad-iri errors became warnings like in the IDE execution logs.
I am getting the below error when I am trying to create amazon S3 client. It worked earlier and after I have done few code changed from then on I am seeing this error. I feel it could be of some dependency conflict but unable to find it out. Try many things but nothing could help.
java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:91)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:51)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:39)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:301)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:164)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:523)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:503)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:485)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:457)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:439)
at com.ge.hc.cloud.e2e.workflows.steps.BasicWorkflowSteps.<clinit>(BasicWorkflowSteps.java:72)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:386)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at net.thucydides.core.steps.StepFactory.webEnabledStepLibrary(StepFactory.java:201)
at net.thucydides.core.steps.StepFactory.createProxyStepLibrary(StepFactory.java:164)
at net.thucydides.core.steps.StepFactory.instantiateNewStepLibraryFor(StepFactory.java:117)
at net.thucydides.core.steps.StepFactory.instantiateNewStepLibraryFor(StepFactory.java:109)
at net.thucydides.core.steps.StepFactory.getNewStepLibraryFor(StepFactory.java:77)
at net.thucydides.core.steps.StepFactory.getStepLibraryFor(StepFactory.java:72)
at net.thucydides.core.steps.StepAnnotations.instantiateAnyUnitiaializedSteps(StepAnnotations.java:52)
at net.thucydides.core.steps.StepAnnotations.instanciateScenarioStepFields(StepAnnotations.java:41)
at net.thucydides.core.steps.StepAnnotations.injectScenarioStepsInto(StepAnnotations.java:23)
at net.serenitybdd.jbehave.SerenityStepFactory.createInstanceOfType(SerenityStepFactory.java:80)
at org.jbehave.core.steps.StepCreator.stepsInstance(StepCreator.java:83)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:595)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:566)
Appreciate any kind of help.
I faced the similar issue. I was using AWS JavaV2 SDK software.amazon.awssdk with version 2.19.14.
The Amazon Java SDK jar that I had imported had a dependency on org.apache.httpcomponents. Once I imported the dependency and built the project again, I was able to create the client.
My pom.xml looked something like this.
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ssm</artifactId>
</dependency>
</dependencies>
I have written a simple Java bluetooth server copied from the example here digital hacks blog... Simple spp server...
I have included the following in my executable jar
<dependency>
<groupId>net.sf.bluecove</groupId>
<artifactId>bluecove</artifactId>
<version>2.1.0</version>
</dependency>
<!-- bluecove-gpl required to run bluecove on Linux-->
<dependency>
<groupId>net.sf.bluecove</groupId>
<artifactId>bluecove-gpl</artifactId>
<version>2.1.0</version>
</dependency>
<!-- http://mvnrepository.com/artifact/net.sf.bluecove/bluecove-emu -->
<dependency>
<groupId>net.sf.bluecove</groupId>
<artifactId>bluecove-emu</artifactId>
<version>2.1.0</version>
</dependency>
I have installed the following library on my pi
apt-get install libbluetooth-dev
When i run my app as follows, i get missing library error
pi#raspberrypi:~/workspace/bluetooth-server $ java -jar /tmp/btoothserver-1.0-SNAPSHOT-jar-with- dependencies.jar
Native Library bluecove_arm not available
Exception in thread "main" javax.bluetooth.BluetoothStateException: BlueCove L ibrary bluecove not available
at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries( ...
... javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at com.myapp.bluetoothserver.App.main(App.java:60)
Any help much appreciated