draeger-lab / ModelPolisher

ModelPolisher accesses the BiGG Models knowledgebase to annotate SBML models.
MIT License
23 stars 7 forks source link

Update ModelPolisher compatibility with openjdk-11 #34

Closed codekaust closed 5 years ago

codekaust commented 5 years ago

I was trying to polish models from https://github.com/SBRG/bigg_models_data/tree/master/models which contain <html> tag in them. The list can be seen by doing grep -Ril "<html" in thebigg_models_data/tree/master/models` directory.

One of the examples could be ecoli_core_model.xml

I use the following command

java -jar ~/GSoC/ModelPolisher/target/ModelPolisher-fat-1.7.jar --input="/home/kaustubh/GSoC/bigg_models_data/models/ecoli_core_model.xml" --output="/home/kaustubh/Desktop/" --annotate-with-bigg=true

The error shown is: Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

This issue was encountered using open_jdk 11.

No issue with java version "1.8.0_211"

matthiaskoenig commented 5 years ago

Please write a more detailed issue report, so it is possible for others to reproduce the issue.

I have no idea what you tried here? Did you check a test model? If yes, which test model? What command did you run? Without people being able to reproduce the issue it is not possible to check if it was fixed. Also no unit tests can be written for the issue.

Best Matthias

codekaust commented 5 years ago

@matthiaskoenig I just noticed that this error is coming with Java SE 9 and above only. I have updated the issue.

Probably the reason for this issue is: The JAXB APIs are considered to be Java EE APIs, and therefore are no longer contained on the default class path in Java SE 9. In Java 11 they are completely removed from the JDK.

codekaust commented 5 years ago

When using openjdk-11, the following major error comes during build: error: package javax.xml.bind does not exist

Reason: According to the release-notes, Java 11 removed the Java EE modules. So, java.xml.bind (JAXB) - REMOVED

This can be solved by adding the dependency: compile 'javax.xml.bind:jaxb-api:2.3.0'

But, while running ModelPolisher, error: javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

To solve this need to further add the following dependency:

compile 'javax.activation:activation:1.1'
compile 'org.glassfish.jaxb:jaxb-runtime:2.3.0'

Thus in total, 3 dependencies are to be added to build.gradle to solve this issue.