Skip to content
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

johngrimes opened this issue Jan 28, 2018 · 3 comments

JAXB problems in Java 9 #838

johngrimes opened this issue Jan 28, 2018 · 3 comments


Copy link

@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:

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.

Copy link

@jamesagnew 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?

Copy link

@johngrimes 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/ /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(
	at com.phloc.schematron.xslt.AbstractSchematronXSLTResource.applySchematronValidationToSVRL(
	at com.phloc.schematron.SchematronHelper.applySchematron(
	at ca.uhn.fhir.validation.schematron.SchematronBaseValidator.validateResource(
	at ca.uhn.fhir.validation.FhirValidator.validateWithResult(
	at ca.uhn.fhir.cli.App.main(
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
	at java.base/java.lang.ClassLoader.loadClass(
	... 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>'
Copy link

@jamesagnew 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.