JSON 으로 호출하는데  415 Unsupported Media Type 오류가 발생한다.



@Path("/login")

@POST

@Consumes({ MediaType.APPLICATION_JSON }) // 수신

@Produces({ MediaType.APPLICATION_JSON }) // 응답

@Transactional

public Response login(@Context HttpServletRequest httpServletRequest, JSONObject jsonObject) {

System.out.println("jsonObject= = " + jsonObject);

int status = HttpServletResponse.SC_OK;

String authCredentials = httpServletRequest.getHeader(AUTHENTICATION_HEADER);


AuthenticationService authenticationService = new AuthenticationService();

boolean authenticationStatus = authenticationService.authenticate(authCredentials);

if (authenticationStatus) {

} else {

status = HttpServletResponse.SC_UNAUTHORIZED;

}

return Response.status(status).entity(jsonObject).build();

}



확인해야할 사항은


Content-Type: application/json to the "Headers":


headers 에 Content-Type이 application/json 으로 설정되어 있는지 확인한다.



 


Posted by [czar]
,

tomcat jdbc jar

카테고리 없음 2016. 10. 13. 11:27

tomcat

sqljdbc41.jar

mysql-connector-java-5.1.38-bin.jar


Posted by [czar]
,

잘 되던 프로젝트가 계속 오류를 발생시킨다...... 


Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)


Goals 는 clean install 만 있었으나




http://stackoverflow.com/questions/19489720/maven-failed-to-clean-project-failed-to-delete-org-ow2-util-asm-asm-tree



-Dmaven.clean.failOnError=false


항목을 추가해보라는 말에.


clean install -Dmaven.clean.failOnError=false



오..... 잘된다...

Posted by [czar]
,