Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java error in opening the DNA file #247

Closed
r4work opened this issue Jul 30, 2022 · 5 comments
Closed

Java error in opening the DNA file #247

r4work opened this issue Jul 30, 2022 · 5 comments

Comments

@r4work
Copy link

r4work commented Jul 30, 2022

Hi
I am using Mac OS. rDNA worked fine until yesterday. Now, it is throwing this error message as soon as I try executing command
dna_gui(dna_sample())

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: dna/Dna has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I also updated Java on my Mac. Please suggest solution.

@leifeld
Copy link
Owner

leifeld commented Jul 30, 2022

It sounds like you were using the 2.0 version of rDNA with the 2.0 version of the jar file (which is fine), but then somehow the 3.0 version of the jar file sneaked into either the installation directory or working directory of rDNA. This can happen if you use dna_sample or dna_init with the force argument or if you use dna_download. You need to delete the 3.0 version of the jar file. See here for instructions. I will create a better 3.0 version of rDNA in the next month.

@r4work
Copy link
Author

r4work commented Jul 30, 2022

It sounds like you were using the 2.0 version of rDNA with the 2.0 version of the jar file (which is fine), but then somehow the 3.0 version of the jar file sneaked into either the installation directory or working directory of rDNA. This can happen if you use dna_sample or dna_init with the force argument or if you use dna_download. You need to delete the 3.0 version of the jar file. See here for instructions. I will create a better 3.0 version of rDNA in the next month.

Thank you Prof Leifeld.
I removed the DNA-3.0 file from the installation directory and supplied the DNA 2.0 file to my working directory.
Then the dna_gui(infile="filename.dna")) worked and I could navigate my coded file.
Unfortunately, it now throws the following error when I type
dna_connection(infile="filename.dna")

java.io.FileNotFoundException: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rDNA/extdata/dna-3.0.8.jar (No such file or directory)
java.io.FileNotFoundException: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rDNA/extdata/dna-3.0.8.jar (No such file or directory)
java.io.FileNotFoundException: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rDNA/extdata/dna-3.0.8.jar (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:226)
at java.util.zip.ZipFile.(ZipFile.java:155)
at java.util.jar.JarFile.(JarFile.java:170)
at java.util.jar.JarFile.(JarFile.java:107)
at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:168)
at sun.net.www.protocol.jar.JarFileFactory.getOrCreate(JarFileFactory.java:91)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:129)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:172)
at org.sqlite.SQLiteJDBCLoader.getResourceAsStream(SQLiteJDBCLoader.java:280)
at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:208)
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:366)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68)
at org.sqlite.core.NativeDB.load(NativeDB.java:63)
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:240)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:61)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:28)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:21)
at org.sqlite.JDBC.createConnection(JDBC.java:115)
at org.sqlite.JDBC.connect(JDBC.java:90)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at dna.SqlConnection.(SqlConnection.java:55)
at dna.export.ExporterR.(ExporterR.java:84)
java.sql.SQLException: Error opening connection
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:244)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:61)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:28)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:21)
at org.sqlite.JDBC.createConnection(JDBC.java:115)
at org.sqlite.JDBC.connect(JDBC.java:90)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at dna.SqlConnection.(SqlConnection.java:55)
at dna.export.ExporterR.(ExporterR.java:84)
Caused by: java.lang.NullPointerException
at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:216)
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:366)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68)
at org.sqlite.core.NativeDB.load(NativeDB.java:63)
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:240)
... 9 more
Error in dna_connection(infile = "filename.dna") :
java.lang.NullPointerException

Looking forward to your expert suggestion.

@leifeld
Copy link
Owner

leifeld commented Jul 30, 2022

Close DNA and R. Then make sure the DNA 2.0 jar file is in the inst directory of the rDNA installation path and no other jar file is there. Then make sure there is no jar file in the working directory. Then start R and verify using packageVersion("rDNA") that you have the rDNA 2 (not 3) installed. Try loading the package, initializing the jar file, and connecting to a version 2 database. Does this work? If not, which step fails?

@r4work
Copy link
Author

r4work commented Jul 31, 2022

It worked!

Thank you very much Prof. Leifeld.

@leifeld
Copy link
Owner

leifeld commented Jul 31, 2022

Great! All the best for your analysis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants