{"record":{"id":"46c8274a49b7637f","repo":"theonedev/onedev","slug":"exception-obtaining-parameters","errorCode":null,"errorMessage":"Exception obtaining parameters","messagePattern":"Exception obtaining parameters","errorType":"exception","errorClass":"MappableException","httpStatus":500,"severity":"error","filePath":"server-core/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java","lineNumber":85,"sourceCode":"            }\n\n            if (entityProviderIndex != -1) {\n                params[entityProviderIndex] = valueProviders.get(entityProviderIndex).apply(request);\n            }\n\n            return params;\n        } catch (WebApplicationException e) {\n            throw e;\n        } catch (MessageBodyProviderNotFoundException e) {\n            throw new NotSupportedException(e);\n        } catch (ProcessingException e) {\n            throw e;\n        } catch (RuntimeException e) {\n            if (e.getCause() instanceof WebApplicationException) {\n                throw (WebApplicationException) e.getCause();\n            }\n\n            throw new MappableException(\"Exception obtaining parameters\", e);\n        } finally {\n\t\t\tEntityDeserializer.popParams();\n\t\t}\n    }\n\n    /**\n     * Create list of parameter value providers for the given {@link Parameterized\n     * parameterized} resource model component.\n     *\n     * @param valueSuppliers all registered value suppliers.\n     * @param parameterized  parameterized resource model component.\n     * @return list of parameter value providers for the parameterized component.\n     */\n    public static List<ParamValueFactoryWithSource<?>> createValueProviders(Collection<ValueParamProvider> valueSuppliers,\n            Parameterized parameterized) {\n        if ((null == parameterized.getParameters()) || (0 == parameterized.getParameters().size())) {\n            return Collections.emptyList();\n        }","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/glassfish/jersey/server/spi/internal/ParameterValueHelper.java#L67-L103","documentation":"ParameterValueHelper.getParameterValues wraps any unexpected RuntimeException that is not a WebApplicationException into org.glassfish.jersey.server.internal.process.MappableException with message \"Exception obtaining parameters\". It is a catch-all indicating the resource method's parameters could not be resolved, and the root cause carries the real problem.","triggerScenarios":"Any unexpected exception thrown while injecting resource method parameters — e.g. a custom ParamConverter, ValueParamProvider, or bean validation hook throwing RuntimeException during parameter resolution; also failures while reading entity bodies that propagate as runtime errors.","commonSituations":"Buggy custom param converters/providers; container misconfiguration; constructor injection failures inside providers; chained root causes that need unwrapping to diagnose.","solutions":["Inspect the MappableException's cause chain to find the real exception","Fix the offending ParamConverter/provider that threw during parameter resolution","Add logging/request filter to capture the full stack trace early"],"exampleFix":"// before\ncatch (MappableException e) { log.error(e.getMessage()); }\n// after\ncatch (MappableException e) { log.error(\"Param resolution failed\", e.getCause() != null ? e.getCause() : e); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { params = getParameterValues(...); } catch (MappableException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error(\"Parameter resolution failed: {}\", root.getMessage(), root); }","preventionTips":["Always unwrap MappableException.getCause() chain to find the real failure","Test custom ParamConverters/ValueParamProviders in isolation","Avoid throwing raw RuntimeExceptions inside param providers"],"tags":["jersey","http","parameter-injection","wrapped-exception"],"backgroundTag":"http-request-failed","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}