English 中文(简体)
A. 多层层楼 Maven Web app withjetty, HTTP ERROR: 503 SERVICE_UNAVAILABLE
原标题:Running a multi-module Maven web app with Jetty, HTTP ERROR: 503 SERVICE_UNAVAILABLE

我有一个多功能的Maven网,我想用喷气机在Eclipse上运行。 我读了几门辅导(,,我试图读出。

我认为,需要做的一切是,在我的春季网络模块的<代码>pom.xm上添加原始和附属物,然后在<代码>mvn jetty:run的帮助下(在M Spring Maven模块的网络中)运行,并能够看到浏览器中的成果。 因此,第一个问题是:我是否必须做其他事情(例如,在<代码>web.xml文档中)?

EDIT: I also had to add <pluginGroup>org.mortbay.jetty</pluginGroup> in Maven s settings.xml to start server without errors.

我收到<代码>。 HTTP ERROR: 503 SERVICE_UNAVAILABLE。 可能的原因是什么? 我是否需要更多的依赖者,还是要补充其他东西? 提前感谢。

最佳回答

根据杰蒂特试图启动时所写的内容,我不得不补充MySql的依赖。 备有<条码> HTTP ERROR: 503 SERVICE_UNAVAILABLE 失踪。

这里是我项目一的春季网络模块pom.xml的一部分,该模块又使用Jety(如果有人需要的话)。 也许,我可以删除这一条码中的内容。 部分,我只字不提:

  <build>

      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.0</version>
        </plugin>  

        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.14</version>
            <configuration>
                <connectors>
                    <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                        <port>9090</port>
                        <maxIdleTime>60000</maxIdleTime>
                    </connector>
                </connectors>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
     </plugins>

  </build>

  <properties>
      <org.springframework.version>3.1.0.RELEASE</org.springframework.version>
      <jetty.version>6.1.14</jetty.version>
  </properties>

  <dependencies>
    <!-- In my case Jetty needs this one to run -->   
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.6</version>
    </dependency>        
    <!-- Jetty dependencies -->
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
        <version>${jetty.version}</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-util</artifactId>
        <version>${jetty.version}</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-plus</artifactId>
        <version>${jetty.version}</version>
        <type>jar</type>
    </dependency>
    <!--The 2 following are the jsp support for jetty -->
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jsp-2.1</artifactId>
        <version>${jetty.version}</version>
        <type>jar</type>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jsp-api-2.1</artifactId>
        <version>${jetty.version}</version>
        <type>jar</type>
    </dependency> 
问题回答

首先,你们还需要在通常的建筑部分,而不仅仅是在原始管理区添加gin。

  <project ...>

    <build>
       <plugins>
          <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
          </plugin>
          ...
       </plugins>
..
    </build>
  </project>

此外,我建议你更新maven-site-plugin,使你使用一个极为老的节目。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签