org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.util.List br.com.alexandreesl.handson.rest.ProductRest.getProducts() and public java.util.List br.com.alexandreesl.handson.rest.CustomerRest.getCustomers() at matching regular expression /. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@14c14bf']

Stack Overflow | 3 months ago
  1. 0

    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization

    Stack Overflow | 3 months ago
    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.util.List br.com.alexandreesl.handson.rest.ProductRest.getProducts() and public java.util.List br.com.alexandreesl.handson.rest.CustomerRest.getCustomers() at matching regular expression /. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@14c14bf']
  2. 0

    Spring Boot Kotlin Jersey ModelValidationException

    Stack Overflow | 3 months ago | greyfox
    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public javax.ws.rs.core.Response com.joescodeshack.igdb.controller.GenreController.getGenres() and public final java.util.List com.joescodeshack.igdb.controller.GenreController.getGenres() at matching regular expression /genre. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1b6cce78']
  3. 0

    Jersey ModelValidationException

    Stack Overflow | 8 months ago | maddy
    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] A HTTP GET method, public javax.ws.rs.core.Response RestFulApp.Crud.MyResource.create(int,int,int,int), should not consume any form parameter.; source='ResourceMethod{httpMethod=GET, consumedTypes=[application/json], producedTypes=[application/json], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class RestFulApp.Crud.MyResource, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@c8e6a64]}, definitionMethod=public javax.ws.rs.core.Response RestFulApp.Crud.MyResource.create(int,int,int,int), parameters=[Parameter [type=int, source=animalname, defaultValue=null], Parameter [type=int, source=animaltype, defaultValue=null], Parameter [type=int, source=animalpassword, defaultValue=null], Parameter [type=int, source=animalemailid, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}']
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Crash when adding parameter that is a pojo

    Stack Overflow | 1 year ago | Jemil Riahi
    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response com.car.resource.AdminResource.removeUser(com.car.core.User,java.lang.String) at index 0.; source='ResourceMethod{httpMethod=POST, consumedTypes=[application/json], producedTypes=[text/html], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class com.car.resource.AdminResource, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@74294c1a]}, definitionMethod=public javax.ws.rs.core.Response com.car.resource.AdminResource.removeUser(com.car.core.User,java.lang.String), parameters=[Parameter [type=class com.car.core.User, source=null, defaultValue=null], Parameter [type=class java.lang.String, source=null, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}']
  6. 0

    ERROR [0.8 -> 0.9] @Auth No injection source found

    GitHub | 1 year ago | crudbug
    org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization. [[FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response io.example.resource.CollectResource.consumeEvent(javax.servlet.http.HttpServletRequest,io.example.model.User,io.example.event.Event) at index 1.; source='ResourceMethod{httpMethod=POST, consumedTypes=[application/json], producedTypes=[application/json], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class io.example.resource.CollectResource, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@1acb74ad]}, definitionMethod=public javax.ws.rs.core.Response io.example.resource.CollectResource.consumeEvent(javax.servlet.http.HttpServletRequest,io.example.model.User,io.example.event.Event), parameters=[Parameter [type=interface javax.servlet.http.HttpServletRequest, source=null, defaultValue=null], Parameter [type=class io.example.model.User, source=null, defaultValue=null], Parameter [type=class io.example.event.Event, source=null, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}', [FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.glassfish.jersey.server.model.ModelValidationException

    Validation of the application resource model has failed during application initialization. [[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.util.List br.com.alexandreesl.handson.rest.ProductRest.getProducts() and public java.util.List br.com.alexandreesl.handson.rest.CustomerRest.getCustomers() at matching regular expression /. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@14c14bf']

    at org.glassfish.jersey.server.ApplicationHandler.initialize()
  2. jersey-core-server
    ApplicationHandler$3.call
    1. org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:555)[jersey-server-2.23.1.jar:na]
    2. org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)[jersey-server-2.23.1.jar:na]
    3. org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)[jersey-server-2.23.1.jar:na]
    4. org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)[jersey-server-2.23.1.jar:na]
    4 frames
  3. Jersey Core
    Errors.processWithException
    1. org.glassfish.jersey.internal.Errors.process(Errors.java:315)[jersey-common-2.23.1.jar:na]
    2. org.glassfish.jersey.internal.Errors.process(Errors.java:297)[jersey-common-2.23.1.jar:na]
    3. org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)[jersey-common-2.23.1.jar:na]
    3 frames
  4. jersey-core-server
    ApplicationHandler.<init>
    1. org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:347)[jersey-server-2.23.1.jar:na]
    1 frame
  5. jersey-container-servlet-core
    ServletContainer.init
    1. org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392)[jersey-container-servlet-core-2.23.1.jar:na]
    2. org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)[jersey-container-servlet-core-2.23.1.jar:na]
    3. org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)[jersey-container-servlet-core-2.23.1.jar:na]
    3 frames
  6. JavaServlet
    GenericServlet.init
    1. javax.servlet.GenericServlet.init(GenericServlet.java:158)[tomcat-embed-core-8.5.4.jar:8.5.4]
    1 frame
  7. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1194)[tomcat-embed-core-8.5.4.jar:8.5.4]
    2. org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)[tomcat-embed-core-8.5.4.jar:8.5.4]
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)[tomcat-embed-core-8.5.4.jar:8.5.4]
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)[tomcat-embed-core-8.5.4.jar:8.5.4]
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)[tomcat-embed-core-8.5.4.jar:8.5.4]
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)[tomcat-embed-core-8.5.4.jar:8.5.4]
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[tomcat-embed-core-8.5.4.jar:8.5.4]
    8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)[tomcat-embed-core-8.5.4.jar:8.5.4]
    9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)[tomcat-embed-core-8.5.4.jar:8.5.4]
    9 frames
  8. Grizzly HTTP
    SocketProcessorBase.run
    1. org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)[tomcat-embed-core-8.5.4.jar:8.5.4]
    2. org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)[tomcat-embed-core-8.5.4.jar:8.5.4]
    3. org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)[tomcat-embed-core-8.5.4.jar:8.5.4]
    4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)[tomcat-embed-core-8.5.4.jar:8.5.4]
    5. org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcat-embed-core-8.5.4.jar:8.5.4]
    5 frames
  9. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_102]
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_102]
    2 frames
  10. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.5.4.jar:8.5.4]
    1 frame
  11. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_102]
    1 frame