JavaWeb 项目org.apache.jasper.JasperException解决方法

JavaWeb 项目org.apache.jasper.JasperException解决方法org.apache.jasper.JasperException:/XX.jsp(10,0)ThevaluefortheuseBeanclassattribute包.类isinvalid解决方法报错信息:org.apache.jasper.JasperException:/javabean.jsp(10,0)ThevaluefortheuseBean…

JavaWeb

org.apache.jasper.JasperException: /XX.jsp(10,0) The value for the useBean class attribute 包.类 is invalid解决方法

报错信息:

org.apache.jasper.JasperException: /javabean.jsp(10,0) The value for the useBean class attribute javabean.User is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Generator G e n e r a t e V i s i t o r . v i s i t ( G e n e r a t o r . j a v a : 1220 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . N o d e GenerateVisitor.visit(Generator.java:1220) at org.apache.jasper.compiler.Node GenerateVisitor.visit(Generator.java:1220)atorg.apache.jasper.compiler.NodeUseBean.accept(Node.java:1178)
at org.apache.jasper.compiler.Node N o d e s . v i s i t ( N o d e . j a v a : 2361 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . N o d e Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node Nodes.visit(Node.java:2361)atorg.apache.jasper.compiler.NodeVisitor.visitBody(Node.java:2411)
at org.apache.jasper.compiler.Node V i s i t o r . v i s i t ( N o d e . j a v a : 2417 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . N o d e Visitor.visit(Node.java:2417) at org.apache.jasper.compiler.Node Visitor.visit(Node.java:2417)atorg.apache.jasper.compiler.NodeRoot.accept(Node.java:495)
at org.apache.jasper.compiler.Node N o d e s . v i s i t ( N o d e . j a v a : 2361 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . G e n e r a t o r . g e n e r a t e ( G e n e r a t o r . j a v a : 3416 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . C o m p i l e r . g e n e r a t e J a v a ( C o m p i l e r . j a v a : 231 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . C o m p i l e r . c o m p i l e ( C o m p i l e r . j a v a : 347 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . C o m p i l e r . c o m p i l e ( C o m p i l e r . j a v a : 327 ) a t o r g . a p a c h e . j a s p e r . c o m p i l e r . C o m p i l e r . c o m p i l e ( C o m p i l e r . j a v a : 314 ) a t o r g . a p a c h e . j a s p e r . J s p C o m p i l a t i o n C o n t e x t . c o m p i l e ( J s p C o m p i l a t i o n C o n t e x t . j a v a : 589 ) a t o r g . a p a c h e . j a s p e r . s e r v l e t . J s p S e r v l e t W r a p p e r . s e r v i c e ( J s p S e r v l e t W r a p p e r . j a v a : 317 ) a t o r g . a p a c h e . j a s p e r . s e r v l e t . J s p S e r v l e t . s e r v i c e J s p F i l e ( J s p S e r v l e t . j a v a : 313 ) a t o r g . a p a c h e . j a s p e r . s e r v l e t . J s p S e r v l e t . s e r v i c e ( J s p S e r v l e t . j a v a : 260 ) a t j a v a x . s e r v l e t . h t t p . H t t p S e r v l e t . s e r v i c e ( H t t p S e r v l e t . j a v a : 717 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . A p p l i c a t i o n F i l t e r C h a i n . i n t e r n a l D o F i l t e r ( A p p l i c a t i o n F i l t e r C h a i n . j a v a : 290 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . A p p l i c a t i o n F i l t e r C h a i n . d o F i l t e r ( A p p l i c a t i o n F i l t e r C h a i n . j a v a : 206 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d W r a p p e r V a l v e . i n v o k e ( S t a n d a r d W r a p p e r V a l v e . j a v a : 233 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d C o n t e x t V a l v e . i n v o k e ( S t a n d a r d C o n t e x t V a l v e . j a v a : 191 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d H o s t V a l v e . i n v o k e ( S t a n d a r d H o s t V a l v e . j a v a : 127 ) a t o r g . a p a c h e . c a t a l i n a . v a l v e s . E r r o r R e p o r t V a l v e . i n v o k e ( E r r o r R e p o r t V a l v e . j a v a : 102 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d E n g i n e V a l v e . i n v o k e ( S t a n d a r d E n g i n e V a l v e . j a v a : 109 ) a t o r g . a p a c h e . c a t a l i n a . c o n n e c t o r . C o y o t e A d a p t e r . s e r v i c e ( C o y o t e A d a p t e r . j a v a : 298 ) a t o r g . a p a c h e . c o y o t e . h t t p 11. H t t p 11 P r o c e s s o r . p r o c e s s ( H t t p 11 P r o c e s s o r . j a v a : 852 ) a t o r g . a p a c h e . c o y o t e . h t t p 11. H t t p 11 P r o t o c o l Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Generator.generate(Generator.java:3416) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:347) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol Nodes.visit(Node.java:2361)atorg.apache.jasper.compiler.Generator.generate(Generator.java:3416)atorg.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:347)atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:327)atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:314)atorg.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:717)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)atorg.apache.coyote.http11.Http11ProtocolHttp11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:748)

百度查看了很多资料依然找不了解决办法,最后查JavaBean的特征:

1、提供一个默认的无参构造函数。
2、需要被序列化并且实现了Serializable接口。
3、可能有一系列可读写属性。
4、可能有一系列的”getter”或”setter”方法。

查看了我的实体类只有无参构造函数和getXX和setXX方法。加上实现Serializable接口且序列化,问题解决

package javabeandemo;

import java.io.Serializable;

public class User implements Serializable{
	private static final long serialVersionUID = -8535778739754609087L;
	private String username;
	private String password;
	public User() {
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
}

今天的文章JavaWeb 项目org.apache.jasper.JasperException解决方法分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/27753.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注