-1

I am receiving this error:

net.snowflake.client.core.CredentialManager initSecureStorageManager

INFO: JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.

net.snowflake.client.core.CredentialManager fillCachedCredential

INFO: JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.

How do I add these files in my project?

This is my connection properties files:

hostname=jdbc:snowflake://ya189.ap-south-1.aws.snowflakecomputing.com/
user=
password=
account=ya189.ap-south-1
database=DEMO_DB
role=
warehouse=COMPUTE_WH
schema=PUBLIC
IS_ENCRYPTED=true
authenticator=externalbrowser  

I have included JNA in my pom.xml:

<dependency>
    <groupId>net.snowflake</groupId>
    <artifactId>snowflake-jdbc</artifactId>
    <version>3.13.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
<dependency>
    <groupId>net.java.dev.jna</groupId>
    <artifactId>jna</artifactId>
    <version>5.9.0</version>
</dependency>
<dependency>
    <groupId>net.java.dev.jna</groupId>
    <artifactId>jna-platform</artifactId>
    <version>5.9.0</version>
</dependency>
Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
  • The underlying problem is an older JNA version in your project from somewhere. Try moving the JNA dependencies to be *first* in the list of the dependencies. Are you using a parent POM? Check if it includes JNA. – Daniel Widdis Mar 03 '22 at 04:58

1 Answers1

0

Connection caching for browser-based SSO and token caching for multi-factor authentication (MFA) require the use of the Java Native Access (JNA) classes to save data securely to the filesystem.

As of version 3.12.18 of the JDBC Driver, the JNA classes are no longer packaged in the JDBC Driver JAR file. In the JDBC Driver pom.xml file, the dependencies on these classes are marked as optional.

If you need to use connection caching or token caching, you must add the following libraries to your classpath.

The pom.xml file for the JDBC Driver specifies the version of the JNA classes that have been tested with the JDBC Driver. We recommend using this version (or the same major version) of the JNA classes.

For more information read here

Sergiu
  • 4,039
  • 1
  • 13
  • 21
  • i have used snowflake-jdbc (3.13.14). i need to upgrade this version to 3.13.15 – Vishal rana Mar 02 '22 at 15:57
  • No, you need to download the JNA jar files and add them to your project. – Sergiu Mar 02 '22 at 16:00
  • i already put this dependency in pom.xml – Vishal rana Mar 02 '22 at 17:09
  • Did you also added the JNA jar files to your project? – Sergiu Mar 02 '22 at 17:19
  • yes i already add this dependency – Vishal rana Mar 02 '22 at 19:22
  • i resolve jna files issue. but i got new error failed to read target could not find it in window credential manager. how i reslove this error – Vishal rana Mar 06 '22 at 05:27
  • Post the exact error message otherwise it's hard to say where the issue comes from. – Sergiu Mar 07 '22 at 08:10
  • net.snowflake.client.core.SecureStorageWindowsManager getCredential INFO: Failed to read target or could not find it in Windows Credential Manager. Error code = 1168 SQLException Method : : getConnection : : exception caught1 : : !390400! Method : : getConnection : : exception caught2 : :[net.snowflake.client.core.SessionUtilExternalBrowser.getSSOUrl(SessionUtilExternalBrowser.java:196), net.snowflake.client.core.SessionUtilExternalBrowser.authenticate(SessionUtilExternalBrowser.java:221), net.snowflake.client.core.SessionUtil.newSession(SessionUtil.java:373) – Vishal rana Mar 07 '22 at 14:44
  • Is a browser opened with the SSO URL? As you did not set any user/pass in your config file the browser with the SSO URL should allow you to enter SSO user/pass. Is this happening? – Sergiu Mar 07 '22 at 15:07
  • No browser is not opening but I pass user and password in config file – Vishal rana Mar 07 '22 at 16:01
  • Maybe your browser is blocking popups? – Sergiu Mar 07 '22 at 16:02
  • i have try in python it works fine – Vishal rana Mar 07 '22 at 16:27