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

JAXB problems in Java 9 #838

Closed
johngrimes opened this Issue Jan 28, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@johngrimes

johngrimes commented Jan 28, 2018

There appears to be some problems with JAXB in Java 9.

Take a look at these CI build results, which contains the results of trying to validate a resource using the hapi-fhir-cli on Mac OS X with Java 9:

https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/17367/

I did a bit of Googling, and found that these APIs may have now been moved to Java EE, and the fix may be to include them as explicit dependencies.

https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Jan 28, 2018

Hi @johngrimes ,

I'm definitely not opposed to fixing this by adding the dependencies they suggest... but I'm actually confused at why this is even an issue. As far as I know we have nothing in the tool that uses JAXB.

Is there a stack trace or any kind of error being outputted that hints at where JAXB is getting used?

BTW- this is super cool. I'm a Homebrew user myself and I had no idea you had created a cask for the CLI. :) Any objections if I link to it from the HAPI FHIR website?

@johngrimes

This comment has been minimized.

johngrimes commented Jan 28, 2018

Well, hopefully I can decommission my repo shortly. Once we fix this error, the pull request to have it merged into hombrew-core should be accepted, and people will be able to brew install hapi-fhir-cli without the brew tap johngrimes/hapi-fhir-cli step.

Here is the stack trace:

Testing hapi-fhir-cli
/usr/bin/sandbox-exec -f /tmp/homebrew20180128-96235-1xoaicq.sb /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hapi-fhir-cli.rb --verbose
==> /usr/local/Cellar/hapi-fhir-cli/3.2.0/bin/hapi-fhir-cli validate -n /tmp/hapi-fhir-cli-test-20180128-96236-xv7z18/TestResource.json
Picked up _JAVA_OPTIONS:  -Duser.home=/Users/brew/Library/Caches/Homebrew/java_cache
------------------------------------------------------------
? HAPI FHIR 3.2.0 - Command Line Tool
------------------------------------------------------------
Max configured JVM memory (Xmx): 1.8GB
Detected Java version: 9.0.1
------------------------------------------------------------
02:38:24 INFO  ca.uhn.fhir.cli.ValidateCommand - Reading file '/tmp/hapi-fhir-cli-test-20180128-96236-xv7z18/TestResource.json' using encoding UTF-8
02:38:24 INFO  ca.uhn.fhir.cli.ValidateCommand - Fully read - Size is 5KB
02:38:24 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU3]
02:38:26 INFO  ca.uhn.fhir.util.XmlUtil - FHIR XML procesing will use StAX implementation 'null' version 'null'
02:38:26 WARN  c.u.fhir.parser.LenientErrorHandler - Unknown element 'comment' found while parsing
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at com.phloc.schematron.svrl.SVRLReader.readXML(SVRLReader.java:73)
	at com.phloc.schematron.xslt.AbstractSchematronXSLTResource.applySchematronValidationToSVRL(AbstractSchematronXSLTResource.java:171)
	at com.phloc.schematron.SchematronHelper.applySchematron(SchematronHelper.java:126)
	at ca.uhn.fhir.validation.schematron.SchematronBaseValidator.validateResource(SchematronBaseValidator.java:79)
	at ca.uhn.fhir.validation.FhirValidator.validateWithResult(FhirValidator.java:231)
	at ca.uhn.fhir.cli.ValidateCommand.run(ValidateCommand.java:135)
	at ca.uhn.fhir.cli.App.main(App.java:189)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
	... 7 more
Error: hapi-fhir-cli: failed
Failed executing: /usr/local/Cellar/hapi-fhir-cli/3.2.0/bin/hapi-fhir-cli validate -n /tmp/hapi-fhir-cli-test-20180128-96236-xv7z18/TestResource.json
/usr/local/Homebrew/Library/Homebrew/formula.rb:1792:in `block in system'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1730:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1730:in `system'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hapi-fhir-cli.rb:157:in `block in <class:HapiFhirCli>'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1636:in `block (3 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/utils.rb:549:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1635:in `block (2 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/formula.rb:835:in `with_logging'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1634:in `block in run_test'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1628:in `run_test'
/usr/local/Homebrew/Library/Homebrew/test.rb:28:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/timeout.rb:33:in `block in catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/timeout.rb:106:in `timeout'
/usr/local/Homebrew/Library/Homebrew/test.rb:27:in `<main>'

@johngrimes johngrimes referenced this issue Jan 28, 2018

Closed

hapi-fhir-cli 3.2.0 (new formula) #23369

4 of 4 tasks complete
@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Jan 29, 2018

Ahhhh, it's Phloc's fault. Well then. :)

Fix incoming.

jamesagnew added a commit that referenced this issue Feb 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment