IllegalStateException:Ziel-Objekt muss nicht null sein, Spring Boot

Ich bin die Entwicklung einer Plattform auf Basis der micro-services-Architektur (JAX-RS) und ein nodeJS-API.

Ich habe ein problem, das hinzufügen eines Objekts in der Datenbank, weil es sich immer die Marken null von spring boot.

*Hier ist mein REST-controller-code (JAX-RS):

@RequestMapping(value="/Add")
    public Actifs AjouterActifs( @RequestBody Actifs act){

        return Actif.saveT(act);
    }

*Hier der code node-API das Objekt "Actifs":

app.post("/act/add",function (req,res) {

        var addActif = JSON.stringify(req.body);
        console.log("params: "+addActif);

        try {
            http.get(url+"/Add",+addActif, function (response) { //problem is here "addActif is null"
                var dataJson ='';
                response.on('data',function(data){
                    dataJson += data;
                });
                response.on('end',function(){
                    try
                    {
                        var addAct = JSON.parse(dataJson);
                    }
                    catch(err) {
                        console.log('erreur de retourner l\'actif  -->', +err);
                    }
                    res.json(addAct);
                });
            });
        }
        catch(e) {
            console.log("erreur d'ajouter les info d'actif -->", +e);
        }
    });

*Postbote:
IllegalStateException:Ziel-Objekt muss nicht null sein, Spring Boot

Bekomme ich diesen Fehler:

org.springframework.http.converter.HttpMessageNotReadableException:
Benötigte request-body fehlt:

Wie zu vermeiden, ein null-Objekt übergeben von node JS auf die JAX-RS-service ?

danke für die mir helfen,

InformationsquelleAutor | 2017-03-13
Schreibe einen Kommentar