gpt4 book ai didi

java - JBoss 上使用 Maven 的 Eclipse Web 应用程序部署问题

转载 作者:行者123 更新时间:2023-12-01 15:48:43 26 4
gpt4 key购买 nike

我有以下 pom.xml(见下文)用于在 JBoss 上构建 Web 应用程序。我像这样运行 Maven:

mvn clean compile war:exploded jboss:hard-undeploy jboss:hard-deploy jboss:start-and-wait


每个目标都运行良好,直到我达到 jboss:start-and-wait goal :\JBoss 拒绝启动。我收到以下错误:

(...)[INFO] [jboss:start-and-wait {execution: default-cli}][INFO] Starting JBoss...[INFO] Waiting to retrieve JBoss JMX MBean connection...[INFO] Waiting to retrieve JBoss JMX MBean connection...[INFO] Waiting to retrieve JBoss JMX MBean connection...[INFO] Waiting to retrieve JBoss JMX MBean connection...[INFO] ------------------------------------------------------------------------[ERROR] BUILD ERROR[INFO] ------------------------------------------------------------------------[INFO] Unable to get JBoss JMX MBean connection: nullorg.jboss.jmx.adaptor.rmi.RMIAdaptor(...)


By activating the DEBUG option on maven, i detected that the root cause is a ClassNotFoundExceptionorg.jboss.jmx.adaptor.rmi.RMIAdaptor. Why do I get this exception since my pom.xmldoes contain org.jboss.jmx.adaptor.rmi.RMIAdaptor in the jmx-adaptor-plugin jar dependency ?Using jboss-all-client jar as dependency gives no more results.

What am I missing ?

Stephan

Configuration


Maven 2.2.1
JBoss 5.1.0.GA
JBoss Maven Plugin 1.5.0

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>foo</artifactId>
<groupId>com.company.foo</groupId>
<version>1.0.0</version>
</parent>
<groupId>com.company.foo</groupId>
<artifactId>foo-webapp</artifactId>
<packaging>war</packaging>
<name>foo-webapp</name>
<version>1.0.0</version>

<dependencies>
<!-- JSF 2.0 -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.3-b02</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.3-b02</version>
</dependency>

<!-- Primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<!-- <version>3.0.M1</version> -->
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>redmond</artifactId>
<version>1.0.0</version>
</dependency>

<!-- Others -->
<dependency>
<groupId>com.company.record</groupId>
<artifactId>record-dao</artifactId>
<version>1.0.0</version>
</dependency>

<!-- Postgresql -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.3-606.jdbc4</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>jboss</groupId>
<artifactId>jmx-adaptor-plugin</artifactId>
<version>3.2.1</version>
</dependency>
</dependencies>

<build>
<finalName>foo.war</finalName>
<plugins>

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<useCache>false</useCache>
<!-- Prevent a bug from plugin (see http://jira.codehaus.org/browse/MWAR-248) -->
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<fileName>${project.build.directory}/${project.build.finalName}</fileName>
<serverName>web</serverName>
</configuration>
</plugin>

</plugins>
</build>
(...)

最佳答案

尝试将其添加到您的插件依赖项中:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<fileName>${project.build.directory}/${project.build.finalName}</fileName>
<serverName>web</serverName>
</configuration>
<dependencies>

<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<type>pom</type>
<version>5.1.0.GA</version>
</dependency>

</dependencies>
</plugin>

关于java - JBoss 上使用 Maven 的 Eclipse Web 应用程序部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6572560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com