You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by GitBox <gi...@apache.org> on 2022/03/04 03:57:30 UTC

[GitHub] [incubator-linkis] peacewong opened a new issue #1607: [Bug] The xml annotation of the Message object should be removed

peacewong opened a new issue #1607:
URL: https://github.com/apache/incubator-linkis/issues/1607


   ### Search before asking
   
   - [X] I searched the [issues](https://github.com/apache/incubator-linkis/issues) and found no similar issues.
   
   
   ### Linkis Component
   
   linkis-commons
   
   ### What happened + What you expected to happen
   
   Spring MVC's exception interception is incompatible with XML, and the annotation @XmlRootElement of the message returned by the general restful will be removed
   
   ### Relevent platform
   
   all
   
   ### Reproduction script
   
   1. request a table that does not exist:curl http://127.0.0.1:8088/api/rest_j/v1/datasource/getTableBaseInfo?database=bdp_dqm_tmp&tableName=cube_student_dqm111
   2. response  code will be 500 
   ![image](https://user-images.githubusercontent.com/11496700/156696410-04f040ba-9851-4fa7-a5d3-9043928eff20.png)
   3. should be 
   ![image](https://user-images.githubusercontent.com/11496700/156696457-0c8146bb-c358-482a-8833-e18c35d71cfb.png)
   4. linkis-publicservice log 
   ```
   2022-03-03 20:12:31.183 [WARN ] [qtp1886202798-64                        ] o.s.w.s.m.s.DefaultHandlerExceptionResolver (199) [logException] - Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not marshal [Message(null, 1, {errorMsg={serviceKind=linkis-ps-datasource, level=2, port=9106, errCode=0, ip=127.0.0.1, desc=operation failed(操作失败)s!the reason(原因):IllegalArgumentException: table不存在}})]: null; nested exception is javax.xml.bind.MarshalException
    - with linked exception:
   [com.sun.istack.SAXException2: class java.util.HashMap nor any of its super class is known to this context.
   javax.xml.bind.JAXBException: class java.util.HashMap nor any of its super class is known to this context.]]
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org