jsp里调用web service
我用Axis2发布了一个web service,然后在客户端用类NewsSelectedByTag对这个service的输出分装了一下。
然后我想在一个JSP里调用这个NewsSelectedByTag类,(我在一个普通类里面调用就正常)
代码如下:<%@ page import="database.NewsSelectedByTag" %>
<% NewsSelectedByTag news=new NewsSelectedByTag();%>
但是运行显示错误,求高手解释,谢谢!!
错误描述如下:
org.apache.jasper.JasperException: An exception occurred processing JSP page /rss/SelectByTagRSS.jsp at line 3
1: <?xml version="1.0" encoding="GBK"?>
2: <%@ page import="database.NewsSelectedByTag" %>
3: <% NewsSelectedByTag news=new NewsSelectedByTag();%>
4: <rss version="2.0">
5: <channel>
6: <title>Test RSS channel's title</title>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/axis2/AxisFault
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.rss.SelectByTagRSS_jsp._jspService(SelectByTagRSS_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NoClassDefFoundError: org/apache/axis2/AxisFault
org.apache.jsp.rss.SelectByTagRSS_jsp._jspService(SelectByTagRSS_jsp.java:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.ClassNotFoundException: org.apache.axis2.AxisFault
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
org.apache.jsp.rss.SelectByTagRSS_jsp._jspService(SelectByTagRSS_jsp.java:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
------解决方案--------------------
Axis2\lib下的jar 没有添加到classpath 环境变量里
我的异常网推荐解决方案:An exception occurred processing JSP page,http://www.aiyiweb.com/j2se/33144.html