Tag: classformaterror

需要帮助设置一个类来发送电子邮件,它从主类调用

当用户第一次登录时,我正尝试从我的应用程序发送电子邮件。 该电子邮件包含激活码。 更新:我下载了最新的javamail API以及最新的JAF(JavaBeans Activation Framework),由于导入是未知符号,因此无法编译。 如何从javax包导入? 这是我到目前为止的代码: import java.util.ArrayList; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class Email { static String smtpHost; static int smtpPort; static String from; static String to; static String subject; static String content; public Email(String toEmail, String code){ smtpHost = “localhost”; smtpPort […]

ClassFormatError:在类文件javax / mail / MessagingException中非本机或抽象的方法中的Absent Code属性

当我使用javaMail api在我的spring mvc web应用程序上发送电子邮件时,我得到一个奇怪的ClassFormatError 。 下面是我的mail-cfg.xml true true 我的POM文件 4.0.0 FreedomSpring FreedomSpring war 0.0.1-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 3.0 1.5 1.5 org.apache.maven.plugins maven-war-plugin 2.3 WebContent src\main\webapp\WEB-INF\web.xml org.springframework spring-webmvc 3.1.2.RELEASE org.springframework spring-orm 3.1.2.RELEASE junit junit 4.10 net.sf.json-lib json-lib 2.4 jdk15 org.hibernate hibernate-core 4.1.7.Final jar compile org.hibernate hibernate-validator 4.3.0.Final log4j log4j 1.2.17 org.springframework spring-tx 3.1.2.RELEASE org.springframework spring-test 3.1.2.RELEASE commons-dbcp […]