这是我第一次用Maven在Glassfish服务器上部署web应用程序。
我一步一步地执行以下maven目标:
mvn glassfish:create-domain -P glassfishmvn glassfish:start-domain -P glassfishmvn glassfish:deploy -P glassfish在第三步(glassfish:deploy)之前,一切都进行得很好,错误消息是
[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或玻璃鱼配置中,我是遗漏了什么吗?
发布于 2013-05-12 08:19:35
问题解决了。我忘记将Tomcat规范的default servlet映射从web.xml中删除。
这是片段,
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/doc/*</url-pattern>
</servlet-mapping>通过删除这个servlet映射,它可以工作。
https://stackoverflow.com/questions/16505321
复制相似问题