Issue with SMB API while connecting to remote share folder using Java - java

artifact : smbj
version : 0.3.0
Able to connect to the server but when it try to access the
DiskShare share = (DiskShare) session.connectShare(sambaSharedPath);
Below Exception is throwing. Please suggest fix.
com.hierynomus.mssmb2.SMBApiException: STATUS_BAD_NETWORK_PATH(3221225662/3221225662): Could not connect to \\SharePatch\
at com.hierynomus.smbj.session.Session.connectTree(Session.java:113)
at com.hierynomus.smbj.session.Session.connectShare(Session.java:98)
at com.smbj.test.CreateNASFile.upload(CreateNASFile.java:71)
at com.smbj.test.CreateNASFile.main(CreateNASFile.java:107)

Issue got resolved after passing shaereName and sharePath separately (We should not pass full combined path).

Related

The Tomcat installation directory is not valid. It is missing expected file or folder tcruntime-ctl.sh

Even after searching too much i couldn't find any suitable answer for my problem.
I am using Spring Tool Suite and trying to create a new server but getting error as The specified server is not valid. The .tc-runtime-instance file is missing.
So, I tried updating pivotal using Windows> Preferences and tried editing pivotal with new release but got the error as attached:
I tried changing tomcat version from 9 to 7 too but still no success. Please help.
It looks like you are trying to use the server adapter for the "Pivotal tc Server" to configure your server in the IDE. This server adapter is for the Pivotal tc Server only and doesn't work with a plain Tomcat installation on your disc. For that, you should select the "Apache Tomcat" server adapter when creating a server instance in your IDE.

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.

Impala driver class not being found through Jaydebeapi Connection

I recently switched over from using a PC to a Mac and now for whatever reason one of my Impala drivers that worked fine is no longer found when run in Python. I keep receiving this error every time I run the script : "java.lang.RuntimeException: Class com.cloudera.impala.jdbc41.Driver not found". Please see code snippet for my connection below.
c = jaydebeapi.connect
(jclassname='com.cloudera.impala.jdbc41.Driver',
url='jdbc:impala://cloudera-impala-proxy.live.bi.xxx/;AuthMech=3;ssl=1;',
driver_args=['xxx', self.dwh_password], jars='/Users/xxx/Desktop/ImpalaJDBC41 2.jar')
Any help or suggestions are appreciated, I feel like I'm going crazy trying to get this to work.
Did you check do you have the ImpalaJDBC***.jar in your new machine.
Please check properly weather it's available at classpath/build path or not.
Edit:
You can use hive jdbc jar as well to connect with impala , just use the port of impala rather hive in jdbc url.
Looking at this error means your jar is corrupt.
First check your impalaJDBC jar
java -jar ImpalaJDBC<version>.jar
If it gives you error that means your jar is corrupt.
Download the correct jar from cloudera

What is the Kerberos method?

I'm trying to connect to hive with jdbc. I keep getting this error. I tried looking it up but could not hind anything useful .
This is my connection string:
jdbc:hive2://hostname.xxx.com:10000/default;principal=hive/hostname.xxx.com#HADOOP_ENV.COM
What is this error: java.lang.NoSuchMethodError: org.apache.hadoop.security.authentication.util.KerberosUtil.hasKerberosTicket(Ljavax/security/auth/Subject;)Z
That method exists in Hadoop 2.8 but not in Hadoop 2.7 -- so my guess is that your project dependencies are not aligned with whatever version of Hadoop you have in Production.
Code in trunk
https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
code in branch-2.8.0
https://github.com/apache/hadoop/blob/branch-2.8.0/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
code in branch-2.7.4
https://github.com/apache/hadoop/blob/branch-2.7.4/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
Kerberos is an authentication protocol that is used by Hive server (https://en.wikipedia.org/wiki/Kerberos_(protocol))
The problem you are setting is more about a missing library in our pom.xml. Have you include <artifactId>hive-jdbc</artifactId> ?
I think your keberos ticket is not generated properly
Can you try running these two commands in order from the user you are trying to connect:
kdestroy (deleted any kerberos ticket generated before)
kinit (generates a new ticket)
Then try to connect again.

Worklight Server 6.2 JMS Adapter javax/jms/ExceptionListener

I'm trying to use a JMS Adapter in a Worklight 6.2 project based on this tutorial (WL + ActiveMQ):
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/04_05_JMS_adapter_-_Communicating_with_JMS.pdf.
When I deploy the adapter into the WL Server, it fails and the server returns the following error:
"Adapter deployment failed: RuntimeException:java.lang.NoClassDefFoundError: javax/jms/ExceptionListener"
So, I provide the following jars into the server/libs:
activemq-core-5.7.0.jar
javax.jms-1.1.jar
but unfortunately the result is the same.
Can you have any suggestion to resolve this problem?
Many thanks,
Stefano
You should have an activemq-all-activemq_version_number.jar file. Put this file in the server\lib directory and try again.

Categories