COM/Sun/mail/util/lineinputstream

Source: Internet
Author: User

During myeclipse development, the following errors may occur during runtime:
Exception in thread "Main" Java. Lang. noclassdeffounderror: COM/Sun/mail/util/lineinputstream

The reason is that the jar package version is inconsistent. javamail conflicts with the packages in Java ee 5 libraries/javaee. Jar/mail.

 

The interface package in javamail1.4 conflicts with the interface package in j2ee5, resulting in the following errors frequently reported in unit tests:

Java. Lang. noclassdeffounderror: COM/Sun/mail/util/bencoderstream

Of course, this error is because the javamail implementer is not introduced into the project (no package is imported), but after the package is imported, another error occurs:

Java. Lang. noclassdeffounderror: COM/Sun/mail/util/lineinputstream

 

Exception in thread "Main" Java. Lang. noclassdeffounderror: javax/activation/datasource

Activation. jar file not imported.

At this time, even Web containers cannot be started. Some netizens often make a bad fortune for these two exceptions. Changing j2ee1.4 will affect the project. However, you must clarify the concept and solve the problem. In j2ee5, the mail. jar package defines only interfaces. If it is not implemented, it cannot actually send emails. However, development and compilation must be successful, because it is compiled for J2EE specifications.Program. At runtime, sun's javamail1.4 implementation was used to start sending emails,

Solution: Remove j2eelibary from this project.

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.