bioinfo-biols / CIRI-cookbook

Document for CIRI-series software
https://ciri-cookbook.readthedocs.io/en/latest/index.html
4 stars 1 forks source link

java error when running CIRI_VIS #9

Closed iichelhadi closed 2 years ago

iichelhadi commented 3 years ago

Hi guys, I am encountering a new error when running CIRI_vis Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/batik/svggen/SVGGraphics2D at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:416) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) Caused by: java.lang.ClassNotFoundException: org.apache.batik.svggen.SVGGraphics2D at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 3 more

Running on centos. Hope I can get some help. I am not familiar with JAVA at all.

regards

Kevinzjy commented 3 years ago

What's your command line?

iichelhadi commented 3 years ago

What's your command line?

'while read line do mkdir CIRI_vis/ java -jar ../CIRI_full/CIRI-vis.jar \ -i CIRI_full_out/${line}/CIRI-full_output/${line}_merge_circRNA_detail.anno \ -l CIRI_full_out/${line}/CIRI-AS_output/${line}_library_length.list\ -r /hpctmp/phaei/Indices/hisat_index/hisat_index_hg19/hg19.fa \ -d CIRI_vis/ \ -o CIRI_vis/${line}

done <<< "$samples' `

Kevinzjy commented 3 years ago

If you want to split a shell command over multiple lines, please add \ to the ending of each line.

Please try running CIRI-vis with the following command:

java -jar ../CIRI_full/CIRI-vis.jar \
  -i CIRI_full_out/${line}/CIRI-full_output/${line}_merge_circRNA_detail.anno \
  -l CIRI_full_out/${line}/CIRI-AS_output/${line}_library_length.list \
  -r /hpctmp/phaei/Indices/hisat_index/hisat_index_hg19/hg19.fa \
  -d CIRI_vis/ \
  -o CIRI_vis/${line}
iichelhadi commented 3 years ago

If you want to split a shell command over multiple lines, please add \ to the ending of each line.

Please try running CIRI-vis with the following command:

java -jar ../CIRI_full/CIRI-vis.jar \
  -i CIRI_full_out/${line}/CIRI-full_output/${line}_merge_circRNA_detail.anno \
  -l CIRI_full_out/${line}/CIRI-AS_output/${line}_library_length.list \
  -r /hpctmp/phaei/Indices/hisat_index/hisat_index_hg19/hg19.fa \
  -d CIRI_vis/ \
  -o CIRI_vis/${line}

Nice catch. Missed that obvious mistake. Thanks. hopefully it will work this time

iichelhadi commented 3 years ago

If you want to split a shell command over multiple lines, please add \ to the ending of each line.

Please try running CIRI-vis with the following command:

java -jar ../CIRI_full/CIRI-vis.jar \
  -i CIRI_full_out/${line}/CIRI-full_output/${line}_merge_circRNA_detail.anno \
  -l CIRI_full_out/${line}/CIRI-AS_output/${line}_library_length.list \
  -r /hpctmp/phaei/Indices/hisat_index/hisat_index_hg19/hg19.fa \
  -d CIRI_vis/ \
  -o CIRI_vis/${line}

unfortunately I get the same error Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/batik/svggen/SVGGraphics2D at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:416) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) Caused by: java.lang.ClassNotFoundException: org.apache.batik.svggen.SVGGraphics2D at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 3 more my code is the following


while read line
do
        mkdir CIRI_vis/
        java -jar CIRI_full_jav/CIRI-vis.jar \
                -i CIRI_full_out/${line}/CIRI-full_output/${line}_merge_circRNA_detail.anno \
                -l CIRI_full_out/${line}/CIRI-AS_output/${line}_library_length.list \
                -r /hpctmp/phaei/Indices/hisat_index/hisat_index_hg19/hg19.fa \
                -d CIRI_vis/ \
                -o CIRI_vis/${line}

done <<< "$samples"
Kevinzjy commented 3 years ago

