Ok, I've got remote debugging setup. @Dan: the answer for your question you asked before:
The content type in Response.java:806 is application/json;profile=urn:org.restfulobjects:repr-types/error Do you need more information? Thanks for your help, Erik ________________________________________ From: Dan Haywood [d...@haywood-associates.co.uk] Sent: Thursday, June 19, 2014 10:27 AM To: users Subject: Re: internal server error after invoking restful action It seems that Tomcat is barfing in attempting to render the response generated by RO, so I'm not ruling out there being a bug here in Isis somehow. But definitely need more information. As suggested before, we can do a remote pairing session if you wish.... would like to understand this issue better myself. Dan On 18 June 2014 14:07, Jeroen van der Wal <jer...@stromboli.it> wrote: > Hi Erik, > > You could try to set up remote debugging: > http://wiki.apache.org/tomcat/FAQ/Developing > > http://stackoverflow.com/questions/3835612/remote-debugging-tomcat-with-eclipse > > Cheers, > > Jeroen > > > On Wed, Jun 18, 2014 at 2:26 PM, Erik de Hair <e...@pocos.nl> wrote: > > Hi Dan, > > > > Get the same error again. This time it's not related to only one method > but I can't access /portal/restful (or sub URI's) anymore. It is only on 1 > server where the application is remotely deployed. Two others have no > problem. They have the same installed OS, Tomcat versions and JRE. > > > > Any clue? Don't know how to debug this as I can't reproduce it in a > development environment. > > > > StackTrace > > ================================== > > > > javax.servlet.ServletException: Servlet execution threw an exception > > > org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:41) > > > org.apache.isis.core.webapp.IsisSessionFilter$SessionState$1.handle(IsisSessionFilter.java:320) > > > org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:409) > > > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) > > > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) > > > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) > > > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) > > > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) > > > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) > > > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) > > root cause > > > > org.apache.tomcat.util.http.parser.TokenMgrError: Lexical error at line > 1, column 29. Encountered: ":" (58), after : "" > > > org.apache.tomcat.util.http.parser.HttpParserTokenManager.getNextToken(HttpParserTokenManager.java:434) > > > org.apache.tomcat.util.http.parser.HttpParser.jj_ntk(HttpParser.java:300) > > > org.apache.tomcat.util.http.parser.HttpParser.MediaType(HttpParser.java:21) > > > org.apache.catalina.connector.Response.setContentType(Response.java:806) > > > org.apache.catalina.connector.Response.checkSpecialHeader(Response.java:1140) > > > org.apache.catalina.connector.Response.addHeader(Response.java:1121) > > > org.apache.catalina.connector.ResponseFacade.addHeader(ResponseFacade.java:547) > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.addResponseHeader(HttpServletResponseHeaders.java:64) > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.add(HttpServletResponseHeaders.java:50) > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.putAll(HttpServletResponseHeaders.java:119) > > > org.jboss.resteasy.core.ServerResponse.commitHeaders(ServerResponse.java:312) > > > org.jboss.resteasy.core.ServerResponse$1.commit(ServerResponse.java:232) > > > org.jboss.resteasy.util.CommitHeaderOutputStream.commit(CommitHeaderOutputStream.java:50) > > > org.jboss.resteasy.util.CommitHeaderOutputStream.write(CommitHeaderOutputStream.java:63) > > > org.jboss.resteasy.plugins.providers.StringTextStar.writeTo(StringTextStar.java:60) > > > org.jboss.resteasy.plugins.providers.StringTextStar.writeTo(StringTextStar.java:20) > > > org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:243) > > > org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:616) > > > org.jboss.resteasy.core.SynchronousDispatcher.writeFailure(SynchronousDispatcher.java:447) > > > org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:349) > > > org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:248) > > > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:130) > > > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) > > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) > > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:722) > > > org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:41) > > > org.apache.isis.core.webapp.IsisSessionFilter$SessionState$1.handle(IsisSessionFilter.java:320) > > > org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:409) > > > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) > > > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) > > > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) > > > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) > > > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) > > > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) > > > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) > > > > > > ________________________________________ > > From: Erik de Hair [e...@pocos.nl] > > Sent: Friday, May 30, 2014 8:35 PM > > To: users@isis.apache.org > > Subject: Re: internal server error after invoking restful action > > > > Hi Dan, > > > > I wanted to give the debugging a try but I can't reproduce the anymore. > I put back the same return type but it works fine now... > > > > Will contact you when it pops up again. > > > > Erik > > > > > > On 05/30/2014 11:08 AM, Dan Haywood wrote: > > > > On 30 May 2014 07:47, "Erik de Hair" <e...@pocos.nl><mailto: > e...@pocos.nl> wrote: > > > > > > > > Hi Dan, > > > > Haven't had the possibility to find some more information. Looks like I > > should go debugging Tomcat (libraries). Never done that before so that > will > > take some time (that I don't have ;-) ). > > > > > > > > > > OK. We can always do a bit of remote pairing if you want... contact me > > off-list. > > > > > > > > > > > > It looks like it depends on the return type of the method. I didn't need > > the return type in this case so I had a workaround. I tagged the message > > for picking this up later and I expect to use the same return type in the > > future so this wil pop up again. > > > > > > > > > > Cheers > > > > Dan > > > > > > > > > > Erik > > > > On 05/29/2014 07:13 AM, Dan Haywood wrote: > > > > Hi Erik, > > any chance of further information on this breakage? > > Thx > > Dan > > > > > > On 20 May 2014 16:27, Dan Haywood <d...@haywood-associates.co.uk><mailto: > d...@haywood-associates.co.uk><mailto: > > d...@haywood-associates.co.uk><mailto:d...@haywood-associates.co.uk> > wrote: > > > > > > > > Hi Erik, > > hmm, thx for reporting this, but not seen it before. > > > > From the stacktrace, looks like the content type set in the header is > > invalid somehow. > > > > Any chance of putting a breakpoint when the exception is thrown [a] and > > then look back at point [b] to see what is being set? > > > > [a] at org.apache.tomcat.util.http.parser.HttpParserTokenManager. > > getNextToken(HttpParserTokenManager.java:434) > > at org.apache.tomcat.util.http.parser.HttpParser.jj_ntk( > > HttpParser.java:300) > > at org.apache.tomcat.util.http.parser.HttpParser.MediaType( > > HttpParser.java:21) > > [b] at org.apache.catalina.connector.Response.setContentType( > > Response.java:806) > > > > Thx > > Dan > > > > > > > > > > On 20 May 2014 14:33, Erik de Hair <e...@pocos.nl><mailto:e...@pocos.nl > ><mailto:e...@pocos.nl><mailto:e...@pocos.nl> > > wrote: > > > > > > > > Hi Dan, > > > > I receive an error ( 500 Internal Server Error) after posting to the > > restful interface. The action itself (confirmNewUserAccount) executed > > successfully (can see that in the logs). Any idea? > > > > @NotInServiceMenu > > public Contact confirmNewUserAccount( > > @Named("hashedUsername") String hashedUsername, > > @Named("password") String password, > > @Named("passwordRepeated") String passwordRepeated) { > > Contact user = findUserByHashedUsername(hashedUsername); > > > > user.setActive(true); > > user.setEnabled(true); > > > > user.setPassword(password); > > > > persistIfNotAlready(user); > > > > try { > > sendUserAccountActivedEmail(user.getEmail()); > > } catch(Exception e){ > > > > > > > warnUser(messages.getString("contacts.confirmnewaccount.error_sending_confirmation_mail")); > > LOG.warn("error sending confirmation message to activated > > user with email address '"+ user.getEmail() +"'", e); > > } > > return user; > > } > > > > SEVERE: Servlet.service() for servlet [RestfulObjectsRestEasyDispatcher] > > in context with path [/portal] threw exception [Servlet execution threw > an > > exception] with root cause > > org.apache.tomcat.util.http.parser.TokenMgrError: Lexical error at line > > 1, column 29. Encountered: ":" (58), after : "" > > at > > > > > org.apache.tomcat.util.http.parser.HttpParserTokenManager.getNextToken(HttpParserTokenManager.java:434) > > at > > org.apache.tomcat.util.http.parser.HttpParser.jj_ntk(HttpParser.java:300) > > at > > > org.apache.tomcat.util.http.parser.HttpParser.MediaType(HttpParser.java:21) > > at > > org.apache.catalina.connector.Response.setContentType(Response.java:806) > > at > > > > > org.apache.catalina.connector.Response.checkSpecialHeader(Response.java:1140) > > at > > org.apache.catalina.connector.Response.addHeader(Response.java:1121) > > at > > > > > org.apache.catalina.connector.ResponseFacade.addHeader(ResponseFacade.java:547) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.addResponseHeader(HttpServletResponseHeaders.java:64) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.add(HttpServletResponseHeaders.java:50) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.putAll(HttpServletResponseHeaders.java:119) > > at > > > > > org.jboss.resteasy.core.ServerResponse.commitHeaders(ServerResponse.java:312) > > at > > org.jboss.resteasy.core.ServerResponse$1.commit(ServerResponse.java:232) > > at > > > > > org.jboss.resteasy.util.CommitHeaderOutputStream.commit(CommitHeaderOutputStream.java:50) > > at > > > > > org.jboss.resteasy.util.CommitHeaderOutputStream.write(CommitHeaderOutputStream.java:63) > > at > > > > > org.jboss.resteasy.plugins.providers.StringTextStar.writeTo(StringTextStar.java:60) > > at > > > > > org.jboss.resteasy.plugins.providers.StringTextStar.writeTo(StringTextStar.java:20) > > at > > org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:243) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:616) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.writeFailure(SynchronousDispatcher.java:447) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:349) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:373) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:362) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) > > at > > > > > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) > > at > > > > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > > at > > > > > org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:41) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > > at > > > > > org.apache.isis.core.webapp.IsisSessionFilter$SessionState$1.handle(IsisSessionFilter.java:320) > > at > > > > > org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:409) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > > at > > > > > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) > > at > > > > > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) > > at > > > > > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) > > at > > > > > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) > > at > > > > > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) > > at > > > > > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) > > at > > > > > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) > > at > > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > > at > > > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) > > at > > > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) > > at > > > > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) > > at > > > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) > > at > > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) > > at > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) > > at > > > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) > > at > > > > > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) > > at > > > > > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) > > at > > > > > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) > > at > > > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) > > at > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > > at java.lang.Thread.run(Thread.java:701) > > > > Thanks, > > Erik > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >