Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Problema con metodi in Restful service

    ciao!

    in un servizio restful ho aggiunto un metodo, e da quel momento ottengo questo errore:
    codice:
    Grave:   Exception while loading the app
    Grave:   Undeployment failed for context /wsb2b
    Informazioni:   file:/E:/Project/JAVA/WSB2B/build/web/WEB-INF/classes/_WSB2BPU logout successful
    Grave:   Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: 
    start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: 
    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 com.cimoda.entities.CrClienti
     com.cimoda.service.CrClientiFacadeREST.find(java.lang.Integer) and public java.util.List 
     com.cimoda.service.CrClientiFacadeREST.findCl(java.lang.String) 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@4f3f5b95']
    i metodi incriminati sono questi:
    codice:
        @GET
        @Path("{id}")
        @Produces({"application/xml", "application/json"})
        public CrClienti find(@PathParam("id") Integer id) {
            return super.find(id);
        }
    
        @GET
        @Path("{cl}")
        @Produces({"application/xml", "application/json"})
        @Override
        public List<CrClienti> findCl(@PathParam("cl") String cl) {
            return super.findCl(cl);
        }
    ma sinceramente non riesco a capire!

  2. #2
    leggendo qua e la penso di aver capito il problema ed ho fatto una modifica in questo modo:
    codice:
        @GET
        @Path("{id}")
        @Produces({"application/xml", "application/json"})
        public CrClienti find(@PathParam("id") Integer id) {
            return super.find(id);
        }
    
        @GET
        @Path("/tipo_utente/{type}")
        @Produces({"application/xml", "application/json"})
        @Override
        public List<CrClienti> findCl(@PathParam("type") String type) {
            return super.findCl(type);
        }
    adesso però ottengo un altro errore:
    codice:
    Grave:   Exception while loading the app
    Grave:   Undeployment failed for context /wsb2b
    Informazioni:   file:/E:/Project/JAVA/WSB2B/build/web/WEB-INF/classes/_WSB2BPU logout successful
    Grave:   Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
    qualche idea??

  3. #3
    build&clean e tutto risolto.
    ciao!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.