web項目引用Java項目,串連報錯error HTTP Status 500 - Servlet execution threw an exception

來源:互聯網
上載者:User

標籤:

錯誤資訊

項目背景:

一個web項目引用一個java Project,項目中添加了引用,但是開啟頁面訪問,總報500錯誤。提示:servlet初始化錯誤。

 

環境:Eclipse luna

JDK: 1.7

Tomcat: 8.0

 

 

HTTP Status 500 - Servlet execution threw an exception 

type Exception report

message Servlet execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exceptionorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.NoClassDefFoundError: org/codehaus/jackson/map/ObjectMappercom.founder.xap.maserver.actionstruct.ActionStructParser.fromJson(ActionStructParser.java:20)com.founder.xap.maserver.servlet.MAServlet.processRequest(MAServlet.java:63)com.founder.xap.maserver.servlet.MAServlet.doGet(MAServlet.java:42)javax.servlet.http.HttpServlet.service(HttpServlet.java:622)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.ClassNotFoundException: org.codehaus.jackson.map.ObjectMapperorg.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)com.founder.xap.maserver.actionstruct.ActionStructParser.fromJson(ActionStructParser.java:20)com.founder.xap.maserver.servlet.MAServlet.processRequest(MAServlet.java:63)com.founder.xap.maserver.servlet.MAServlet.doGet(MAServlet.java:42)javax.servlet.http.HttpServlet.service(HttpServlet.java:622)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.21 logs.

 

解決方案:

1、項目屬性,java build path --》projects,添加所需的java項目

2、項目屬性--》 Java build Path --》 Order and Export勾選java項目

 

3、項目屬性--》Deployment Assemby 添加所依賴的Java項目

 

 

web項目引用Java項目,串連報錯error HTTP Status 500 - Servlet execution threw an exception

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.