我从glassfish(toplevel glassfish文件夹)/ bin文件夹中的asadmin脚本启动带有start-domain domain1 --debug=true
的glassfish。然后我使用重新部署目标,它工作约1-2次然后出现以下错误是否可以解决这个问题?这就像服务器正在关闭。我也使用JRebel。
[INFO] --- maven-glassfish-plugin:2.1:redeploy (default-cli) @ MyApp ---
Downloading: http://maven.ocean.net.au/release/org/apache/maven/maven-plugin-api/maven-metadata.xml
Downloading: http://download.java.net/maven/2/org/apache/maven/maven-plugin-api/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/maven-metadata.xml
Downloading: http://maven.ocean.net.au/external/org/apache/maven/maven-plugin-api/maven-metadata.xml
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/maven-metadata.xml (2 KB at 5.6 KB/sec)
Downloading: http://maven.ocean.net.au/snapshot/org/apache/maven/maven-plugin-api/maven-metadata.xml
Downloading: http://download.java.net/maven/2/org/apache/maven/maven-plugin-api/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to release.ocean.net.au (http://maven.ocean.net.au/release): maven.ocean.net.au
[WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to external.ocean.net.au (http://maven.ocean.net.au/external): maven.ocean.net.au
[WARNING] Could not transfer metadata org.apache.maven:maven-plugin-api/maven-metadata.xml from/to snapshot.ocean.net.au (http://maven.ocean.net.au/snapshot): maven.ocean.net.au
[INFO] No such local command, undeploy. To run remote commands, start the application server (e.g. 'asadmin start-domain').
[ERROR] 'JAVA_OPTS' is not recognized as an internal or external command,
[ERROR] operable program or batch file.
[ERROR] Remote server does not listen for requests on [localhost:4848]. Is the server up?
[ERROR] Undeployment of MyApp 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中配置此配置:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<glassfish.home>${env.GLASSFISH_HOME}</glassfish.home>
<glassfish.directory>${glassfish.home}/glassfish</glassfish.directory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
<domain>
<name>domain1</name>
<adminPort>4848</adminPort>
<httpPort>8080</httpPort>
<httpsPort>8443</httpsPort>
</domain>
<glassfishDirectory>${glassfish.home}</glassfishDirectory>
<passwordFile>${glassfish.directory}/domains/domain1/config/domain-passwords</passwordFile>
<user>admin</user>
</configuration>
</plugin>
</plugins>
</build>