Well, CIRI-vis doesn't have a -o option, so remove this line -o CIRI_vis/${line} should do the job.

iichelhadi commented 3 years ago

Well, CIRI-vis doesn't have a -o option, so remove this line -o CIRI_vis/${line} should do the job.

Thanks, I tried. Still the same error. According to the documentation -o is an optional argument:

Usage: java -jar CIRI-vis.jar [Options]
Options:
  -i        The path of input file of CIRI-vis. (required)
  -l        The path of library length file. (required for isoform quantification)
  -r        The path of reference genome sequence in FASTA format. (required for output circRNA sequence)
  -list     The list of choosen circRNA BSJ.(It is needed when more than one sample)
  -d        The dictionary of output. Default currentdir/stdir
  -o        The prefix of output. Default stout (optional)
  -type     The format of figure. you can select pdf or svg or both. Default pdf (optional)
  -max      The maximum expression (BSJ reads number) of circRNA that displayed by CIRI-vis. Default 999999999 (optional)
  -min      The minimum expression (BSJ reads number) of circRNA that displayed by CIRI-vis. Default 5. Note: please only use one of -min, -exp, -rank (optional)
  -rank     Only display the expression top X% of circRNA (optional)
  -exp      Only display the top expression circRNA that contain X% of BSJ reads. (optional)
  -iso      The maximum number of considering isoform, default 10. High value will make the quantification slower (optional)
  -ran      Set random seed, default 0.(optional)
iichelhadi commented 3 years ago

Well, CIRI-vis doesn't have a -o option, so remove this line -o CIRI_vis/${line} should do the job.

also if I run just java -jar CIRI-vis.jar with no arguments, I get the same error instead of the help documentation. Could it be that the issue is the jar-file itself? I don't have that issue when running CIRI-full.jar.

Kevinzjy commented 3 years ago

This java error means you're using the wrong options.

I've checked the manual and found -o option means the prefix of your output file, so you need to use -o ${line} instead of -o CIRI_vis/${line}.

iichelhadi commented 3 years ago

This java error means you're using the wrong options.

I've checked the manual and found -o option means the prefix of your output file, so you need to use -o ${line} instead of -o CIRI_vis/${line}.

True, I tried running it as you mentioned and also without that option since it is optional but same issue. I still believe the issue is in the jar itself as I mentioned, running with no options to get the help documentation give the same error. Could the jar be corrupted?

Kevinzjy commented 3 years ago

I've tried running the latest version of CIRI-vis from SourceForge and everything works fine. So I still believe there's something wrong with your command-line options.

Could you try running CIRI-vis with the test dataset (from CIRI-full)?

iichelhadi commented 3 years ago

I've tried running the latest version of CIRI-vis from SourceForge and everything works fine. So I still believe there's something wrong with your command-line options.

Could you try running CIRI-vis with the test dataset (from CIRI-full)?

thanks for the quick reply. Unfortunately the test data isn't working either for CIRI-full. It seems to get stuck at the RO2 stage:

classpath = full/CIRI_full_jav//
working dir is set to /hpctmp/phaei/GSE126442/out
output prefix: test
100000 pair reads complete, time: 3s 2856 RO reads candidates were found
RO1 end.Take time: 3s
Start running bwa mem for RO candidate reads
Loading sam file
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NullPointerException
    at RO2.getro2(RO2.java:60)
    at CIRI_Full2.main(CIRI_Full2.java:272)
    ... 5 more
Kevinzjy commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

iichelhadi commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

Running on HPC using java 1.8

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
iichelhadi commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

Kevinzjy commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

Glad to hear that!

bio-visualisation commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

iichelhadi commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

Can you post your code?

bio-visualisation commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

Can you post your code?

$ java -jar ../CIRI-vis.jar -i circ_output/prefix_merge_circRNA_detail.anno -l circ_output/prefix_library_length.list -r hg38.fa -d CIRI-vis/ -min 1

