[英]JMS message, unable to marshal type “java.lang.String” as an element because it is missing an @XmlRootElement annotation
I have an unexplainable problem that just cropped up. 我有一个无法解释的问题。 In production a RedHat webserver OS was updated/patched and when it restarted, our spring jms application suddenly stopped working.
在生产中,RedHat Web服务器操作系统已更新/打补丁,并且在重新启动时,我们的spring jms应用程序突然停止工作。 No code has changed.
没有代码已更改。
Here is the error message : 这是错误消息:
javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.SAXException2: unable to marshal type "java.lang.String" as an element because it is missing an @XmlRootElement annotation]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
at ca.mycompany.middleware.data.serializer.JAXBSerializer.serialize(JAXBSerializer.java:30)
...
Caused by: com.sun.istack.SAXException2: unable to marshal type "java.lang.String" as an element because it is missing an @XmlRootElement annotation
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:248)
at com.sun.xml.bind.v2.runtime.LeafBeanInfoImpl.serializeRoot(LeafBeanInfoImpl.java:137)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
... 15 more
I don't understand what the problem is ? 我不明白是什么问题?
UPDATE: 更新:
I found the problem. 我发现了问题。 When I started stepping through the code, I found that the real root of the problem was that my application was being blocked by this exception :
当我开始单步执行代码时,我发现问题的真正根源是此异常阻止了我的应用程序:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? javax.net.ssl.SSLException:无法识别的SSL消息,纯文本连接?
I have a work-around, but I'm trying to figure out what changed to block the way I used to call the webservice. 我有一个解决方法,但是我试图找出更改后的内容以阻止我以前调用Web服务的方式。
So, was your java version upgraded? 那么,您的Java版本是否已升级? It seems like in this area of your code:
似乎在代码的这一部分:
at ca.mycompany.middleware.data.serializer.JAXBSerializer.serialize(JAXBSerializer.java:30)
you're trying to JAXB Serialize a string. 您正在尝试JAXB序列化字符串。 This isn't allowed.
这是不允许的。 I wouldn't be surprised if it was a bug in older versions.
如果它是旧版本中的错误,我不会感到惊讶。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.