genome-nexus / genome-nexus-annotation-pipeline

Library and tool for annotating MAF files using Genome Nexus Webserver API
MIT License
8 stars 27 forks source link

Java Null Pointer Exception while running annotator with Docker #283

Open grabnervan opened 1 month ago

grabnervan commented 1 month ago

When running the annotator with Docker, I get a java.lang.NullPointerException. It reads data from my file just fine, but I would like to eliminate these errors and warnings. I have the most recent Docker image pulled down. Has anyone encountered this?

My command

$ docker run -v ${PWD}:/wd genomenexus/gn-annotation-pipeline:master java -jar annotationPipeline.jar --filename /wd/mutations.txt --output-filename /wd/output.txt

TL;DR Output

2024-07-12 19:34:28 [main] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing step step in job annotationJob
org.springframework.batch.item.ItemStreamException: java.lang.NullPointerException

Full Output

  _____                                               _   _                             
 / ____|                                             | \ | |                            
| |  __    ___   _ __     ___    _ __ ___     ___    |  \| |   ___  __  __  _   _   ___ 
| | |_ |  / _ \ | '_ \   / _ \  | '_ ` _ \   / _ \   | . ` |  / _ \ \ \/ / | | | | / __|
| |__| | |  __/ | | | | | (_) | | | | | | | |  __/   | |\  | |  __/  >  <  | |_| | \__ \
 \_____|  \___| |_| |_|  \___/  |_| |_| |_|  \___|   |_| \_|  \___| /_/\_\  \__,_| |___/

2024-07-12 19:34:27 [main] INFO  org.cbioportal.annotation.AnnotationPipeline - Starting AnnotationPipeline v7a064a4-SNAPSHOT using Java 21.0.3 with PID 1 (/genome-nexus-annotation-pipeline/annotationPipeline/target/annotationPipeline.jar started by root in /genome-nexus-annotation-pipeline/annotationPipeline/target)
2024-07-12 19:34:27 [main] INFO  org.cbioportal.annotation.AnnotationPipeline - No active profile set, falling back to 1 default profile: "default"
2024-07-12 19:34:27 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
2024-07-12 19:34:27 [main] INFO  com.zaxxer.hikari.pool.PoolBase - HikariPool-1 - Driver does not support get/set network timeout for connections. (Receiver class org.h2.jdbc.JdbcConnection does not define or inherit an implementation of the resolved method 'abstract int getNetworkTimeout()' of interface java.sql.Connection.)
2024-07-12 19:34:27 [main] INFO  com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:7c100da6-32c8-43e7-9efa-fe77e318345b user=SA
2024-07-12 19:34:27 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
2024-07-12 19:34:28 [main] WARN  org.springframework.batch.core.listener.AbstractListenerFactoryBean - org.springframework.batch.item.ItemStreamReader is an interface. The implementing class will not be queried for annotation based listener configurations. If using @StepScope on a @Bean method, be sure to return the implementing class so listener annotations can be used.
2024-07-12 19:34:28 [main] WARN  org.springframework.batch.core.listener.AbstractListenerFactoryBean - org.springframework.batch.item.ItemStreamWriter is an interface. The implementing class will not be queried for annotation based listener configurations. If using @StepScope on a @Bean method, be sure to return the implementing class so listener annotations can be used.
2024-07-12 19:34:28 [main] INFO  org.cbioportal.annotation.AnnotationPipeline - Started AnnotationPipeline in 1.087 seconds (process running for 1.457)
2024-07-12 19:34:28 [main] INFO  org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner - Running default command line with: [/wd/mutations.txt, /wd/output.txt]
2024-07-12 19:34:28 [main] INFO  org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=annotationJob]] launched with the following parameters: [{}]
2024-07-12 19:34:28 [main] INFO  org.springframework.batch.core.job.SimpleStepHandler - Executing step: [step]
2024-07-12 19:34:28 [main] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing step step in job annotationJob
org.springframework.batch.item.ItemStreamException: java.lang.NullPointerException
    at org.cbioportal.annotation.pipeline.MutationRecordReader.processComments(MutationRecordReader.java:233)
    at org.cbioportal.annotation.pipeline.MutationRecordReader.open(MutationRecordReader.java:109)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)
    at jdk.proxy2/jdk.proxy2.$Proxy32.open(Unknown Source)
    at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:124)
    at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:293)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:226)
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:153)
    at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:418)
    at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:132)
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:317)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:157)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:148)
    at org.springframework.batch.core.launch.support.TaskExecutorJobLauncher.run(TaskExecutorJobLauncher.java:59)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.execute(JobLauncherApplicationRunner.java:211)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.executeLocalJobs(JobLauncherApplicationRunner.java:195)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.launchJobFromProperties(JobLauncherApplicationRunner.java:175)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.run(JobLauncherApplicationRunner.java:170)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.run(JobLauncherApplicationRunner.java:165)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:755)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
    at org.cbioportal.annotation.AnnotationPipeline.annotateJob(AnnotationPipeline.java:75)
    at org.cbioportal.annotation.AnnotationPipeline.annotate(AnnotationPipeline.java:267)
    at org.cbioportal.annotation.AnnotationPipeline.subMain(AnnotationPipeline.java:127)
    at org.cbioportal.annotation.AnnotationPipeline.main(AnnotationPipeline.java:138)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.NullPointerException
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:144)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.base/java.io.FileReader.<init>(FileReader.java:60)
    at org.cbioportal.annotation.pipeline.MutationRecordReader.processComments(MutationRecordReader.java:216)
    ... 40 more
