javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error

Apache's JIRA Issue Tracker | Lee Baydush | 3 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael and Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    The jax_rs content_negotiation test fails if you call it from a browser and ask for json result (http://localhost:9000/customerservice/customers/123?_type=json) more than once. The first call works. On successive calls, the service throws the following: Jun 16, 2014 4:09:36 PM org.apache.cxf.jaxrs.utils.JAXRSUtils logMessageHandlerProblem SEVERE: Problem with writing the data, class demo.jaxrs.server.Customer, ContentType: application/json Jun 16, 2014 4:09:36 PM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse WARNING: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79) at org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:101) at org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:393) at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1349) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:117) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:80) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:240) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:247) at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.RuntimeException: No ASM ClassWriterFound at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:269) at org.apache.cxf.common.jaxb.JAXBUtils.createNamespaceWrapper(JAXBUtils.java:1011) at org.apache.cxf.common.jaxb.JAXBUtils.setNamespaceMapper(JAXBUtils.java:558) at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.setNamespaceMapper(AbstractJAXBProvider.java:151) at org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:606) at org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:385) ... 28 more Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter at org.apache.cxf.common.util.ASMHelper.getASMClassWriterClass(ASMHelper.java:86) at org.apache.cxf.common.util.ASMHelper.getASMClass(ASMHelper.java:97) at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:266) ... 33 more Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassWriter at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) ... 36 more

    Apache's JIRA Issue Tracker | 3 years ago | Lee Baydush
    javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
  2. 0

    The jax_rs content_negotiation test fails if you call it from a browser and ask for json result (http://localhost:9000/customerservice/customers/123?_type=json) more than once. The first call works. On successive calls, the service throws the following: Jun 16, 2014 4:09:36 PM org.apache.cxf.jaxrs.utils.JAXRSUtils logMessageHandlerProblem SEVERE: Problem with writing the data, class demo.jaxrs.server.Customer, ContentType: application/json Jun 16, 2014 4:09:36 PM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse WARNING: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79) at org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:101) at org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:393) at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1349) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:117) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:80) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:240) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:247) at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.RuntimeException: No ASM ClassWriterFound at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:269) at org.apache.cxf.common.jaxb.JAXBUtils.createNamespaceWrapper(JAXBUtils.java:1011) at org.apache.cxf.common.jaxb.JAXBUtils.setNamespaceMapper(JAXBUtils.java:558) at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.setNamespaceMapper(AbstractJAXBProvider.java:151) at org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:606) at org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:385) ... 28 more Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter at org.apache.cxf.common.util.ASMHelper.getASMClassWriterClass(ASMHelper.java:86) at org.apache.cxf.common.util.ASMHelper.getASMClass(ASMHelper.java:97) at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:266) ... 33 more Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassWriter at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) ... 36 more

    Apache's JIRA Issue Tracker | 3 years ago | Lee Baydush
    javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0
    samebug tip
    This was caused by a failure to instantiate Kafka broker. Check your dependencies.
  5. 0
    samebug tip
    This exception normally means you either have to add the said class to your dependencies or you miswrote it. Look in the documentation of your library how to add it as a dependency.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.objectweb.asm.ClassWriter

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    2. java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    3. java.security.AccessController.doPrivileged(Native Method)
    4. java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    6. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    7. java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    7 frames
  3. Apache CXF Core
    JAXBUtils.setNamespaceMapper
    1. org.apache.cxf.common.util.ASMHelper.getASMClassWriterClass(ASMHelper.java:87)
    2. org.apache.cxf.common.util.ASMHelper.getASMClass(ASMHelper.java:99)
    3. org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:268)
    4. org.apache.cxf.common.jaxb.JAXBUtils.createNamespaceWrapper(JAXBUtils.java:1011)
    5. org.apache.cxf.common.jaxb.JAXBUtils.setNamespaceMapper(JAXBUtils.java:558)
    5 frames
  4. Apache CXF Runtime JAX-RS Frontend
    AbstractJAXBProvider.setNamespaceMapper
    1. org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.setNamespaceMapper(AbstractJAXBProvider.java:155)
    1 frame
  5. Apache CXF JAX-RS Extensions: Providers
    JSONProvider.writeTo
    1. org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:609)
    2. org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:388)
    2 frames
  6. Apache CXF Runtime JAX-RS Frontend
    JAXRSOutInterceptor.handleMessage
    1. org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1363)
    2. org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
    3. org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:117)
    4. org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:80)
    4 frames
  7. Apache CXF Core
    ChainInitiationObserver.onMessage
    1. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    2. org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:81)
    3. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    4. org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    4 frames
  8. Apache CXF Runtime HTTP Transport
    AbstractHTTPDestination.invoke
    1. org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)
    1 frame
  9. Apache CXF Runtime HTTP Jetty Transport
    JettyHTTPHandler.handle
    1. org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:261)
    2. org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
    2 frames
  10. Jetty
    AsyncHttpConnection.handle
    1. org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088)
    2. org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024)
    3. org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    4. org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    5. org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    6. org.eclipse.jetty.server.Server.handle(Server.java:366)
    7. org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
    8. org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
    9. org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
    10. org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
    11. org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    12. org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    12 frames
  11. GWT dev
    SelectChannelEndPoint$1.run
    1. org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
    2. org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
    2 frames
  12. Jetty
    QueuedThreadPool$3.run
    1. org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    2. org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    2 frames
  13. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:744)
    1 frame