【发布时间】:2018-09-14 07:04:49
【问题描述】:
嗨,我正在使用 maven,我正在尝试生成 excel,然后将其作为附件发送到 netbeans 中的电子邮件我没有收到任何错误,但是在我的 tomcat 中我收到以下错误,我将非常感谢任何帮助或建议,谢谢
我的绒球
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.jexcelapi/jxl -->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<!-- End change plugin specific dependencies here -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
<type>jar</type>
</dependency>
</dependencies>
错误
SEVERE [http-nio-443-exec-10] org.oo.project1.try1.execute null
java.lang.ClassCastException: javax.mail.util.ByteArrayDataSource cannot be cast to javax.sql.DataSource
at org.oo.project1.try1.sendMail(carexcel.java:282)
at org.oo.project1.try1.tryy(carexcel.java:240)
at org.oo.project1.try1.execute(carexcel.java:116)
【问题讨论】:
标签: java tomcat jakarta-mail datasource jexcelapi