Java. Lang. nosuchmethoderror: org. Apache. Poi. poidocument!

Source: Internet
Author: User

Problem description:

Create a Java project in eclipse and use pio3.7 to read the content in the Word Document Table. Use the main method to correctly execute and obtain the table content.

However, if you put the class in the boup project and execute the main method, the following message is displayed:

Exception in thread "Main" Java. Lang. nosuchmethoderror: org. Apache. Poi. poidocument. <init> (lorg/Apache/poi/poifs/filesystem/directorynode;) V
At org. Apache. Poi. hwpf. hwpfdocumentcore. <init> (hwpfdocumentcore. Java: 146)
At org. Apache. Poi. hwpf. hwpfdocument. <init> (hwpfdocument. Java: 218)
At org. Apache. Poi. hwpf. hwpfdocument. <init> (hwpfdocument. Java: 186)
At CN. CCB. boup. util. Poi. operateword. readwordcell (operateword. Java: 37)
At CN. CCB. boup. util. Poi. operateword. Main (operateword. Java: 87)

Open properties-> JAVA build path-> order and export of the project, find that the two jar packages of POI are put to the end, and move the poi package to the top. Solve the problem!

However, after the Weblogic service of the project is started in the boup, after the transaction calls the method implemented above, the following error will be reported: Java. Lang. nosuchmethoderror: org. Apache. Poi. poidocument!

After research, it is found that because the imported pio-3.7.jar conflicts with the class library (poi-3.2-FINAL-20081019.jar) carried by the sup platform itself, in the "sort and export" setting when an error occurs, the imported pio-3.7.jar In the sup platform itself with the class library (poi-3.2-FINAL-20081019.jar), resulting in the boup platform to run the application, the platform based on the poi-3.2-FINAL-20081019.jar, and do not recognize the pio-3.7.jar, sup comes with poi-3.2-FINAL-20081019.jar only provides the Excel operation API, but does not provide the word operation API, so in the real run application, will report: Java. lang. nosuchmethoderror:
Org. Apache. Poi. poidocument error!

Work und: Right-click on the package where the call reads the content of the Word Table, click Properties, go to the sort and export tab, move the location of the pio-3.7.jar over the poi-3.2-FINAL-20081019.jar, as shown in figure 2.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.