在glassfish部署过程中发生错误 - 此处没有默认名称的Web组件 [英] Error occurred during glassfish deployment - There is no web component by the name of default here

查看:256
本文介绍了在glassfish部署过程中发生错误 - 此处没有默认名称的Web组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次用Maven在Glassfish服务器上部署Web应用程序。

This is my first time to deploy web application on a Glassfish Server with Maven.

我一步步执行以下maven目标:

I execute the following maven goals step by step:


  1. mvn glassfish:create-domain -P glassfish

  2. mvn glassfish:start-domain -P glassfish

  3. mvn glassfish:deploy -P glassfish

  1. mvn glassfish:create-domain -P glassfish
  2. mvn glassfish:start-domain -P glassfish
  3. mvn glassfish:deploy -P glassfish

一切都很顺利,直到第三步( glassfish:deploy )并且错误消息是:

Everything goes fine until the third step (glassfish:deploy) and the error message is

[ERROR] remote failure: Error occurred during deployment: Exception while deploying the app [herald-web-services] : There is no web component by the name of default here.. Please see server.log for more details.
[ERROR] Deployment of /Users/Ray/workspace/herald-web-services/target/herald-web-services-1.1-SNAPSHOT.war failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option 
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".

这里是我的 pom.xml

<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.glassfish.maven.plugin</groupId>
                <artifactId>maven-glassfish-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <glassfishDirectory>${glassfish.home}</glassfishDirectory>
                    <user>${domain.user}</user>
                    <adminPassword>${domain.password}</adminPassword>
                    <passwordFile>${glassfish.home}/domains/${project.artifactId}/config/domain-passwords</passwordFile>
                    <autoCreate>true</autoCreate>
                    <debug>true</debug>
                    <echo>true</echo>
                    <skip>${test.int.skip}</skip>
                    <domain>
                        <name>${project.artifactId}</name>
                        <adminPort>4848</adminPort>
                        <httpPort>8080</httpPort>
                        <httpsPort>8443</httpsPort>
                        <iiopPort>3700</iiopPort>
                        <jmsPort>7676</jmsPort>
                    </domain>
                    <components>
                        <component>
                            <name>${project.artifactId}</name>
                            <artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
                        </component>
                    </components>
                </configuration>
            </plugin>
        </plugins>
    </build>
...
</project>

settings.xml

<profile>
   <id>glassfish</id>
   <properties>
     <glassfish.home>/Users/Ray/glassfish3</glassfish.home>
     <domain.user>admin</domain.user>
     <domain.password>changeit</domain.password>
     <test.int.skip>true</test.int.skip>
   </properties>
 </profile>

pom.xml 或在Glassfish配置?

Do I miss something in my pom.xml or in Glassfish configuration?

推荐答案


我忘了从 web.xml 中远程默认的 servlet映射,这是一个Tomcat规范。 。

The problem is solved. I forget to remote the default servlet mapping, which is a Tomcat specification, from the web.xml.

以下是代码片段:

Here is the snippet,

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/doc/*</url-pattern>
</servlet-mapping>

通过删除这个servlet映射,它可以工作。

By removing this servlet mapping, it works.

这篇关于在glassfish部署过程中发生错误 - 此处没有默认名称的Web组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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