开发者社区 问答 正文

maven jetty插件无法启动:配置报错 

jetty启动提示如下信息:
2015-12-07 16:27:09.277:INFO:oejs.Server:jetty-8.1.15.v20140411
2015-12-07 16:27:09.473:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
网上有说提示这个可以不用管,只是启动慢而已,可是我这个是到这里就直接卡死,无法启动了。另有解决方案:添加配置文件jetty-context.xml:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext">  <Call name="setAttribute">  <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>  <Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$</Arg>  </Call> </Configure>
已尝试,无效。 另,启动tomcat6也直接卡死,无错误提示,运行不成功: [INFO] Using existing Tomcat server configuration at E:\Project\ck\ck-web\target\tomcat 十二月 07, 2015 4:42:48 下午 org.apache.catalina.startup.Embedded start 信息: Starting tomcat server 十二月 07, 2015 4:42:48 下午 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.37 到这里就不动了!

求解,求解!
是不是配置的原因,还是有什么明显的配置错误

展开
收起
kun坤 2020-06-02 17:40:26 1020 分享 版权
1 条回答
写回答
取消 提交回答
  • plugin
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>9.3.0.M1</version>
                    <configuration>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <httpConnector>
                            <port>18080</port>
                        </httpConnector>
                        <webAppConfig>
                            <contextPath>/</contextPath>
                        </webAppConfig>
                        <!--<connectors>-->
                        <!--<connector implementation="org.eclipse.jetty.nio.SelectChannelConnector">-->
                        <!--<maxIdleTime>60000</maxIdleTime>-->
                        <!--</connector>-->
                        <!--</connectors>-->
                        <!-- 额外监听目录 -->
                        <!--<contextHandlers>-->
                        <!--<!– 附件目录服务 –>-->
                        <!--<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">-->
                        <!--<contextPath>/design/static/upload/</contextPath>-->
                        <!--<resourceBase>/software/upload/</resourceBase>-->
                        <!--</contextHandler>-->
                        <!--</contextHandlers>-->
                    </configuration>
                </plugin></pre> 
      
       
      
      ######<div class="ref">
     <h4>引用来自“__loong”的评论</h4>
     <pre class="brush:xml; toolbar: true; auto-links: false;"><plugin>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>9.3.0.M1</version>
                    <configuration>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <httpConnector>
                            <port>18080</port>
                        </httpConnector>
                        <webAppConfig>
                            <contextPath>/</contextPath>
                        </webAppConfig>
                        <!--<connectors>-->
                        <!--<connector implementation="org.eclipse.jetty.nio.SelectChannelConnector">-->
                        <!--<maxIdleTime>60000</maxIdleTime>-->
                        <!--</connector>-->
                        <!--</connectors>-->
                        <!-- 额外监听目录 -->
                        <!--<contextHandlers>-->
                        <!--<!– 附件目录服务 –>-->
                        <!--<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">-->
                        <!--<contextPath>/design/static/upload/</contextPath>-->
                        <!--<resourceBase>/software/upload/</resourceBase>-->
                        <!--</contextHandler>-->
                        <!--</contextHandlers>-->
                    </configuration>
                /plugin
    

    问题解决了,配置的内容没有问题,是被日志卡住了,配置jetty-context.xml可以使启动不卡住,但还是会有提示。谢谢! ######怎么设置?jetty-context.xml 我也遇到卡住的问题了######

    plugin
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <configuration>
    
                        <systemProperties>
                            <systemProperty>
                                <name>spring.profiles.active</name>
                                <value>development</value>
                            </systemProperty>
                            <systemProperty>
                                <name>org.mortbay.util.URI.charset</name>
                                <value>UTF-8</value>
                            </systemProperty>
                        </systemProperties>
                        <useTestClasspath>true</useTestClasspath>
                        <webAppConfig>
                            <contextPath>/${project.artifactId}</contextPath>
                            <defaultsDescriptor>${project.basedir}/src/test/resources/webdefault.xml</defaultsDescriptor>
                        </webAppConfig>
                        <reload>automatic</reload>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <contextXml>${project.basedir}/src/test/resources/jetty-context.xml</contextXml>
                        <jvmArgs>-Xms2048m -Xmx2048m -XX:PermSize=2048m -XX:MaxPermSize=2048m -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError
                            -Dfile.encoding=UTF-8</jvmArgs>
                        <connectors>
                            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                                <port>8089</port>
                                <maxIdleTime>60000</maxIdleTime>
                            </connector>
                        </connectors>
                        <stopKey/>
                        <stopPort/>
                    </configuration>
                /plugin
    
    
    2020-06-02 17:40:33
    赞同 展开评论