zoukankan      html  css  js  c++  java
  • web项目引用Java项目,连接报错error HTTP Status 500

    错误信息

    项目背景:

    一个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 exception
    	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    

    root cause

    java.lang.NoClassDefFoundError: org/codehaus/jackson/map/ObjectMapper
    	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)
    

    root cause

    java.lang.ClassNotFoundException: org.codehaus.jackson.map.ObjectMapper
    	org.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项目

     

  • 相关阅读:
    System.Data.RealonlyException:列Column1被设置为realonly
    学习java过程中
    在windows server 2008下安装vs2005.打开vs2005的时候老提示要“运行vs2005sp1 建议使用管理员权限”
    windows Server 2008下面运行vs2005的问题
    大飞机MIS系统360把我的Transformer.Service服务杀掉了
    开通博客
    C#中怎样让控件显示在其他控件的上面
    vs2010发布问题
    vs在IE8无法调试的解决方法
    将身份证号粘贴到WPS表格后变成了“科学计数法”的解决方案
  • 原文地址:https://www.cnblogs.com/yank/p/4437205.html
Copyright © 2011-2022 走看看