标题:求助java.lang.NoClassDefFoundError怎么解决,报错信息如下
取消只看楼主
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 13楼 疯狂的小a
请问下是在maven的pom中添加,还是web得那里

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:39
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 15楼 疯狂的小a
[local]1[/local]我加到最后了更新重运行还是报错

程序代码:
四月 14, 2018 11:41:43 上午 org.apache.catalina.startup.Embedded start
信息: Starting tomcat server
四月 14, 2018 11:41:43 上午 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.29
四月 14, 2018 11:41:43 上午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class com.enation.eop.sdk.listener.EopSessionListener
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at com.enation.eop.sdk.listener.EopSessionListener.<init>(EopSessionListener.java:19)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4079)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
    ... 36 more

四月 14, 2018 11:41:43 上午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
四月 14, 2018 11:41:43 上午 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
四月 14, 2018 11:41:43 上午 org.apache.catalina.core.StandardContext start
严重: Context [/b2c] startup failed due to previous errors
四月 14, 2018 11:41:43 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/b2c] registered the JBDC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:44
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 15楼 疯狂的小a

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:45
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 18楼 疯狂的小a
好的,已经删除了

[此贴子已经被作者于2018-4-14 11:49编辑过]


有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:48
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 18楼 疯狂的小a
昨天发给我的源码包,让我部署运行环境,我装了eclipse,maven,tomcat,mysql,操作系统是macos,请问会不会是我的配置有问题呢?tomcat本地可以访问,maven安装后也显示成功,mysql安装了可以连接,但是我不清楚哪里出问题了

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:54
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 20楼 疯狂的小a
程序代码:
<?xml version="1.0"?>
<project
        xsi:schemaLocation="http://maven. http://maven. xmlns:xsi="http://www. <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.enation.app.javashop</groupId>
        <artifactId>javashop</artifactId>
        <version>6.3.1</version>
        <relativePath>../</relativePath>
    </parent>
    <artifactId>b2c</artifactId>
    <packaging>war</packaging>
    <name>b2c Maven Webapp</name>
    <url>http://maven.

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.html</include>
                    <include>**/*.css</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>

        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.css</include>
                    <include>**/*.html</include>
                </includes>
            </testResource>
        </testResources>
        <defaultGoal>compile</defaultGoal>
        <finalName>b2c</finalName>
    </build>

    <dependencies>

        <!-- 测试框架依赖 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>


        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4-rule-agent</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-classloading-objenesis</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jmock</groupId>
            <artifactId>jmock-junit4</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jmockit</groupId>
            <artifactId>jmockit</artifactId>
        </dependency>

        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
        </dependency>

        <!-- Javashop 工程依赖 -->
        <dependency>
            <groupId>com.enation.app.javashop</groupId>
            <artifactId>core</artifactId>
            <version>6.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.enation.app.javashop</groupId>
            <artifactId>shop-core</artifactId>
            <version>6.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.enation.app.javashop</groupId>
            <artifactId>cms-core</artifactId>
            <version>6.3.1</version>
        </dependency>

        <!-- 短信网关 -->
        <dependency>
            <groupId>com.enation.app.javashop</groupId>
            <artifactId>zt-sms</artifactId>
            <version>6.3.1</version>
        </dependency>
        <!-- 微信组件 -->
        <dependency>
            <groupId>com.enation.app.javashop</groupId>
            <artifactId>weixin</artifactId>
            <version>6.3.1</version>
        </dependency>

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


    </dependencies>
</project>

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 11:55
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
helphelp
help me

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 12:51
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 24楼 疯狂的小a
没看见有日志的包,不明白什么是冲突,问别人说少log4j的包,可是lib文件夹下有呀,现在一头雾水的,唉,第一次搭建运行环境都出问题,

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 14:29
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
这真是第一次接触让我工作,第一天前两个小时发蒙,完全不知道做什么,然后下载软件,安装又出问题,到晚上才算完成,这是第二天,还没有运行完成,我真怀疑我是不是不适合做这个呀

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 14:34
tianchengtop
Rank: 2
等 级:论坛游民
帖 子:37
专家分:10
注 册:2017-9-22
得分:0 
回复 24楼 疯狂的小a
请问一下maven项目运行是不是现在maven中pom.xml :maven install,然后在web那个模块pom.xml那里maven build,我这个顺序对吧

有梦想,我还有梦想,要提醒自己还有梦(ˇˍˇ) 想~
2018-04-14 14:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-486061-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.092619 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved