java.net.UnknownHostException while running RestAssured - java

I am Running Below Code & getting following exception
Exception in thread "main" java.net.UnknownHostException: maps.googleapis.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
I tried to check the same in CMD in order to check DNS issue . Can anyone suggest how we can resolve this "can't find maps.googleapis.com: Non-existent domain" issue.
I tried to check the DNS issue in using "nslookup maps.googleapis.com" CMD but I am getting the error "find https://maps.googleapis.com: Non-existent domain".
Code:
RestAssured.baseURI="https://maps.googleapis.com";
given().
param("location","-33.8670522,151.1957362").
param("radius","1500").
param("type","restaurant").
param("keyword","cruise").
param("key","AIzaSyA4HVDos-DFWuFJDmHNn8qlKBrRNSgAhtc").
when().
get("/maps/api/place/nearbysearch/json").
then().assertThat().
statusCode(250);
Expected- Should get response
Actual- Unable to run the code due to 'UnknownHostException'.

Related

Wanted to automated mobile application

I'm trying to run a program, but it's showing an error:
Exception in thread "main"
org.openqa.selenium.SessionNotCreatedException: Unable to create a new
remote session. Please check the server log for more details.
Original error: An unknown server-side error occurred while processing the
command. Original error: The application at
'C:\Users\Sodainmind\eclipse-workspace.metadata.metadata\Mobileautomation\carbonate_staging_1-75_23MAR2020.apk'
does not exist or is not accessible
how to solve ? i have change work place of that application too but its not working

Want to enter the hostname:9092 in BootStrap url(I have the hostname entry against the actual url in my host file windows) JAVA

Want to enter subham-virtualbox:9092 instead of 172.16.6.86:9092 as my bootstrapURL and schemaRegistryurl.
I have this entry in my host file to get resolved
172.16.6.86 subham-virtualbox
Tried doing this, got error,
Exception in thread "main" org.apache.kafka.common.errors.SerializationException: Error serializing Avro message
Caused by: java.net.MalformedURLException: unknown protocol: subham-virtualbox
at java.net.URL.<init>(URL.java:617)
at java.net.URL.<init>(URL.java:507)
at java.net.URL.<init>(URL.java:456)
at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:175)
at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:256)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:356)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:348)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:334)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:168)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:222)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:198)
at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:70)
at io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:53)
at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62)
at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:903)
at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:865)
at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:752)
at com.github.meSubhamSaraf.AvroSerializerDemo.main(AvroSerializerDemo.java:58)
The error is not saying UnknownHostException
schema.registry.url requires a protocol, and it's port is not 9092
http://subham-virtualbox:8081
Your bootstrap servers can be subham-virtualbox:9092
Personally, I would suggest using Docker with a simple port forward for the Registry, not a whole VM.
Otherwise, Vagrant works great and can edit the hosts file for you via a plugin

AWS Textract: Exception in thread "main" java.lang.NoSuchMethodError

I get this error while executing the AWS Tetxtract API .
Exception in thread "main" java.lang.NoSuchMethodError:
com.amazonaws.client.AwsSyncClientParams.getAdvancedConfig()Lcom/amazonaws/client/builder/AdvancedConfig;
at
com.amazonaws.services.textract.AmazonTextractClient.(AmazonTextractClient.java:149)
at
com.amazonaws.services.textract.AmazonTextractClient.(AmazonTextractClient.java:133)
at
com.amazonaws.services.textract.AmazonTextractClientBuilder.build(AmazonTextractClientBuilder.java:61)
at
com.amazonaws.services.textract.AmazonTextractClientBuilder.build(AmazonTextractClientBuilder.java:27)
at
com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
at
com.tr.fundamental.s3FileUploader.AnalyzeDocument.main(AnalyzeDocument.java:177)
I have downloaded the latest Textract jar and included in my build path .
I do not get any compilation error ,but when i run i get this error at this point
// Call AnalyzeDocument
EndpointConfiguration endpoint = new EndpointConfiguration("https://textract.us-east-1.amazonaws.com", "us-east-1");
AmazonTextract client = AmazonTextractClientBuilder.standard().withEndpointConfiguration(endpoint).build();
My credential and all are correct and able to connect to S3 as well.
I am not sure what i am missing .
Please help
A possible issue is that you are using difference artefact versions your aws libraries.
In case you are using Maven, have a look on:
https://stackoverflow.com/a/55330900/2353294
Ok let me answer my question .
So using Default client solved my issue .
EndpointConfiguration endpoint = new EndpointConfiguration("https://textract.us-east-1.amazonaws.com", "us-east-1");
AmazonTextract client = AmazonTextractClientBuilder.defaultClient();
This is happening due to version mismatch of aws sdk and textract. Keep same version, it would start working
I was also getting the same issue, I have degraded the version and the issue get resolved.
It happens due to version mismatch.

JNI error has occurred while adding to salesforce

When I launch my program with the following command:
java -classpath C:\SalesForce\wsc-master\force-wsc-38.0.3.jar com.sforce.ws.tools.wsdlc path=C:\SalesForce\wsc-master\partner\partner.wsdl .\partner.jar
I get this error message:
Error: A JNI error has occurred, please check your installation and
try again Exception in thread "main" java.lang.NoClassDefFoundError
Any ideas how to solve my problem?

Connect Android App to AWS dynamoDB

i am trying to connect my android app to AWS dynamoDB. I followed
http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/dynamodb_om.html
But when I try to run it I get:
09-15 16:12:12.290 24313-24313/com.example.jan.tracestest E/AndroidRuntime﹕ FATAL EXCEPTION: main
com.amazonaws.AmazonClientException: Unable to execute HTTP request: null
Caused by: java.io.IOException
at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:87)
at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:205)
at libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)
For the last two days i went over it again and again but I don't get it. Does anyone have some hints?
thx
this is the exception object giving me no hints...
thx to Raymond Lin
I did try to run it on the main thread. Now i do it with a Asynctask and it works.

Categories