MobilityData / gtfs-realtime-validator

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds
Other
38 stars 9 forks source link

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

Closed barbeau closed 2 years ago

barbeau commented 2 years ago

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, https://github.com/highsource/maven-jaxb2-plugin/issues/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 https://github.com/MobilityData/gtfs-realtime-validator/issues/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!

isabelle-dr commented 2 years ago

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?

barbeau commented 2 years ago

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 https://github.com/MobilityData/gtfs-realtime-validator/pull/90 and https://github.com/MobilityData/gtfs-realtime-validator/pull/89. So would be good to have a new issue that ties all of these together.

isabelle-dr commented 2 years ago

Yes, I think so. I believe this is the same issue blocking the merge of https://github.com/MobilityData/gtfs-realtime-validator/pull/90 and https://github.com/MobilityData/gtfs-realtime-validator/pull/89. So would be good to have a new issue that ties all of these together.

@barbeau could you open the issue?

barbeau commented 2 years ago

@barbeau could you open the issue?

I opened issue https://github.com/MobilityData/gtfs-realtime-validator/issues/139 for the problem I encountered after bumping the Hibernate dependency, and a draft PR at https://github.com/MobilityData/gtfs-realtime-validator/pull/140 that we can use to reproduce and hopefully fix the issue.