net.sf.json.JSONException: java.lang.reflect.InvocationTargetException

Stack Overflow | Paul Zepernick | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Struts2 Rest Mapper Taking Over Non Rest Json Result

    Stack Overflow | 5 months ago | Paul Zepernick
    net.sf.json.JSONException: java.lang.reflect.InvocationTargetException

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      JsonObject

      at com.google.gson.JsonElement.getAsByte()
    2. Gson
      JsonElement.getAsByte
      1. com.google.gson.JsonElement.getAsByte(JsonElement.java:257)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    4. Apache Commons BeanUtils
      PropertyUtils.getProperty
      1. org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2116)
      2. org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1267)
      3. org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:808)
      4. org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:884)
      5. org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:464)
      5 frames
    5. json-lib
      JSONObject.fromObject
      1. net.sf.json.JSONObject._fromBean(JSONObject.java:918)
      2. net.sf.json.JSONObject.fromObject(JSONObject.java:168)
      3. net.sf.json.AbstractJSON._processValue(AbstractJSON.java:265)
      4. net.sf.json.JSONArray._processValue(JSONArray.java:2514)
      5. net.sf.json.JSONArray.processValue(JSONArray.java:2539)
      6. net.sf.json.JSONArray.addValue(JSONArray.java:2526)
      7. net.sf.json.JSONArray._fromCollection(JSONArray.java:1057)
      8. net.sf.json.JSONArray.fromObject(JSONArray.java:123)
      9. net.sf.json.AbstractJSON._processValue(AbstractJSON.java:237)
      10. net.sf.json.JSONObject._processValue(JSONObject.java:2808)
      11. net.sf.json.JSONObject.processValue(JSONObject.java:2874)
      12. net.sf.json.JSONObject.setInternal(JSONObject.java:2889)
      13. net.sf.json.JSONObject.setValue(JSONObject.java:1577)
      14. net.sf.json.JSONObject._fromBean(JSONObject.java:934)
      15. net.sf.json.JSONObject.fromObject(JSONObject.java:168)
      16. net.sf.json.AbstractJSON._processValue(AbstractJSON.java:265)
      17. net.sf.json.JSONObject._processValue(JSONObject.java:2808)
      18. net.sf.json.JSONObject.processValue(JSONObject.java:2874)
      19. net.sf.json.JSONObject.setInternal(JSONObject.java:2889)
      20. net.sf.json.JSONObject.setValue(JSONObject.java:1577)
      21. net.sf.json.JSONObject._fromBean(JSONObject.java:934)
      22. net.sf.json.JSONObject.fromObject(JSONObject.java:168)
      23. net.sf.json.JSONObject.fromObject(JSONObject.java:130)
      23 frames
    6. Struts 2 REST Plugin
      RestActionInvocation.invoke
      1. org.apache.struts2.rest.handler.JsonLibHandler.fromObject(JsonLibHandler.java:72)
      2. org.apache.struts2.rest.DefaultContentTypeHandlerManager.handleResult(DefaultContentTypeHandlerManager.java:181)
      3. org.apache.struts2.rest.RestActionInvocation.executeResult(RestActionInvocation.java:227)
      4. org.apache.struts2.rest.RestActionInvocation.processResult(RestActionInvocation.java:194)
      5. org.apache.struts2.rest.RestActionInvocation.invoke(RestActionInvocation.java:142)
      5 frames
    7. XWork
      DefaultActionProxy.execute
      1. com.opensymphony.xwork2.DefaultActionProxy.execute(DefaultActionProxy.java:154)
      1 frame
    8. Struts2
      ExecuteOperations.executeAction
      1. org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:556)
      2. org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81)
      2 frames
    9. org.apache.struts2
      StrutsPrepareAndExecuteFilter.doFilter
      1. org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:113)
      1 frame
    10. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
      2 frames
    11. com.hs.security
      SecurityScanner.doFilter
      1. com.hs.security.SecurityScanner.doFilter(SecurityScanner.java:95)
      1 frame
    12. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:105)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      8. org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      10 frames
    13. Grizzly HTTP
      NioEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1078)
      2. org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      3. org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:760)
      4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1524)
      4 frames
    14. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2 frames
    15. Tomcat Util
      TaskThread$WrappingRunnable.run
      1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      1 frame
    16. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame