FHIR
FHIR copied to clipboard
Support for Java 17
Is your feature request related to a problem? Please describe. While trying to start the fhir-server with OpenJDK 17 (Temurin), I see the following issue:
Exception = java.lang.reflect.InaccessibleObjectException
Source = com.ibm.ws.kernel.service.location.internal.Activator
probeid = 122
Stack Dump = java.lang.reflect.InaccessibleObjectException: Unable to make field private static javax.naming.spi.InitialContextFactoryBuilder javax.naming.spi.NamingManager.initctx_factory_builder accessible: module java.naming does not "opens javax.naming.spi" to unnamed module @62367338
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.ibm.ws.kernel.service.location.internal.Activator.stop(Activator.java:114)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:870)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:862)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1046)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:376)
at org.eclipse.osgi.container.Module.doStop(Module.java:660)
at org.eclipse.osgi.container.Module.stop(Module.java:521)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1888)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1763)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:208)
at org.eclipse.osgi.container.Module.doStop(Module.java:660)
at org.eclipse.osgi.container.Module.stop(Module.java:521)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:226)
at java.base/java.lang.Thread.run(Thread.java:833)
Describe the solution you'd like Make it possible to run the FHIR server with Java 17 (but keep Java 11 support as well).
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Acceptance Criteria
- GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]
Additional context If JAVA_HOME is not set, we hit this issue instead: https://github.com/OpenLiberty/open-liberty/issues/19876
Exception = org.jboss.weld.exceptions.WeldException
Source = com.ibm.ws.container.service.state.internal.ApplicationStateManager
probeid = 54
Stack Dump = org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default] with class interface javax.transaction.UserTransaction
at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:409)
at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:360)
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:352)
at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:36)
at org.jboss.weld.module.jta.UserTransactionBean.<init>(UserTransactionBean.java:52)
at org.jboss.weld.module.jta.WeldTransactionsModule.preBeanRegistration(WeldTransactionsModule.java:46)
at org.jboss.weld.module.WeldModules.preBeanRegistration(WeldModules.java:158)
at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:224)
at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:443)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:86)
at com.ibm.ws.cdi.impl.CDIContainerImpl.startInitialization(CDIContainerImpl.java:177)
at com.ibm.ws.cdi.liberty.CDIRuntimeImpl.applicationStarting(CDIRuntimeImpl.java:488)
at com.ibm.ws.container.service.state.internal.ApplicationStateManager.fireStarting(ApplicationStateManager.java:51)
at com.ibm.ws.container.service.state.internal.StateChangeServiceImpl.fireApplicationStarting(StateChangeServiceImpl.java:50)
at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.preDeployApp(SimpleDeployedAppInfoBase.java:547)
at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:508)
at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:349)
at com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.install(WARApplicationHandlerImpl.java:65)
at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:161)
at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1357)
at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:901)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:245)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ExceptionInInitializerError
at com.ibm.ws.cdi.proxy.AbstractProxyServices.defineClass(AbstractProxyServices.java:136)
at org.jboss.weld.bean.proxy.ProxyFactory.toClass(ProxyFactory.java:937)
at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:495)
at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:401)
... 24 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @3d52a194
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at com.ibm.ws.cdi.proxy.AbstractProxyServices$ClassLoaderMethods$1.run(AbstractProxyServices.java:60)
at com.ibm.ws.cdi.proxy.AbstractProxyServices$ClassLoaderMethods$1.run(AbstractProxyServices.java:49)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at com.ibm.ws.cdi.proxy.AbstractProxyServices$ClassLoaderMethods.<clinit>(AbstractProxyServices.java:49)
... 28 more
Relates to (and may be fixed by) #3405
Today I am unable to reproduce this issue. Will need to keep an eye on it. I won't consider the issue addressed until we've added java 17 to our test matrix.
Potentially some modules-related / reflection-related issues, so increasing estimate.