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

fix: JDK 17 - Update Hibernate and XML bindings dependencies #106

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

barbeau
Copy link
Member

@barbeau barbeau commented Feb 23, 2022

Summary:

On JDK 17 the webapp currently fails on startup as discussed in #97.

This is apparently related to changes in what was included in the default JDK platform, as well as cascading changes in the related libraries.

See https://hibernate.atlassian.net/browse/HHH-12551, https://stackoverflow.com/questions/64457496/spring-boot-project-org-springframework-beans-factory-beancreationexceptionerr, highsource/jaxb-tools#201.

This PR updates the Hibernate and XML bindings dependencies to avoid the issue.

FYI, I ran into a separate issue when trying to update to the latest Hibernate release (5.6.5.Final) when the webapp tries to refresh the site contents by hitting the REST API:

Caused by: java.lang.IllegalArgumentException: Could not locate ordinal parameter [0], expecting one of [1, 2, 3]
	at org.hibernate.query.internal.ParameterMetadataImpl.getOrdinalParameterDescriptor(ParameterMetadataImpl.java:154)
	at org.hibernate.query.internal.ParameterMetadataImpl.getQueryParameter(ParameterMetadataImpl.java:204)
	at org.hibernate.query.internal.QueryParameterBindingsImpl.getBinding(QueryParameterBindingsImpl.java:183)
	at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:519)
	at org.hibernate.query.internal.NativeQueryImpl.setParameter(NativeQueryImpl.java:656)
	at org.hibernate.query.internal.NativeQueryImpl.setParameter(NativeQueryImpl.java:66)
	at edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsRtFeed.getMonitorData(GtfsRtFeed.java:200)
	at jdk.internal.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)

...but since this older release works for now we can wait to tackle that for another day.

Closes #97, Closes #83.

Expected behavior:

Webapp starts normally. I've tested this on JDK 11 and 17 and it works on both.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with mvn test to make sure you didn't break anything
  • Format the title like "feat: {new feature short description}" or "fix: {describe what was fixed}". Title must follow the Conventional Commit Specification (https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@isabelle-dr
Copy link

I just testes to see if this PR would fix #102 as well, and it doesn't 😿.
Merging this PR because it fixes two other issues, thank you for this contribution @barbeau!

FYI, I ran into a separate issue

Would it be useful to open an issue now to keep track of this?

@isabelle-dr isabelle-dr merged commit 920676e into master Mar 4, 2022
@isabelle-dr isabelle-dr deleted the sean/java-17 branch March 4, 2022 16:47
@barbeau
Copy link
Member Author

barbeau commented Mar 4, 2022

Would it be useful to open an issue now to keep track of this?

Yes, I think so. I believe this is the same issue blocking the merge of #90 and #89. So would be good to have a new issue that ties all of these together.

@barbeau barbeau mentioned this pull request Mar 8, 2022
3 tasks
@isabelle-dr
Copy link

Yes, I think so. I believe this is the same issue blocking the merge of #90 and #89. So would be good to have a new issue that ties all of these together.

@barbeau could you open the issue?

@barbeau
Copy link
Member Author

barbeau commented Mar 23, 2022

@barbeau could you open the issue?

I opened issue #139 for the problem I encountered after bumping the Hibernate dependency, and a draft PR at #140 that we can use to reproduce and hopefully fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webapp fails on JDK 17 java.security.PrivilegedActionException: java.lang.NoSuchMethodException:
3 participants