但行好事
莫论前程❤

Maven使用jetty插件运行报错 ClassNotFoundException:JspApplicationContextImpl

环境

windows8.1
maven 3.5.2

pom.xml文件中配置jetty插件

<!-- jetty插件 -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.25</version>
                <configuration>
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>8000</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                    <contextPath>/bbs</contextPath>
                    <scanIntervalSeconds>0</scanIntervalSeconds>
                </configuration>
            </plugin>

报错

[WARNING] failed SelectChannelConnector@0.0.0.0:8000: java.net.BindException: Address already in use: bind
[WARNING] failed Server@75b3673: java.net.BindException: Address already in use: bind
[INFO] Jetty server exiting.

...

Exception in thread "Shutdown" java.lang.NoClassDefFoundError: org/apache/jasper/runtime/JspApplicationContextImpl
...
Caused by: java.lang.ClassNotFoundException: org.apache.jasper.runtime.JspApplicationContextImpl

原因:端口号被占用,经过查看占用端口发现,8000端口被酷狗的KGService.exe进程占用

将端口号改成8080就可以啦

启动成功

[INFO] Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
赞(0) 打赏
未经允许不得转载:刘鹏博客 » Maven使用jetty插件运行报错
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