久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

什么可能導致“JAXBElement 沒有無參數默認構造函

What might cause quot;JAXBElement Does not have a no-arg default constructorquot;?(什么可能導致“JAXBElement 沒有無參數默認構造函數?)
本文介紹了什么可能導致“JAXBElement 沒有無參數默認構造函數"?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在生成一個要放入商業軟件產品的 jar.該 jar 符合商業軟件的 api 并依賴于第二個 jar,其中包含(除其他外)一組從 XSD 生成的 POJO.但是,當我將它放入時嘗試實例化 JAXBContext 時它會失敗.

I'm generating a jar which is to be dropped into a commercial software product. That jar conforms to the commercial software's api and depends on a second jar, which contains (among other things) a set of POJOs generated from an XSD. However, it fails when trying to instantiate JAXBContext when I drop it in.

我明白了:

"1 counts of IllegalAnnotationExceptions"
javax.xml.bind.JAXBElement does not have a no-arg default constructor.
  this problem is related to the following location: 
    at javax.xml.bind.JAXBElement
    at mypackage.MyClass
    ...
    JAXBContext.newInstance("mypackage"); 
    ...

我的 XSD(為簡潔起見)如下所示:

My XSD (summarized for brevity) looks like this:

<xsd:schema ... >
  <xsd:element name="MyClass" type="myType" />
  <xsd:complexType name="myType">
  ...
  </xsd:complextType>

</xsd:schema>

我認為問題可能在于xsd:element"級別的類不存在,但即使我將 XJC 設置為創建 MyClass 并且我已驗證 MyClass 有一個公共 no-,問題仍然存在arg 構造函數.

I thought perhaps that the issue was that Classes at the "xsd:element" level didn't exist, but the problem persists even when I set XJC up to create MyClass and I've verified that MyClass has a public no-arg constructor.

所以,我已經查看了其他幾個 SO 問題(事實上,在整個互聯網上).他們都沒有給我足夠的理解來解決這個問題,這可能只是對我的一個不好的反映.任何人都可以提供一些見解嗎?或者給我做其他測試來解決這個問題?

So, I've looked at several other SO questions (and all over the internet, in fact). None of them gave me enough understanding to solve this problem, which may just be a poor reflection on me. Can anybody shed some insight? Or give me alternative tests to conduct to break this down?

推薦答案

最終這個問題是由已修復的錯誤引起的.我正在加載的系統使用庫 JAXB-2.0,我認為我使用的是最新版本 (JAXB-2.2.5).由于設計不佳的插件框架,我的版本被 2.0 jar 搶占了.

Ultimately this problem was caused by an error that has been fixed. The system I am loading into uses the library JAXB-2.0 where I thought I was using the latest version (JAXB-2.2.5). Thanks to a poorly designed plugin framework, my version was being pre-empted by the 2.0 jar.

為了解決這個問題,我必須升級商業軟件的庫,或者嘗試使用 Classloaders

In order to get past this I'll have to either upgrade the library of the commercial software, or try and play with Classloaders

感謝所有幫助我找到這個的人.

Thanks to everyone who helped me to find this.

這篇關于什么可能導致“JAXBElement 沒有無參數默認構造函數"?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 欧美电影免费观看高清 | 久久成人免费 | 91久久久久久久 | 中文字幕在线看第二 | 99国产欧美| 久久在线 | 国产精品一区二区久久 | 午夜精品福利视频 | 午夜av成人 | 国产精品免费在线 | 久久久国产精品一区 | 精品国产91亚洲一区二区三区www | 国产精品中文字幕在线 | 2018国产大陆天天弄 | 久久久青草婷婷精品综合日韩 | 日韩视频―中文字幕 | 欧美激情久久久 | 91九色porny首页最多播放 | 午夜免费网站 | 在线视频h | 国产精品国产馆在线真实露脸 | 99久久免费精品国产免费高清 | 99久久久久久 | 欧美亚洲国产一区二区三区 | 精品一区二区三区四区五区 | 草b视频| 在线观看第一页 | 中文字幕一区在线观看视频 | 一区二区三区影院 | 日韩成人影院 | 伊人网国产 | 日韩精品免费视频 | 国色天香综合网 | 日韩a在线| 超级黄色一级片 | 夜夜干夜夜操 | 国产精品伦一区二区三级视频 | 国产免费自拍 | 蜜桃视频在线观看www社区 | 午夜视频一区二区三区 | 午夜一区 |