当前位置: 代码迷 >> Java Web开发 >> 着急 jsp求助
  详细解决方案

着急 jsp求助

热度:674   发布时间:2011-04-02 14:07:00.0
着急 jsp求助
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the generated java file
The type javax.mail.PasswordAuthentication cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 91 in the jsp file: /messageboard/suggestionbox.jsp
Session cannot be resolved to a type
88:     while (RSEmails.next()) {
89:         try {
90:             Properties props = new Properties(); //创建属性对象
91:             Session sendMailSession; //创建对话对象
92:             Store store;
93:             Transport transport; //创建传输对象
94:             PopupAuthenticator popAuthenticator =


An error occurred at line: 92 in the jsp file: /messageboard/suggestionbox.jsp
Store cannot be resolved to a type
89:         try {
90:             Properties props = new Properties(); //创建属性对象
91:             Session sendMailSession; //创建对话对象
92:             Store store;
93:             Transport transport; //创建传输对象
94:             PopupAuthenticator popAuthenticator =
95:                 new PopupAuthenticator();


An error occurred at line: 93 in the jsp file: /messageboard/suggestionbox.jsp
Transport cannot be resolved to a type
90:             Properties props = new Properties(); //创建属性对象
91:             Session sendMailSession; //创建对话对象
92:             Store store;
93:             Transport transport; //创建传输对象
94:             PopupAuthenticator popAuthenticator =
95:                 new PopupAuthenticator();
96:             PasswordAuthentication pop =


An error occurred at line: 96 in the jsp file: /messageboard/suggestionbox.jsp
PasswordAuthentication cannot be resolved to a type
93:             Transport transport; //创建传输对象
94:             PopupAuthenticator popAuthenticator =
95:                 new PopupAuthenticator();
96:             PasswordAuthentication pop =
97:                 popAuthenticator.performCheck("zhaoruyi", "euyi8401");
98:             sendMailSession =
99:                 Session.getInstance(props, popAuthenticator);


An error occurred at line: 99 in the jsp file: /messageboard/suggestionbox.jsp
Session cannot be resolved
96:             PasswordAuthentication pop =
97:                 popAuthenticator.performCheck("zhaoruyi", "euyi8401");
98:             sendMailSession =
99:                 Session.getInstance(props, popAuthenticator);
100:             //对话目标
101:             props.put("mail.smtp.host", "smtp.nlsde.buaa.edu.cn");
102:             //设置对话对象


An error occurred at line: 104 in the jsp file: /messageboard/suggestionbox.jsp
Message cannot be resolved to a type
101:             props.put("mail.smtp.host", "smtp.nlsde.buaa.edu.cn");
102:             //设置对话对象
103:             props.put("mail.smtp.auth", "true"); //设置smtp身份认证
104:             Message newMessage = new MimeMessage(sendMailSession);
105:             //创建信息对象
106:             //newMessage.setFrom(
107:             //new InternetAddress(


An error occurred at line: 104 in the jsp file: /messageboard/suggestionbox.jsp
MimeMessage cannot be resolved to a type
101:             props.put("mail.smtp.host", "smtp.nlsde.buaa.edu.cn");
102:             //设置对话对象
103:             props.put("mail.smtp.auth", "true"); //设置smtp身份认证
104:             Message newMessage = new MimeMessage(sendMailSession);
105:             //创建信息对象
106:             //newMessage.setFrom(
107:             //new InternetAddress(


An error occurred at line: 109 in the jsp file: /messageboard/suggestionbox.jsp
InternetAddress cannot be resolved to a type
106:             //newMessage.setFrom(
107:             //new InternetAddress(
108:             //(String)session.getAttribute("EmailAddress")));
109:             newMessage.setFrom(new InternetAddress("eims@eims.com"));
110:             //发送者
111:             newMessage.setRecipient(
112:                 Message.RecipientType.TO,


An error occurred at line: 112 in the jsp file: /messageboard/suggestionbox.jsp
Message.RecipientType.TO cannot be resolved to a type
109:             newMessage.setFrom(new InternetAddress("eims@eims.com"));
110:             //发送者
111:             newMessage.setRecipient(
112:                 Message.RecipientType.TO,
113:                 new InternetAddress(
114:                     RSEmails.getString("EmailAddress")));
115:             //接受者


An error occurred at line: 113 in the jsp file: /messageboard/suggestionbox.jsp
InternetAddress cannot be resolved to a type
110:             //发送者
111:             newMessage.setRecipient(
112:                 Message.RecipientType.TO,
113:                 new InternetAddress(
114:                     RSEmails.getString("EmailAddress")));
115:             //接受者
116:             newMessage.setSubject("新的意见箱消息!");


An error occurred at line: 122 in the jsp file: /messageboard/suggestionbox.jsp
Transport cannot be resolved
119:             newMessage.setText(EmailMessage); //邮件内容
120:             transport = sendMailSession.getTransport("smtp");
121:             //实例化传输对象
122:             Transport.send(newMessage); //发送邮件
123:             TheMessage = "您的意见建议已提交成功,您可以填写新意见建议";
124:         }
125:         catch (MessagingException m) {


An error occurred at line: 125 in the jsp file: /messageboard/suggestionbox.jsp
MessagingException cannot be resolved to a type
122:             Transport.send(newMessage); //发送邮件
123:             TheMessage = "您的意见建议已提交成功,您可以填写新意见建议";
124:         }
125:         catch (MessagingException m) {
126:             System.err.println(m);
127:             TheMessage = "您的意见建议已提交成功,但通知邮件未能正常发送!";
128:         }


An error occurred at line: 126 in the jsp file: /messageboard/suggestionbox.jsp
m cannot be resolved
123:             TheMessage = "您的意见建议已提交成功,您可以填写新意见建议";
124:         }
125:         catch (MessagingException m) {
126:             System.err.println(m);
127:             TheMessage = "您的意见建议已提交成功,但通知邮件未能正常发送!";
128:         }
129:     }


Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    cn.edu.buaa.nlsde.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)

求助  懂得  留下个Q  谢谢  弄了半天了  没弄出来
搜索更多相关主题的帖子: java  

----------------解决方案--------------------------------------------------------
javaMail 发邮件?
----------------解决方案--------------------------------------------------------
错误写的很明显了,你的JSP没有编译成功。
1、检查你的java源代码有没有错误。
2、确保工程下所有Java代码都有正常编译?
3、检查有没有缺少Jar包,或有没有Jar包冲突的状况。
上面没问题的话,就是你的tomcat的问题了。
1、检查你的工程有没有成功的部署到Tomcat webapps下,jar包是否全部部署到WEB-INF\lib下面了。
2、检查TOMCAT_HOME\work\Catalina\localhost\your project 下是否有jsp编译后的class文件。
上面还不能解决的话,重装下tomcat吧,再不行,估计就是你JDK的问题了。


----------------解决方案--------------------------------------------------------
  相关解决方案