2024-07-12 19:34:28 [main] INFO  org.springframework.batch.core.step.AbstractStep - Step: [step] executed in 751ms
2024-07-12 19:34:28 [main] ERROR org.springframework.batch.core.step.AbstractStep - Exception while closing step execution resources in step step in job annotationJob
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "this.recordsToWriteCount" is null
    at org.cbioportal.annotation.pipeline.MutationRecordWriter.close(MutationRecordWriter.java:95)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)
    at jdk.proxy2/jdk.proxy2.$Proxy33.close(Unknown Source)
    at org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:111)
    at org.springframework.batch.core.step.tasklet.TaskletStep.close(TaskletStep.java:288)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:312)
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:153)
    at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:418)
    at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:132)
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:317)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:157)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:148)
    at org.springframework.batch.core.launch.support.TaskExecutorJobLauncher.run(TaskExecutorJobLauncher.java:59)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.execute(JobLauncherApplicationRunner.java:211)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.executeLocalJobs(JobLauncherApplicationRunner.java:195)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.launchJobFromProperties(JobLauncherApplicationRunner.java:175)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.run(JobLauncherApplicationRunner.java:170)
    at org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner.run(JobLauncherApplicationRunner.java:165)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:755)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
    at org.cbioportal.annotation.AnnotationPipeline.annotateJob(AnnotationPipeline.java:75)
    at org.cbioportal.annotation.AnnotationPipeline.annotate(AnnotationPipeline.java:267)
    at org.cbioportal.annotation.AnnotationPipeline.subMain(AnnotationPipeline.java:127)
    at org.cbioportal.annotation.AnnotationPipeline.main(AnnotationPipeline.java:138)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
2024-07-12 19:34:28 [main] WARN  org.springframework.beans.factory.support.DisposableBeanAdapter - Custom destroy method 'close' on bean with name 'scopedTarget.writer' threw an exception: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "this.recordsToWriteCount" is null
2024-07-12 19:34:28 [main] INFO  org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=annotationJob]] completed with the following parameters: [{}] and the following status: [FAILED] in 766ms
2024-07-12 19:34:28 [main] INFO  org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=annotationJob]] launched with the following parameters: [{'ignoreOriginalGenomicLocation':'{value=false, type=class java.lang.String, identifying=true}','filename':'{value=/wd/mutations.txt, type=class java.lang.String, identifying=true}','outputFilename':'{value=/wd/output.txt, type=class java.lang.String, identifying=true}','noteColumn':'{value=true, type=class java.lang.String, identifying=true}','replace':'{value=true, type=class java.lang.String, identifying=true}','postIntervalSize':'{value=100, type=class java.lang.String, identifying=true}','stripMatchingBases':'{value=all, type=class java.lang.String, identifying=true}'}]
leexgh commented 1 month ago

Hi @grabnervan! Have you tried an older version of image (e.g. 1.0.4)? Can you share a screenshot of your input file?