iichelhadi commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

Can you post your code?

$ java -jar ../CIRI-vis.jar -i circ_output/prefix_merge_circRNA_detail.anno -l circ_output/prefix_library_length.list -r hg38.fa -d CIRI-vis/ -min 1

Can you show the java version you are using? What is the output of this command: java -version

bio-visualisation commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

Can you post your code?

$ java -jar ../CIRI-vis.jar -i circ_output/prefix_merge_circRNA_detail.anno -l circ_output/prefix_library_length.list -r hg38.fa -d CIRI-vis/ -min 1

Can you show the java version you are using? What is the output of this command: java -version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

bio-visualisation commented 3 years ago

I have raised an issue here. @iichelhadi https://github.com/bioinfo-biols/CIRI-cookbook/issues/10

iichelhadi commented 3 years ago

Weird, I can not replicate this error here. Are you sure that you are running CIRI-full and CIRI-vis under java 1.8?

i managed to get it working now. Thanks for the support!

How did you fix the problem? I am having the same issue.

Can you post your code?

$ java -jar ../CIRI-vis.jar -i circ_output/prefix_merge_circRNA_detail.anno -l circ_output/prefix_library_length.list -r hg38.fa -d CIRI-vis/ -min 1

Can you show the java version you are using? What is the output of this command: java -version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

That's the issue. you are not running the correct java. You are running openJDK instead of oracle JDK https://www.baeldung.com/oracle-jdk-vs-openjdk

The output of java -version should look like this

java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)

hope this helps

bio-visualisation commented 3 years ago

Thank you. I shall try that. Hope this works well. Thank you again

iichelhadi commented 3 years ago

Thank you. I shall try that. Hope this works well. Thank you again

do let us know if it works. good luck.

bio-visualisation commented 3 years ago

Thank you. I shall try that. Hope this works well. Thank you again

do let us know if it works. good luck.

Thank you so much. The problem was with open jdk. I installed oracle jdk and it worked. Thank you for helping to figure out.

iichelhadi commented 3 years ago

Thank you. I shall try that. Hope this works well. Thank you again

do let us know if it works. good luck.

Thank you so much. The problem was with open jdk. I installed oracle jdk and it worked. Thank you for helping to figure out.

excellent!

Kevinzjy commented 3 years ago

Thank you. I shall try that. Hope this works well. Thank you again

do let us know if it works. good luck.

Thank you so much. The problem was with open jdk. I installed oracle jdk and it worked. Thank you for helping to figure out.

Glad to hear that. But it's still confusing to me that I am running CIRI-vis successfully under OpenJDK 1.8.0.

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

Anyway, thanks for the help @bio-visualisation , I will recommend users to try oracle JDK if they run into the same problem again.

Finastycoder commented 1 year ago

hello, I used oracle JDK, the version as follow. but i still get the same error.

java version "20" 2023-03-21 Java(TM) SE Runtime Environment (build 20+36-2344) Java HotSpot(TM) 64-Bit Server VM (build 20+36-2344, mixed mode, sharing)

Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.NullPointerException: Cannot invoke "String.substring(int, int)" because "line" is null at RO2.getro2(RO2.java:60) at CIRI_Full2.main(CIRI_Full2.java:272) ... 5 more

Finastycoder commented 1 year ago

hello, I used oracle JDK, the version as follow. but i still get the same error.

java version "20" 2023-03-21 Java(TM) SE Runtime Environment (build 20+36-2344) Java HotSpot(TM) 64-Bit Server VM (build 20+36-2344, mixed mode, sharing)

Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.NullPointerException: Cannot invoke "String.substring(int, int)" because "line" is null at RO2.getro2(RO2.java:60) at CIRI_Full2.main(CIRI_Full2.java:272) ... 5 more

i installed a new version of CIRI-vis from github, then the issue was resolved