MSGFPlus / msgfplus

MS-GF+ (aka MSGF+ or MSGFPlus) performs peptide identification by scoring MS/MS spectra against peptides derived from a protein sequence database.
Other
76 stars 36 forks source link

java 11 class not found problem #95

Open bernt-matthias opened 4 years ago

bernt-matthias commented 4 years ago

Describe the bug

With JAVA 11 we observe the following error:

|  Standard error: Exception in thread "main" java.lang.ExceptionInInitializerError
|  at uk.ac.ebi.jmzml.xml.Constants.<clinit>(Constants.java:56)
|  at uk.ac.ebi.jmzml.xml.xxindex.MzMLIndexerFactory$MzMlIndexerImpl.<init>(MzMLIndexerFactory.java:82)
|  at uk.ac.ebi.jmzml.xml.xxindex.MzMLIndexerFactory$MzMlIndexerImpl.<init>(MzMLIndexerFactory.java:52)
|  at uk.ac.ebi.jmzml.xml.xxindex.MzMLIndexerFactory.buildIndex(MzMLIndexerFactory.java:49)
|  at uk.ac.ebi.jmzml.xml.io.MzMLUnmarshaller.<init>(MzMLUnmarshaller.java:121)
|  at uk.ac.ebi.jmzml.xml.io.MzMLUnmarshaller.<init>(MzMLUnmarshaller.java:100)
|  at edu.ucsd.msjava.mzml.MzMLAdapter.<init>(MzMLAdapter.java:27)
|  at edu.ucsd.msjava.msutil.SpectraAccessor.getSpecMap(SpectraAccessor.java:38)
|  at edu.ucsd.msjava.ui.MSGFPlus.runMSGFPlus(MSGFPlus.java:217)
|  at edu.ucsd.msjava.ui.MSGFPlus.runMSGFPlus(MSGFPlus.java:105)
|  at edu.ucsd.msjava.ui.MSGFPlus.main(MSGFPlus.java:56)
|  Caused by: javax.xml.bind.DataBindingException: javax.xml.bind.JAXBException
|  - with linked exception:
|  [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
|  at javax.xml.bind.JAXB.unmarshal(JAXB.java:186)
|  at uk.ac.ebi.jmzml.MzMLElement.loadProperties(MzMLElement.java:609)
|  at uk.ac.ebi.jmzml.MzMLElement.<init>(MzMLElement.java:564)
|  at uk.ac.ebi.jmzml.MzMLElement.<clinit>(MzMLElement.java:83)
|  ... 11 more
|  Caused by: javax.xml.bind.JAXBException
|  - with linked exception:
|  [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
|  at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:241)
|  at javax.xml.bind.ContextFinder.find(ContextFinder.java:455)
|  at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652)
|  at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
|  at javax.xml.bind.JAXB$Cache.<init>(JAXB.java:127)
|  at javax.xml.bind.JAXB.getContext(JAXB.java:154)
|  at javax.xml.bind.JAXB.unmarshal(JAXB.java:183)
|  ... 14 more
|  Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
|  at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
|  at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
|  at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
|  at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:573)
|  at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:239)
|  ... 20 more

To Reproduce Steps to reproduce the issue:

The test is from the test data in the OpenMS suite.

java -Xmx512m -jar /home/berntm/projects/tools-galaxyp/tools/openms/OpenMS2.5-env/share/msgf_plus-2017.07.21-1/MSGFPlus.jar -s spectra.mzML -o /tmp/20200226_170540_MOLSYB009_10197_1/msgfplus_output.mzid -d proteins.fasta -t 10ppm -ti 0,1 -tda 0 -m 0 -inst 1 -e 1 -protocol 0 -ntt 2 -minLength 6 -maxLength 40 -minCharge 1 -maxCharge 3 -n 1 -addFeatures 0 -thread 1 -mod /tmp/20200226_170540_MOLSYB009_10197_1/msgfplus_mods.txt

openjdk 11.0.1-internal 2018-10-16
OpenJDK Runtime Environment (build 11.0.1-internal+0-adhoc..src)
OpenJDK 64-Bit Server VM (build 11.0.1-internal+0-adhoc..src, mixed mode)

Additional context Add any other context about the problem here.

FarmGeek4Life commented 4 years ago

Unfortunately, MS-GF+ uses jmzReader, which uses jmzml for reading mzML files. I have previously created a pull request for one of their libraries to help resolve this issue, but they have not created a maven release since accepting that pull request. Prior to Java 11 there were other methods to work around this issue, but Java 11 fully removed those libraries (when they were just deprecated in Java 9 and 10). It might be possible to work around this issue by using a newer version of the jaxb-api and jaxb-runtime libraries in the MS-GF+ pom.xml.