• java.lang.NoClassDefFoundError: ognl/PropertyAccessor


    本篇对 Web 开发中,项目部署后、开启 Tomcat 服务器 Console 控制台报错 java.lang.NoClassDefFoundError: ognl/PropertyAccessor 进行分析,并将解决方法记录如下:

    一、异常描述:

      1 java.lang.NoClassDefFoundError: ognl/PropertyAccessor
      2 	at
      3 com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer
      4 (DefaultConfiguration.java:318)
      5 	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer
      6 (DefaultConfiguration.java:221)
      7 	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
      8 (ConfigurationManager.java:67)
      9 	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration
     10 (Dispatcher.java:446)
     11 	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
     12 	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher
     13 (InitOperations.java:74)
     14 	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init
     15 (StrutsPrepareAndExecuteFilter.java:57)
     16 	at org.apache.catalina.core.ApplicationFilterConfig.initFilter
     17 (ApplicationFilterConfig.java:279)
     18 	at org.apache.catalina.core.ApplicationFilterConfig.getFilter
     19 (ApplicationFilterConfig.java:260)
     20 	at org.apache.catalina.core.ApplicationFilterConfig.<init>
     21 (ApplicationFilterConfig.java:105)
     22 	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
     23 	at org.apache.catalina.core.StandardContext.startInternal
     24 (StandardContext.java:5602)
     25 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
     26 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
     27 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
     28 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
     29 	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
     30 	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
     31 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
     32 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     33 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
     34 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
     35 	at java.lang.Thread.run(Thread.java:745)
     36 Caused by: java.lang.ClassNotFoundException: ognl.PropertyAccessor
     37 	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass
     38 (WebappClassLoaderBase.java:1858)
     39 	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass
     40 (WebappClassLoaderBase.java:1701)
     41 	... 23 more

    二、错误分析:缺少 ognl 的 jar 包,无法找到类 ognl/PropertyAccessor。

    三、解决方法:ognl/PropertyAccessor 的 class 字节码文件在 ognl 的 jar 包下,将 ognl 的 jar 包导入即可。

  • 相关阅读:
    导出PDF乱码
    C/S模式下的打印方法
    填报表导出excel后不可写的单元格处于锁定状态
    多表批量导出txt及打压缩包下载
    客户端定时自动打印页面的例子
    套打中的自定义纸张设置
    linux客户端打印报表时操作系统的配置
    大数据量报表APPLET打印分页传输方案
    Python中类的定义及使用
    Solr7.7高级应用【MLT相似文档搜索、自动补全、自动纠错】
  • 原文地址:https://www.cnblogs.com/justlove/p/6822948.html
Copyright © 2020-2023  润新知