启动GlassFish 4.x时货物挂起,耗尽100%CPU

时间:2013-11-04 17:00:28

标签: maven glassfish glassfish-4 cargo maven-cargo

尝试使用Maven Cargo插件而不是不支持热重新部署的Maven GlassFish插件。 Cargo挂起目标开始/运行GlassFish本地现有安装并吃掉高达100%的CPU,直到我杀了它!我尝试使用纯文本密码,然后创建了一个密码文件,结果相同。在线搜索使用各种Cargo-GlassFish配置发布帖子,几乎所有这些都比我使用的版本旧,并且也没有帮助。 附加了Maven插件配置和调试日志。任何帮助表示赞赏。

Environment: Mac OS X Mavericks, Oracle JDK 1.7.0_45, GlassFish-4.0-b89, Maven 3.1.1, cargo-maven2-plugin 1.4.5

Maven插件配置

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.4.5</version>
  <configuration>
    <container>
      <containerId>glassfish4x</containerId>
      <type>installed</type>
      <output>${glassfish.installDirectory}/glassfish/domains/${glassfish.domainName}/logs/server.log</output>
      <!-- Fail if not started/stopped within 30 sec -->
      <timeout>30000</timeout>
    </container>
    <configuration>
      <type>existing</type>
      <home>${glassfish.installDirectory}/glassfish</home>
      <properties>
        <cargo.glassfish.domain.name>${glassfish.domainName}</cargo.glassfish.domain.name>
        <cargo.remote.username>${glassfish.adminUser}</cargo.remote.username>
        <cargo.remote.passwordFile>${glassfish.installDirectory}/admin.password</cargo.remote.passwordFile>
        <!-- Maven sets java.home property to JRE but we want JDK -->
      </properties>
    </configuration>
    <deployables>
      <deployable>
        <groupId>${project.groupId}</groupId>
        <artifactId>${project.artifactId}</artifactId>
        <type>${project.packaging}</type>
        <properties>
          <context>/${project.artifactId}</context>
        </properties>
      </deployable>
    </deployables>
  </configuration>
</plugin>

调试日志

[DEBUG] [2.ContainerStartMojo] Resolved artifact and dependencies:file:/Users/Abhijit/Repositories/maven/org/codehaus/cargo/cargo-core-container-glassfish/1.4.5/cargo-core-container-glassfish-1.4.5.jar]
[INFO] [2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.4.5 for container glassfish4x
[DEBUG] Scheduling deployable for deployment: [groupId [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId [calculator-enc], type [war], location [null], pingURL [null]]
[DEBUG] Initial deployable values: groupId = [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId = [calculator-enc], type = [war], location = [null]
[DEBUG] Searching for an artifact that matches [name.abhijitsarkar.learning.webservices.jaxws.security:calculator-enc:war:null]...
[DEBUG] Checking artifact [name.abhijitsarkar.learning.webservices.jaxws.security:calculator-enc:war:null]...
[DEBUG] Computed deployable values: groupId = [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId = [calculator-enc], classifier = [null], type = [war], location = [/Users/Abhijit/Repositories/git/java-ee/jaxws-security/calculator-enc/target/calculator-enc-0.0.1-SNAPSHOT.war]
[DEBUG] Setting deployable property [context]:[/calculator-enc] for [/Users/Abhijit/Repositories/git/java-ee/jaxws-security/calculator-enc/target/calculator-enc-0.0.1-SNAPSHOT.war]
[DEBUG] Invoking setter method public synchronized void org.codehaus.cargo.container.deployable.WAR.setContext(java.lang.String) for deployable org.codehaus.cargo.container.deployable.WAR[calculator-enc-0.0.1-SNAPSHOT.war] with argument /calculator-enc
[DEBUG] Setting container timeout to [30000]

1 个答案:

答案 0 :(得分:3)

对于可能遇到此问题的其他人,我花了两天时间通过Cargo src代码进行调试以找出问题所在。实际上两个<home>位置都是必需的。 <container>下的那个应指向GlassFish外部安装目录(其中包含另一个glassfish目录),<configuration>下的那个应该指向glassfish / domains目录。 有没有人曾向他们提到命名惯例很糟糕?为什么不调用后来的'<home>' <domainsDir>或其他实际意味着它的内容?