NCEAS / metadig-webapp

Web service for interacting with the MDQ Engine API
1 stars 2 forks source link

suites API calls fail #19

Closed mbjones closed 9 months ago

mbjones commented 9 months ago

The GET REST API for accessing the /suites and /suites/{suite-id} endpoints fail on access.

javax.servlet.ServletException: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null
    org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:410)
    org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

Root Cause

java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null
    edu.ucsb.nceas.mdqengine.serialize.XmlMarshaller.toXml(XmlMarshaller.java:24)
    edu.ucsb.nceas.mdq.rest.SuitesResource.getSuite(SuitesResource.java:90)
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.base/java.lang.reflect.Method.invoke(Unknown Source)
    org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
    org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
    org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
    org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
    org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
    org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
    org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
    org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
    org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
    org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
    org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
    org.glassfish.jersey.internal.Errors.process(Errors.java:292)
    org.glassfish.jersey.internal.Errors.process(Errors.java:274)
    org.glassfish.jersey.internal.Errors.process(Errors.java:244)
    org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
    org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
    org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
    org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
    org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
jeanetteclark commented 9 months ago

Thanks for the report Matt - once my debugging was all set up this was an incredibly easy fix. The suites endpoint was creating a permanent store (connecting to the database) as opposed to a filestore (where the checks live). See c7d0085

mbjones commented 9 months ago

Glad to hear that. Do you want to target it at a particular milestone release?

jeanetteclark commented 8 months ago

I havent set up a milestone in this repo but this will be for the 3.0.0 release