導出Excel過程中遇到的問題java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException


嘗試實現java導出功能時遇到如下報錯:

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException

經查詢,得知是缺某版本的xmlbean.jar

官方網站:http://xmlbeans.apache.org/
所有的下載鏈接最終都指向了http://attic.apache.org/projects/xmlbeans.html
然后指向了
http://archive.apache.org/dist/xml/xmlbeans/
頁面上方有
● the XMLbeans project page
● the XMLbeans download page
● the XMLbeans download area
● the XML/xmlbeans archive
這樣的四個鏈接
第一個是官網
第二個是下載頁,指出Current release: 2.4.0 released on July 8, 2008.最新版本是2008年的2.4,而其官網上是2.6
往下看,有這樣一句
Binary or source?
Most users will want to download a binary release of XMLBeans. If you're interested in contributing or like to live on the bleeding edge, you may want to compile the source for yourself.

點那個鏈接,會跳到apache的鏡像網站列表

第一項:http://mirrors.shuosc.org/apache/xmlbeans/binaries
apache官方推薦的,點擊以后,404。
第二條是:http://mirrors.shuosc.org/apache/xmlbeans/binaries
點擊后跳轉到http://attic.apache.org/projects/xmlbeans.html
頁面上有一些文字,告訴你apache xmlbean從2013年開始,移到了attic,右側有一堆各種項目,往下找,找到xmlbean,點完以后,會回到頂部。
仔細看文字中的鏈接,Apache XMLBeans是官方網站,第二個鏈接http://xmlbeans.apache.org ,也是官方網站,第三個鏈接Apache Archives.,是Apache的目錄列表
● the XMLbeans project page
● the XMLbeans download page
● the XMLbeans download area
● the XML/xmlbeans archive
是不是似曾相識,對,就在本頁面的上方。循環開始。我們是從第二項XMLbeans download page開始進入的,下面來看第三項,第三項是目錄列表,秘密就在這里,下面的xmlbeans-current.zip就是最新版本,但是鑒於官網寫的是2.6,這個名字還是感覺不怎么靠譜,就繼續找,我們來看第二個目錄,binaries/,點擊,1.0以后的版本都在這里,往下翻,一直找到xmlbeans-2.6.0.zip,成功。從時間看來,確實就是上一級目錄的xmlbeans-current.zip,一樣的。

 

下載后,把xmlbeans-2.6.0\lib中的jar復制到運行目錄下的lib下,我這里是WebContent\WEB-INF\lib,不必在eclipse中導入

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM