• Elicpse新建userLibrary导入jar包时抛出NotFoundException异常


    最近刚开始学Struts2.0框架。再导入jar包的时候突然心血来潮。为方便区分jar包的功能,于是想在WEB-INF -> lib 目录下想新建一个struts文件夹,以方便分类查看。

    像上图这样子。

    再去看web Library的时候,那么问题就来了。使用tomcat8.0,本来这里应该会自动生成的。

    这里没有,那我就自己新建一个叫做"struts2"的userlibrary。步骤如下:项目右键-->build path-->configure build path-->Libraries选项卡里面->add Library-->User Library-->next-->user Libraries...-->new-->add jars。

    这时候就出现:

    当我重启服务器的时候,出现了很多NotFoundException异常。(其实我前面写了几个简单的过滤器,所以错误里面提示了这个StrutsPrepareAndExecuteFilter类找不到。

    五月 09, 2016 5:35:29 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.8.0_65in;C:WINDOWSSunJavain;C:WINDOWSsystem32;C:WINDOWS;C:/Program Files/Java/jre1.8.0_65/bin/server;C:/Program Files/Java/jre1.8.0_65/bin;C:/Program Files/Java/jre1.8.0_65/lib/amd64;C:ProgramDataOracleJavajavapath;D:clementinein;D:software2013matlab
    untimewin64;D:software2013matlabin;C:Program FilesJavajdk1.8.0_65in;C:Program FilesJavajdk1.8.0_65jrein;D:HPLoadRunnerstrawberry-perlperlin;C:Program Files (x86)HPNVlib	hirdpartysafenetLDK7.0;C:Program Files (x86)HPNVlibshunrasnv;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;D:software	ortoiseSVNin;C:Program FilesMicrosoftWeb Platform Installer;C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0;C:Program Files (x86)Windows Kits8.0Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program FilesCommon FilesAutodesk Shared;C:Program Files (x86)AutodeskBackburner;C:Program FilesMicrosoft SQL Server110DTSBinn;C:Program Files (x86)Microsoft SQL Server110ToolsBinn;C:Program Files (x86)Microsoft SQL Server110ToolsBinnManagementStudio;C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQL Server110DTSBinn;D:softwareeclipse;;.
    五月 09, 2016 5:35:29 下午 org.apache.coyote.AbstractProtocol init
    信息: Initializing ProtocolHandler ["http-nio-8080"]
    五月 09, 2016 5:35:29 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    信息: Using a shared selector for servlet write/read
    五月 09, 2016 5:35:29 下午 org.apache.coyote.AbstractProtocol init
    信息: Initializing ProtocolHandler ["ajp-nio-8009"]
    五月 09, 2016 5:35:29 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    信息: Using a shared selector for servlet write/read
    五月 09, 2016 5:35:29 下午 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 867 ms
    五月 09, 2016 5:35:29 下午 org.apache.catalina.core.StandardService startInternal
    信息: Starting service Catalina
    五月 09, 2016 5:35:29 下午 org.apache.catalina.core.StandardEngine startInternal
    信息: Starting Servlet Engine: Apache Tomcat/8.0.33
    五月 09, 2016 5:35:30 下午 org.apache.jasper.servlet.TldScanner scanJars
    信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    五月 09, 2016 5:35:30 下午 org.apache.catalina.core.StandardContext filterStart
    严重: Exception starting filter struts
    java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4658)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5277)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    
    五月 09, 2016 5:35:30 下午 org.apache.catalina.core.StandardContext startInternal
    严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
    五月 09, 2016 5:35:30 下午 org.apache.catalina.core.StandardContext startInternal
    严重: Context [/first] startup failed due to previous errors
    五月 09, 2016 5:35:30 下午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["http-nio-8080"]
    五月 09, 2016 5:35:30 下午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["ajp-nio-8009"]
    五月 09, 2016 5:35:30 下午 org.apache.catalina.startup.Catalina start
    信息: Server startup in 782 ms

    这时候我意识到可能是包没有导进来,于是我倒腾了好久,最后在这里,找到了原因。这个应该要勾上去,不然没有导进来。

     

    可以这么修改:项目右键-->properties-->deploment assembly-->add java build path entries-->next-->Struts2(刚刚新建的user Library)-->finish。

    ok,这时候再运行就没问题了。

    贴士:

    其实修改一下class-path,把WEB-INF lib目录下新建的文件夹也配置一下,这样tomcat自动帮我们生成jar包,这样也可以解决这个问题。

    -----蓝天白云,家里的猫,林里的鸟,愿一切安好。
  • 相关阅读:
    汉语6级试卷(转)
    看《第一滴血4》
    又爱又恨奥沙利文
    最爱“剁椒鱼头”
    中国移动用户请注意长途电话包有陷阱
    推荐一个免费原版KTV / MTV下载网站
    传说中的人品问题
    信息更改致乒乓球爱好者
    贴几张我家乐乐的照片
    Web Parts: From SharePoint to ASP.NET 2.0
  • 原文地址:https://www.cnblogs.com/yuqinweb/p/5474918.html
Copyright © 2020-2023  润新知