日期:2014-05-17  浏览次数:20801 次

使用自定义标签老是出错求解!
自己编写了几个自定义标签类在原本项目上跑着也没问题,可是想拿到别的项目上用,于是把那几个类和tld文件打成一个JAR包,在其他项目用,在jsp页面上引用标签后,myeclipse也能真确给提示,但是一旦访问这个页面就报错:

java.lang.NoClassDefFoundErrorJspException
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
java.lang.Class.privateGetPublicMethods(Class.java:2547)
java.lang.Class.getMethods(Class.java:1410)
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1284)
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1158)
java.beans.Introspector.getBeanInfo(Introspector.java:408)
java.beans.Introspector.getBeanInfo(Introspector.java:167)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3909)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2174)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1632)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Generator.generate(Generator.java:3459)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


很是郁闷,不知有没兄弟遇到过这样的问题,给我指点指点,谢谢了!
java jsp jar

------解决方案--------------------
我觉得可以试试,不用jar,把文件直接弄过去,试试

------解决方案--------------------
java.lang.NoClassDefFoundError
把这些jar包放哪儿了?直接放WEB-INFO\lib下面了吗?如果不是,就试试呗。