javamail利用servlet发送邮件
最近学习JAVAMAIL,在学习利用tomcat中的对象来实现web的发送邮件时,我的代码就错误啦,错误如下javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) at org.apache.naming.NamingContext.lookup(NamingContext.java:792) at org.apache.naming.NamingContext.lookup(NamingContext.java:139) at org.apache.naming.NamingContext.lookup(NamingContext.java:780) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at cn.itcast.javamail3.web.mail.servlets.SendMailServlet.doPost(SendMailServlet.java:55) at cn.itcast.javamail3.web.mail.servlets.SendMailServlet.doGet(SendMailServlet.java:34) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:743) at org.apache.tomcat.(PoolTcpEndpoint.java:527) at org.apache.tomcat.(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619)我的mail.jar是放在Tomcat 5.5\common\lib,而视频说的是要放在Tomcat/中的WEB-INF\lib下,我找不大这样的地方,上网搜索说放在那也是一样的,不知这没错吧?
我的代码是跟着视频写的,视频是有成功的,但我这就不行啦,[local]1[/local]这是我的代码,我用的是MyEclipse 6.0和mySQL,网上说会有兼容问题,现在我的这代码还没涉及数据库,应该还没涉及所谓的兼容问题吧,网上搜还有说是activation.jar的却少,不知是不是呢?上网下了1个,不知道放哪,之后就如mail.jar一样放在tomcat中,但还是那个错误,苦思冥想都不知是哪理错了,所以就来请问个位大侠,