docdoku/docdoku-plm

[/workspaces/{workspaceID}/user-access] null pointer exeption raised

ludoBarel opened this issue · 1 comments

EXPLANATION TEXT

When I tried to execute 'user-access' web service, I have a NULL POINTER exception (in the API as well as from the curl command line). But when i tried from web application everything worked.

From API

USED INSTRUCTIONS

UserDTO userDTO = new UserDTO(); WorkspacesApi wksApi = new WorkspacesApi(client); userDTO.setLogin(logins[i]); userDTO.setMembership(UserDTO.MembershipEnum.READ_ONLY); wksApi.setUserAccess(workspaceId,userDTO);

EXECUTION TRACES CURL

COMMAND LINE EXECUTED

$ curl -i -X PUT "http://localhost:8080/eplmp-server-rest/api/workspaces/wks-6b96a968/user-access" -H 'accept:application/json' -H 'Content-Type:application/json' -d '{"workspaceId": "wks-6b96a968","login": "test","name": "test","email": "","language": "en","membership": "READ_ONLY"}' -H 'authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJsb2dpblwiOlwidGVzdFwiLFwiZ3JvdXBOYW1lXCI6XCJ1c2Vyc1wifSIsImlhdCI6MTUzNDQ5ODc2NywiZXhwIjoxNTM0NTA5NTY3fQ.QXFOCo8bs5YUTmUb8wOK2b5HF018VjB0kzKU_SoRhxg'

HTTP RESPONSE

HTTP/1.1 500 Internal Server Error
Server: Payara Server 4.1.2.181 #badassfish
X-Powered-By: Servlet/3.1 JSP/2.3 (Payara Server 4.1.2.181 #badassfish Java/Oracle Corporation/1.8)
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: origin, content-type, accept, authorization, x-accept-encoding, password
Access-Control-Expose-Headers: jwt, x-archive-content-length, shared-entity-token, entity-token
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
Reason-Phrase: Unhandled system error : org.polarsys.eplmp.server.rest.WorkspaceResource.setUserAccess threw java.lang.NullPointerException in WorkspaceResource.java at line 455
Content-Type: text/plain
Date: Fri, 17 Aug 2018 09:42:41 GMT
Connection: close
Content-Length: 162
X-Frame-Options: SAMEORIGIN

TEXT PLAIN ERROR

Unhandled system error : org.polarsys.eplmp.server.rest.WorkspaceResource.setUserAccess threw java.lang.NullPointerException in WorkspaceResource.java at line 455

Correction done for this issue waiting for validation of pull request 55.