我start-domain domain1 --debug=true
从 glassfish(顶级 glassfish 文件夹)/bin 文件夹中的 asadmin 脚本启动 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>