java.lang.NoClassDefFoundError:javax / servlet / ServletContextListener错误 [英] java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener error

查看:3410
本文介绍了java.lang.NoClassDefFoundError:javax / servlet / ServletContextListener错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我的动态web应用程序在struts1春季和休眠集成是在64位机器上开发的..它在64位机器上运行良好,但在32位机器上给予jar问题,它给出了以下错误:

  SEVERE:配置类org.springframework.web.context.ContextLoaderListener的应用程序侦听器时出错
java.lang.NoClassDefFoundError:javax / servlet / ServletContextListener
在java.lang.ClassLoader.findBootstrapClass(本地方法)

  SEVERE:配置类org.springframework.web.util.Log4jConfigListener的应用程序侦听器时出错
java.lang.NoClassDefFoundError:javax / servlet / ServletContextListener
at java.lang.ClassLoader.findBootstrapClass(Native Method)

我应该将所有jar 32位机器?

解决方案

当我试图编译一个项目没有servlet的依赖,如果你使用maven,把javax.servlet放到pom.xml中。

 < dependency> 
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 3.0.1< / version>
< scope>提供< / scope>
< /依赖关系>

如果知道版本目标并且范围是,您可以将版本更改为另一个版本因为很可能你会使用tomcat或者其他类型的服务器,这些服务器已经包含了实现。如果你不使用maven,那么你可以下载这个。 jar并添加到您的projet的lib文件夹中。

Hi my dynamic web application in struts1 spring and hibernate integration is developed on 64 bit machine..Its running fine on 64 bit machine but giving jar issues on 32 bit machine its giving following error

    SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
    at java.lang.ClassLoader.findBootstrapClass(Native Method)

and

    SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
    at java.lang.ClassLoader.findBootstrapClass(Native Method)

should i change all jars for 32 bit machine?

解决方案

I had some similar problem in when i tried to compile one project without the servlet dependancy, if you use maven put the javax.servlet in the pom.xml

<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
</dependency>

You can change the version to another if you know the version target and the scope is provided because is probably that you will use tomcat or another type of server, that contain already the implementation

Or if you not use maven, you can download the .jar and add to the lib folder of your projet

这篇关于java.lang.NoClassDefFoundError:javax / servlet / ServletContextListener错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