{"action":"created","issue":{"url":"https://api.github.com/repos/demoiselle/framework/issues/67","repository_url":"https://api.github.com/repos/demoiselle/framework","labels_url":"https://api.github.com/repos/demoiselle/framework/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/demoiselle/framework/issues/67/comments","events_url":"https://api.github.com/repos/demoiselle/framework/issues/67/events","html_url":"https://github.com/demoiselle/framework/issues/67","id":210029114,"number":67,"title":"ExceptionMapper, sendo interrompido um NullPointer de Crud","user":{"login":"robsonximenes","id":957206,"avatar_url":"https://avatars.githubusercontent.com/u/957206?v=3","gravatar_id":"","url":"https://api.github.com/users/robsonximenes","html_url":"https://github.com/robsonximenes","followers_url":"https://api.github.com/users/robsonximenes/followers","following_url":"https://api.github.com/users/robsonximenes/following{/other_user}","gists_url":"https://api.github.com/users/robsonximenes/gists{/gist_id}","starred_url":"https://api.github.com/users/robsonximenes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsonximenes/subscriptions","organizations_url":"https://api.github.com/users/robsonximenes/orgs","repos_url":"https://api.github.com/users/robsonximenes/repos","events_url":"https://api.github.com/users/robsonximenes/events{/privacy}","received_events_url":"https://api.github.com/users/robsonximenes/received_events","type":"User","site_admin":false},"labels":[{"id":430906138,"url":"https://api.github.com/repos/demoiselle/framework/labels/Problema","name":"Problema","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"clovisjunior","id":1461807,"avatar_url":"https://avatars.githubusercontent.com/u/1461807?v=3","gravatar_id":"","url":"https://api.github.com/users/clovisjunior","html_url":"https://github.com/clovisjunior","followers_url":"https://api.github.com/users/clovisjunior/followers","following_url":"https://api.github.com/users/clovisjunior/following{/other_user}","gists_url":"https://api.github.com/users/clovisjunior/gists{/gist_id}","starred_url":"https://api.github.com/users/clovisjunior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clovisjunior/subscriptions","organizations_url":"https://api.github.com/users/clovisjunior/orgs","repos_url":"https://api.github.com/users/clovisjunior/repos","events_url":"https://api.github.com/users/clovisjunior/events{/privacy}","received_events_url":"https://api.github.com/users/clovisjunior/received_events","type":"User","site_admin":false},"assignees":[{"login":"clovisjunior","id":1461807,"avatar_url":"https://avatars.githubusercontent.com/u/1461807?v=3","gravatar_id":"","url":"https://api.github.com/users/clovisjunior","html_url":"https://github.com/clovisjunior","followers_url":"https://api.github.com/users/clovisjunior/followers","following_url":"https://api.github.com/users/clovisjunior/following{/other_user}","gists_url":"https://api.github.com/users/clovisjunior/gists{/gist_id}","starred_url":"https://api.github.com/users/clovisjunior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clovisjunior/subscriptions","organizations_url":"https://api.github.com/users/clovisjunior/orgs","repos_url":"https://api.github.com/users/clovisjunior/repos","events_url":"https://api.github.com/users/clovisjunior/events{/privacy}","received_events_url":"https://api.github.com/users/clovisjunior/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/demoiselle/framework/milestones/5","html_url":"https://github.com/demoiselle/framework/milestone/5","labels_url":"https://api.github.com/repos/demoiselle/framework/milestones/5/labels","id":2335351,"number":5,"title":"3.0.1","description":"","creator":{"login":"botelhojp","id":1793654,"avatar_url":"https://avatars.githubusercontent.com/u/1793654?v=3","gravatar_id":"","url":"https://api.github.com/users/botelhojp","html_url":"https://github.com/botelhojp","followers_url":"https://api.github.com/users/botelhojp/followers","following_url":"https://api.github.com/users/botelhojp/following{/other_user}","gists_url":"https://api.github.com/users/botelhojp/gists{/gist_id}","starred_url":"https://api.github.com/users/botelhojp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botelhojp/subscriptions","organizations_url":"https://api.github.com/users/botelhojp/orgs","repos_url":"https://api.github.com/users/botelhojp/repos","events_url":"https://api.github.com/users/botelhojp/events{/privacy}","received_events_url":"https://api.github.com/users/botelhojp/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2017-02-20T17:24:02Z","updated_at":"2017-02-24T11:56:59Z","due_on":"2017-03-21T07:00:00Z","closed_at":null},"comments":0,"created_at":"2017-02-24T11:48:56Z","updated_at":"2017-02-24T12:05:15Z","closed_at":null,"body":"Pessoal, criei um exceptionMapper, para minha exceção (herda RuntimeException); \r\nnela eu seto o status code e coloco um entidade simples.\r\npackage br.gov.serpro.smartcert.exception;\r\n\r\nimport javax.ws.rs.core.Response;\r\nimport javax.ws.rs.ext.ExceptionMapper;\r\nimport javax.ws.rs.ext.Provider;\r\n\r\n@Provider\r\npublic class SmartCertExceptionMapper implements ExceptionMapper<SmartCertException> {\r\n\r\n    @Override\r\n    public Response toResponse(SmartCertException exception) {        \r\n        int status = exception.getStatus();\r\n        ErrorMsg entity = new ErrorMsg();\r\n        entity.msg= exception.getMsg();\r\n        entity.debbug= (exception.getMessage()!=null)?exception.getMessage():\"\";   \r\n        return Response.status(status).entity(entity).type(\"application/json\").build();\r\n    }    \r\n    public final class ErrorMsg{\r\n    \tpublic String msg = \"\";\r\n    \tpublic String debbug = \"\";\r\n    }  \r\n}\r\nAi quando rodo a aplicacao e lanco a excecao no BC. Sobe este erro no jboss:\r\n\r\n17:11:59,390 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /smartcert-api/api/dispositivos/1/certificados: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException\r\nat org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:187)\r\nat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)\r\nat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)\r\nat org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)\r\nat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)\r\nat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)\r\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\nat io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\r\nat io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\r\nat io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\r\nat org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\r\nat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\nat io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\r\ndSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\r\nat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\r\nat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\r\nat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\r\nat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\r\nat io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)\r\nat io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\r\nat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)\r\nat io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)\r\nat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)\r\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\nat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.NullPointerException\r\nat org.demoiselle.jee.crud.pagination.PaginationHelper.buildAcceptRange(PaginationHelper.java:244)\r\nat org.demoiselle.jee.crud.pagination.PaginationHelper.buildAcceptRangeWithResponse(PaginationHelper.java:341)\r\nat org.demoiselle.jee.crud.pagination.PaginationHelper$Proxy$_$$_WeldClientProxy.buildAcceptRangeWithResponse(Unknown Source)\r\nat org.demoiselle.jee.crud.CrudFilter.filter(CrudFilter.java:134)\r\nat org.demoiselle.jee.crud.CrudFilter$Proxy$_$$_WeldClientProxy.filter(Unknown Source)\r\nat org.jboss.resteasy.core.ServerResponseWriter.executeFilters(ServerResponseWriter.java:121)\r\nat org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:48)\r\nat org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:183)\r\n... 44 more\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/demoiselle/framework/issues/comments/282276129","html_url":"https://github.com/demoiselle/framework/issues/67#issuecomment-282276129","issue_url":"https://api.github.com/repos/demoiselle/framework/issues/67","id":282276129,"user":{"login":"robsonximenes","id":957206,"avatar_url":"https://avatars.githubusercontent.com/u/957206?v=3","gravatar_id":"","url":"https://api.github.com/users/robsonximenes","html_url":"https://github.com/robsonximenes","followers_url":"https://api.github.com/users/robsonximenes/followers","following_url":"https://api.github.com/users/robsonximenes/following{/other_user}","gists_url":"https://api.github.com/users/robsonximenes/gists{/gist_id}","starred_url":"https://api.github.com/users/robsonximenes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsonximenes/subscriptions","organizations_url":"https://api.github.com/users/robsonximenes/orgs","repos_url":"https://api.github.com/users/robsonximenes/repos","events_url":"https://api.github.com/users/robsonximenes/events{/privacy}","received_events_url":"https://api.github.com/users/robsonximenes/received_events","type":"User","site_admin":false},"created_at":"2017-02-24T12:05:15Z","updated_at":"2017-02-24T12:05:15Z","body":"O prblema é em CrudFilter\r\n\r\n`\r\n    @Override\r\n    public void filter(ContainerRequestContext req, ContainerResponseContext response) throws IOException {\r\n\r\n        if (response.getEntity() instanceof Result) {\r\n\r\n            buildHeaders(response);\r\n            \r\n            response.setEntity(buildContentBody(response));\r\n\r\n            if (!paginationHelper.isPartialContentResponse()) {\r\n                response.setStatus(Status.OK.getStatusCode());\r\n            } \r\n            else {\r\n                response.setStatus(Status.PARTIAL_CONTENT.getStatusCode());\r\n            }\r\n        } \r\n        else {\r\n            if (Status.BAD_REQUEST.getStatusCode() == response.getStatus() && drc.getEntityClass() == null) {\r\n                paginationHelper.buildAcceptRangeWithResponse(response);\r\n            }\r\n        }\r\n\r\n    }\r\n`\r\n\r\nEle esta interferindo no meu sistema. O crud pode ser desabilitado? Não deveria estar no core do projeto.\r\n"}}
{"actor":{"display_login":"robsonximenes"}}