java Glassfish 服务器未连接。部署不可用智能
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30147482/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Glassfish Server is not connected. Deploy is not available intelliJ
提问by jsky
I don't know why, but my glassfish server wont connect anymore.
Last night i opened up Netbeans, and pointed it to same gf (homebrew), to look at example EE apps. I didnt even endup running them, just looked at code.
This was whilst i was working on a project in intelliJ where everything was working. Later it seemed that gf stopped connecting properly in my project in iJ.
I made code changes but nothing that would stop the server starting.
I just created another blank EE project with GF server and i get the same result.
Ive checked my hosts file:
我不知道为什么,但是我的 glassfish 服务器无法再连接了。
昨晚我打开了 Netbeans,并将其指向同一个 gf(自制软件),以查看示例 EE 应用程序。我什至没有最终运行它们,只是看着代码。
那是我在 intelliJ 中从事一个项目时,一切都在工作。后来似乎 gf 在我的 iJ 项目中停止了正确连接。我进行了代码更改,但没有任何可以阻止服务器启动的内容。
我刚刚用 GF 服务器创建了另一个空白的 EE 项目,我得到了相同的结果。我检查了我的主机文件:
127.0.0.1 localhost computer.name
#127.0.0.1 ghconduit.com
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
My hostname for some reason is set to my computer/network name: 'computer.ispname`. This seemed to be a problem for me creating a project in Eclipse but when i moved to iJ it wasnt. But maybe it is again. I can ping and it seems to resolve fine:
由于某种原因,我的主机名设置为我的计算机/网络名称:“computer.ispname”。这对我在 Eclipse 中创建项目来说似乎是一个问题,但是当我搬到 iJ 时它不是。但也许它又来了。我可以 ping 并且似乎解决得很好:
jm:~ jsky$ ping computer.name
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.059 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.060 ms
But not on port 4848:
但不是在端口 4848 上:
Application Server was not connected before run configuration stop, reason:
Unable to ping server at localhost:4848
Application Server was not connected before run configuration stop, reason:
Unable to ping server at localhost:4848
lsof -i:4848
jm:~ jsky$ ping localhost:4848
ping: cannot resolve localhost:4848: Unknown host
When running:
运行时:
jm:~ jsky$ lsof -i:4848
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
idea 941 jsky 105u IPv4 0x45cc6637d4636f39 0t0 TCP localhost:50790->localhost:appserv-http (ESTABLISHED)
java 1449 jsky 379u IPv6 0x45cc6637ce5b8619 0t0 TCP *:appserv-http (LISTEN)
java 1449 jsky 387u IPv6 0x45cc6637ce5b5fd9 0t0 TCP localhost:appserv-http->localhost:50790 (ESTABLISHED)
jm:~ jsky$ ping localhost:4848
ping: cannot resolve localhost:4848: Unknown host
I had a publisher and subscriber working through a jms topic, and now the server doesnt start and i need to complete this assignment ASAP. Ive even tried restoring my machine to a previous snapshot with time machine and still get the same error. It tells me that there is another process using the same port 4848.But i dont know where (the extra) process is coming from. Any ideas? I am going to try starting on another domain once i workout how.
我有一个发布者和订阅者正在处理一个 jms 主题,现在服务器没有启动,我需要尽快完成这个任务。我什至尝试使用时间机器将我的机器恢复到以前的快照,但仍然出现相同的错误。 它告诉我有另一个进程使用相同的端口 4848。但我不知道(额外的)进程来自哪里。有任何想法吗?一旦我锻炼了如何,我将尝试从另一个域开始。
Startup log shows connections that i thought were correct:Grizzly Framework 2.3.15 started in: 16ms - bound to [/0.0.0.0:4848]]]
...
Created HTTP listener admin-listener on host/port 0.0.0.0:4848|#]
启动日志显示我认为正确的连接:Grizzly Framework 2.3.15 started in: 16ms - bound to [/0.0.0.0:4848]]]
...
Created HTTP listener admin-listener on host/port 0.0.0.0:4848|#]
Rest of startup log shows:
启动日志的其余部分显示:
[2015-05-10T13:03:51.400+1000] [] [INFO] [NCLS-GFLAUNCHER-00005] [javax.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1431227031400] [levelValue: 800] [[
JVM invocation command line:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java
-cp
/usr/local/Cellar/glassfish/4.1/libexec/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-Xmx512m
-javaagent:/usr/local/Cellar/glassfish/4.1/libexec/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djavax.xml.accessExternalSchema=all
-Djavax.net.ssl.trustStore=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1/config/cacerts.jks
-Djdk.corba.allowOutputStreamSubclass=true
-Dfelix.fileinstall.dir=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/modules/autostart/
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall
-Dcom.sun.aas.installRoot=/usr/local/Cellar/glassfish/4.1/libexec/glassfish
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/modules/endorsed:/usr/local/Cellar/glassfish/4.1/libexec/glassfish/lib/endorsed
-Djava.security.policy=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1/config/server.policy
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.bundles.startTransient=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dfelix.fileinstall.log.level=2
-Djavax.net.ssl.keyStore=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1/config/keystore.jks
-Djava.security.auth.login.config=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1/config/login.conf
-Dfelix.fileinstall.disableConfigSave=false
-Dfelix.fileinstall.bundles.new.start=true
-Dcom.sun.aas.instanceRoot=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1
-Dosgi.shell.telnet.port=6666
-Dgosh.args=--nointeractive
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Dosgi.shell.telnet.ip=127.0.0.1
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.awt.headless=true
-Dcom.ctc.wstx.returnNullForDefaultNamespace=true
-Djava.ext.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/lib/ext:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/ext:/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1/lib/ext
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djava.library.path=/usr/local/Cellar/glassfish/4.1/libexec/glassfish/lib:/Users/jsky/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:/usr/local/Cellar/glassfish/4.1/libexec/glassfish/bin
com.sun.enterprise.glassfish.bootstrap.ASMain
-upgrade
false
-domaindir
/usr/local/Cellar/glassfish/4.1/libexec/glassfish/domains/domain1
-read-stdin
true
-asadmin-args
[2015-05-10T13:03:59.919+1000] [glassfish 4.1] [INFO] [NCLS-LOGGING-00009] [javax.enterprise.logging] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227039919] [levelValue: 800] [[
Running GlassFish Version: GlassFish Server Open Source Edition 4.1 (build 13)]]
[2015-05-10T13:03:59.931+1000] [glassfish 4.1] [INFO] [NCLS-LOGGING-00010] [javax.enterprise.logging] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227039931] [levelValue: 800] [[
Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter]]
[2015-05-10T13:04:01.301+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01115] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227041301] [levelValue: 800] [[
Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.]]
[2015-05-10T13:04:01.305+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01115] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227041305] [levelValue: 800] [[
Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.]]
[2015-05-10T13:04:01.315+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01115] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227041315] [levelValue: 800] [[
Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.]]
[2015-05-10T13:04:02.785+1000] [glassfish 4.1] [INFO] [SEC-SVCS-00100] [javax.enterprise.security.services] [tid: _ThreadID=17 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227042785] [levelValue: 800] [[
Authorization Service has successfully initialized.]]
[2015-05-10T13:04:03.045+1000] [glassfish 4.1] [INFO] [] [org.glassfish.ha.store.spi.BackingStoreFactoryRegistry] [tid: _ThreadID=17 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227043045] [levelValue: 800] [[
Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry]]
[2015-05-10T13:04:03.725+1000] [glassfish 4.1] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227043725] [levelValue: 800] [[
Grizzly Framework 2.3.15 started in: 206ms - bound to [/0.0.0.0:8080]]]
[2015-05-10T13:04:03.865+1000] [glassfish 4.1] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227043865] [levelValue: 800] [[
Grizzly Framework 2.3.15 started in: 4ms - bound to [/0.0.0.0:8181]]]
[2015-05-10T13:04:03.907+1000] [glassfish 4.1] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227043907] [levelValue: 800] [[
Grizzly Framework 2.3.15 started in: 16ms - bound to [/0.0.0.0:4848]]]
[2015-05-10T13:04:04.058+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227044058] [levelValue: 800] [[
visiting unvisited references]]
[2015-05-10T13:04:04.143+1000] [glassfish 4.1] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1431227039604] [timeMillis: 1431227044143] [levelValue: 800] [[
Grizzly Framework 2.3.15 started in: 8ms - bound to [/0.0.0.0:3700]]]
[2015-05-10T13:04:05.812+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01002] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227045812] [levelValue: 800] [[
Java security manager is disabled.]]
[2015-05-10T13:04:05.813+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01010] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227045813] [levelValue: 800] [[
Entering Security Startup Service.]]
[2015-05-10T13:04:05.833+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01143] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227045833] [levelValue: 800] [[
Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.]]
[2015-05-10T13:04:06.489+1000] [glassfish 4.1] [INFO] [NCLS-SECURITY-01011] [javax.enterprise.system.core.security] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227046489] [levelValue: 800] [[
Security Service(s) started successfully.]]
[2015-05-10T13:04:08.095+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00198] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227048095] [levelValue: 800] [[
Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080]]
[2015-05-10T13:04:08.112+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00198] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227048112] [levelValue: 800] [[
Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181]]
[2015-05-10T13:04:08.123+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00198] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227048123] [levelValue: 800] [[
Created HTTP listener admin-listener on host/port 0.0.0.0:4848]]
[2015-05-10T13:04:08.237+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00200] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227048237] [levelValue: 800] [[
Created virtual server server]]
[2015-05-10T13:04:08.246+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00200] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227048246] [levelValue: 800] [[
Created virtual server __asadmin]]
[2015-05-10T13:04:09.312+1000] [glassfish 4.1] [INFO] [AS-WEB-CORE-00306] [javax.enterprise.web.core] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227049312] [levelValue: 800] [[
Setting JAAS app name glassfish-web]]
[2015-05-10T13:04:09.315+1000] [glassfish 4.1] [INFO] [AS-WEB-GLUE-00201] [javax.enterprise.web] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227049315] [levelValue: 800] [[
Virtual server server loaded default web module ]]
[2015-05-10T13:04:13.211+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227053211] [levelValue: 800] [[
visiting unvisited references]]
[2015-05-10T13:04:13.219+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227053219] [levelValue: 800] [[
visiting unvisited references]]
[2015-05-10T13:04:16.235+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.resource.jms] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227056235] [levelValue: 800] [[
addresslist.setjmsservice.provider]]
[2015-05-10T13:04:16.235+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.resource.jms] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227056235] [levelValue: 800] [[
jms.connection.url]]
[2015-05-10T13:04:17.390+1000] [glassfish 4.1] [INFO] [NCLS-JMX-00005] [javax.enterprise.system.jmx] [tid: _ThreadID=54 _ThreadName=Thread-13] [timeMillis: 1431227057390] [levelValue: 800] [[
JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://computer.name:8686/jndi/rmi://computer.name:8686/jmxrmi]]
[2015-05-10T13:04:18.225+1000] [glassfish 4.1] [INFO] [] [org.hibernate.validator.internal.util.Version] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227058225] [levelValue: 800] [[
HV000001: Hibernate Validator 5.0.0.Final]]
[2015-05-10T13:04:19.851+1000] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.monitor] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227059851] [levelValue: 800] [[
Successfully got INSTRUMENTATION: sun.instrument.InstrumentationImpl@4017f2ce]]
[2015-05-10T13:04:20.140+1000] [glassfish 4.1] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227060140] [levelValue: 800] [[
Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:7676]]]
[2015-05-10T13:04:20.153+1000] [glassfish 4.1] [INFO] [] [javax.resourceadapter.mqjmsra.lifecycle] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227060153] [levelValue: 800] [[
MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version: 5.1 (Build 9-b) Compile: July 29 2014 1229]]
[2015-05-10T13:04:20.155+1000] [glassfish 4.1] [INFO] [] [javax.resourceadapter.mqjmsra.lifecycle] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227060155] [levelValue: 800] [[
MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting: broker is EMBEDDED, connection mode is Direct]]
[2015-05-10T13:04:24.069+1000] [glassfish 4.1] [INFO] [] [javax.resourceadapter.mqjmsra.lifecycle] [tid: _ThreadID=18 _ThreadName=RunLevelControllerThread-1431227039629] [timeMillis: 1431227064069] [levelValue: 800] [[
MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter Started:EMBEDDED]]
And here is the log of the server failing to connect:
这是服务器连接失败的日志:
/usr/local/Cellar/glassfish/4.1/libexec/glassfish/bin/asadmin start-domain domain1
[2015-05-10 01:03:49,582] Artifact AdminAuditingConsole:war exploded: Server is not connected. Deploy is not available.
Detected server admin port: 4848
[2015-05-10 01:03:49,584] Artifact EEApp:war exploded: Server is not connected. Deploy is not available.
Detected server http port: 8080
Waiting for domain1 to start .......................................................................................................................................
回答by jsky
The domain.xml was most likely altered by Netbeans and no longer correct.
The solution was to first kill all processes using the admin port (4848) as @Jarrod Robertson's answer suggested, and then remove the domain (delete the whole folder) and remake it: ./asadmin create-domain domain1
domain.xml 很可能被 Netbeans 更改,不再正确。
解决方案是首先按照@Jarrod Robertson 的回答建议使用管理端口 (4848) 终止所有进程,然后删除域(删除整个文件夹)并重新创建它:./asadmin create-domain domain1
回答by S34N
Check the Credentials
检查凭据
Check to see if the username/password for deploying the web-app are correct. Use the username/password you use to log into the web-server.
检查部署 web-app 的用户名/密码是否正确。使用您用来登录网络服务器的用户名/密码。
On IntelliJ:
在 IntelliJ 上:
Edit Configurations >> "Select the web-sever" >> "correct the username/password"
编辑配置>>“选择网络服务器”>>“更正用户名/密码”
回答by S34N
Kill the process holding 4848
杀死持有 4848 的进程
kill $(ps aux | grep 'java' | awk '{print }')
That will find and kill all the java
processes on your system.
这将找到并杀死java
系统上的所有进程。
You can replace java
with something more specific to the glassfish instance that is hung on that port.
您可以替换java
为挂在该端口上的 glassfish 实例更具体的内容。