Eclipse 上的 Glassfish 4 - 超时 - java.util.concurrent.TimeoutException

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29272101/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:31:09  来源:igfitidea点击:

Glassfish 4 on Eclipse - times out - java.util.concurrent.TimeoutException

javaeclipseglassfishtimeoutexception

提问by pelagos

I am having troubles getting a Glassfish server to actually start and stay running on an Eclipse (luna) install.

我在让 Glassfish 服务器实际启动并在 Eclipse (luna) 安装上保持运行时遇到了麻烦。

I have had Glassfish working fine in Netbeans.

我让 Glassfish 在 Netbeans 中运行良好。

I have created the server in Eclipse and I can start it but the progress bar gets to about 69% then stops and eventual give me an error:

我已经在 Eclipse 中创建了服务器,我可以启动它,但进度条到达大约 69% 然后停止并最终给我一个错误:

Unable to start server on time. java.util.concurrent.TimeoutException

无法按时启动服务器。java.util.concurrent.TimeoutException

The strange thing is that while I am waiting for the error to come up I can go too localhost:8080 and the server is running and I can go to the admin console as well.

奇怪的是,当我等待错误出现时,我也可以访问 localhost:8080 并且服务器正在运行,我也可以转到管理控制台。

I have increased the timeouts (start was 240sec) as well but the same thing happens.

我也增加了超时时间(开始是 240 秒),但同样的事情发生了。

I have deleted and recreated the server in Eclipse.

我已经在 Eclipse 中删除并重新创建了服务器。

I have deleted the cache files from domain1/osgi-cache as advised in other posts

我已经按照其他帖子中的建议从 domain1/osgi-cache 中删除了缓存文件

I have setup a second domain (domain2) and tried to connect to that but get the same error.

我已经设置了第二个域 (domain2) 并尝试连接到该域,但出现相同的错误。

Any advice would be appreciated.

任何意见,将不胜感激。

I am on OSX 10.9.5 as well if that makes a difference.

如果这有所不同,我也在 OSX 10.9.5 上。

EDIT - ADDED LOG OUTPUT

编辑 - 添加日志输出

2015-03-26T17:00:58.880+1000|Info: Running GlassFish Version: GlassFish Server Open Source Edition  4.1  (build 13)
2015-03-26T17:00:58.883+1000|Info: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
2015-03-26T17:00:59.034+1000|Info: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
2015-03-26T17:00:59.145+1000|Info: Authorization Service has successfully initialized.
2015-03-26T17:00:59.200+1000|Info: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-03-26T17:00:59.202+1000|Info: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-03-26T17:00:59.209+1000|Info: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
2015-03-26T17:00:59.541+1000|Info: Grizzly Framework 2.3.15 started in: 37ms - bound to [/0.0.0.0:8080]
2015-03-26T17:00:59.571+1000|Info: Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:8181]
2015-03-26T17:00:59.580+1000|Info: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:4848]
2015-03-26T17:00:59.631+1000|Info: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:3700]
2015-03-26T17:01:01.988+1000|Info: visiting unvisited references
2015-03-26T17:01:02.395+1000|Severe: The SSL certificate has expired: [
[
  Version: V3
  Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
  Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
  Key:  Sun RSA public key, 2048 bits
  modulus: 23741889829347261660812437366387754385443431973861114865490414153884050331745811968523116847625570146592736935209718565296053386842135985534863157983128812774162998053673746470782252407673402238146869994438729551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
  public exponent: 65537
  Validity: [From: Sat Aug 15 00:50:00 AEST 1998,
               To: Thu Aug 15 09:59:00 AEST 2013]
  Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
  SerialNumber: [    01b6]
Certificate Extensions: 4
[1]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
  CA:true
  PathLen:5
]
[2]: ObjectId: 2.5.29.32 Criticality=false
CertificatePolicies [
  [CertificatePolicyId: [1.2.840.113763.1.2.1.3]
[]  ]
]
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  Key_CertSign
  Crl_Sign
]
[4]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 76 0A 49 21 38 4C 9F DE   F8 C4 49 C7 71 71 91 9D  v.I!8L....I.qq..
]
]
]
  Algorithm: [SHA1withRSA]
  Signature:
0000: 41 3A D4 18 5B DA B8 DE   21 1C E1 8E 09 E5 F1 68  A:..[...!......h
0010: 34 FF DE 96 F4 07 F5 A7   3C F3 AC 4A B1 9B FA 92  4.......<..J....
0020: FA 9B ED E6 32 21 AA 4A   76 C5 DC 4F 38 E5 DF D5  ....2!.Jv..O8...
0030: 86 E4 D5 C8 76 7D 98 D7   B1 CD 8F 4D B5 91 23 6C  ....v......M..#l
0040: 8B 8A EB EA 7C EF 14 94   C4 C6 F0 1F 4A 2D 32 71  ............J-2q
0050: 63 2B 63 91 26 02 09 B6   80 1D ED E2 CC B8 7F DB  c+c.&...........
0060: 87 63 C8 E1 D0 6C 26 B1   35 1D 40 66 10 1B CD 95  .c...l&.5.@f....
0070: 54 18 33 61 EC 13 4F DA   13 F7 99 AF 3E D0 CF 8E  T.3a..O.....>...
0080: A6 72 A2 B3 C3 05 9A C9   27 7D 92 CC 7E 52 8D B3  .r......'....R..
0090: AB 70 6D 9E 89 9F 4D EB   1A 75 C2 98 AA D5 02 16  .pm...M..u......
00A0: D7 0C 8A BF 25 E4 EB 2D   BC 98 E9 58 38 19 7C B9  ....%..-...X8...
00B0: 37 FE DB E2 99 08 73 06   C7 97 83 6A 7D 10 01 2F  7.....s....j.../
00C0: 32 B9 17 05 4A 65 E6 2F   CE BE 5E 53 A6 82 E9 9A  2...Je./..^S....
00D0: 53 0A 84 74 2D 83 CA C8   94 16 76 5F 94 61 28 F0  S..t-.....v_.a(.
00E0: 85 A7 39 BB D7 8B D9 A8   B2 13 1D 54 09 34 24 7D  ..9........T.4$.
00F0: 20 81 7D 66 7E A2 90 74   5C 10 C6 BD EC AB 1B C2   ..f...t\.......
]
2015-03-26T17:01:02.434+1000|Info: Java security manager is disabled.
2015-03-26T17:01:02.434+1000|Info: Entering Security Startup Service.
2015-03-26T17:01:02.439+1000|Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
2015-03-26T17:01:02.471+1000|Info: Security Service(s) started successfully.
2015-03-26T17:01:02.736+1000|Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
2015-03-26T17:01:02.745+1000|Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
2015-03-26T17:01:02.748+1000|Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
2015-03-26T17:01:02.776+1000|Info: Created virtual server server
2015-03-26T17:01:02.778+1000|Info: Created virtual server __asadmin
2015-03-26T17:01:03.303+1000|Info: Setting JAAS app name glassfish-web
2015-03-26T17:01:03.304+1000|Info: Virtual server server loaded default web module 
2015-03-26T17:01:04.044+1000|Info: visiting unvisited references
2015-03-26T17:01:04.087+1000|Info: visiting unvisited references
2015-03-26T17:01:04.088+1000|Info: visiting unvisited references
2015-03-26T17:01:04.089+1000|Info: visiting unvisited references
2015-03-26T17:01:04.090+1000|Info: visiting unvisited references
2015-03-26T17:01:04.091+1000|Info: visiting unvisited references
2015-03-26T17:01:04.093+1000|Info: visiting unvisited references
2015-03-26T17:01:04.094+1000|Info: visiting unvisited references
2015-03-26T17:01:04.095+1000|Info: visiting unvisited references
2015-03-26T17:01:04.096+1000|Info: visiting unvisited references
2015-03-26T17:01:04.097+1000|Info: visiting unvisited references
2015-03-26T17:01:04.097+1000|Info: visiting unvisited references
2015-03-26T17:01:04.098+1000|Info: visiting unvisited references
2015-03-26T17:01:04.099+1000|Info: visiting unvisited references
2015-03-26T17:01:04.099+1000|Info: visiting unvisited references
2015-03-26T17:01:04.100+1000|Info: visiting unvisited references
2015-03-26T17:01:04.101+1000|Info: visiting unvisited references
2015-03-26T17:01:04.102+1000|Info: visiting unvisited references
2015-03-26T17:01:04.102+1000|Info: visiting unvisited references
2015-03-26T17:01:04.103+1000|Info: visiting unvisited references
2015-03-26T17:01:04.104+1000|Info: visiting unvisited references
2015-03-26T17:01:04.104+1000|Info: visiting unvisited references
2015-03-26T17:01:04.105+1000|Info: visiting unvisited references
2015-03-26T17:01:04.106+1000|Info: visiting unvisited references
2015-03-26T17:01:04.692+1000|Info: HV000001: Hibernate Validator 5.0.0.Final
2015-03-26T17:01:05.036+1000|Info: Registering WebSocket filter for url pattern /*
2015-03-26T17:01:05.272+1000|Info: Loading application [test_xxxx] at [/test_xxxx]
2015-03-26T17:01:05.275+1000|Info: Loading application test_xxxx done in 6,024 ms
2015-03-26T17:01:05.277+1000|Info: GlassFish Server Open Source Edition  4.1  (13) startup time : Felix (2,715ms), startup services(6,496ms), total(9,211ms)
2015-03-26T17:01:05.364+1000|Info: Grizzly Framework 2.3.15 started in: 3ms - bound to [/0.0.0.0:7676]
2015-03-26T17:01:05.714+1000|Info: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://xxxxmlerspro2.gateway:8686/jndi/rmi://xxxxmlerspro2.gateway:8686/jmxrmi
2015-03-26T17:01:07.068+1000|Info: Initiating Jersey application, version Jersey: 2.10.4 2014-08-08 15:09:00...
2015-03-26T17:01:08.059+1000|Info: Listening to REST requests at context: /management/domain.
2015-03-26T17:01:08.195+1000|Info: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@33cbfa57 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@421a4ee1.
2015-03-26T17:01:08.341+1000|Info: visiting unvisited references
2015-03-26T17:01:08.602+1000|Info: visiting unvisited references
2015-03-26T17:01:08.620+1000|Info: visiting unvisited references
2015-03-26T17:01:08.621+1000|Info: visiting unvisited references
2015-03-26T17:01:09.627+1000|Info: Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362) for context ''
2015-03-26T17:01:10.853+1000|Info: Loading application [__admingui] at [/]
2015-03-26T17:01:10.855+1000|Info: Loading application __admingui done in 2,661 ms

So it gets to here and I can log into the Glassfish server then it stops with the timeout error after about 4 mins (249secs)

所以它到达这里,我可以登录 Glassfish 服务器,然后它在大约 4 分钟(249 秒)后停止并出现超时错误

I have just opened and run it in Netbeans and it is fine there.

我刚刚在 Netbeans 中打开并运行它,它在那里很好。

回答by usertest

This answer is for other people than the user who post the question.

此答案适用于发布问题的用户以外的其他人。

I had the same problem as you do, But unlike you

我和你有同样的问题,但不像你

I have deleted and recreated the server in Eclipse.

我已经在 Eclipse 中删除并重新创建了服务器。

This has fix it for me. I just remove the server from the eclipse server view. and I create it again. and that's it.

这已经为我解决了。我只是从 eclipse 服务器视图中删除了服务器。我再次创建它。就是这样。

Eclipse Neon, GlassFish 4.1.1, Java EE 7, JDK 8u92, Windows 10

Eclipse Neon、GlassFish 4.1.1、Java EE 7、JDK 8u92、Windows 10

回答by Maksim Khortov

@Lexynux for checking free port in mac osx you can try this command in terminal:

@Lexynux 用于检查 mac osx 中的空闲端口,您可以在终端中尝试此命令:

sudo netstat -tanp tcp

Then in result you can see ports not free.

然后结果你可以看到端口不是空闲的。

回答by Shashi

Try changing debug port to 9009 in eclipse server configuration of glass fish. It is working for me.

尝试在 glassfish 的 eclipse 服务器配置中将调试端口更改为 9009。它对我有用。

回答by kishore

i too faced the same problem. Try to change the network listener port in domain.xml in config folder of the glass fish directory. it may be any ide ,it worked for me .

我也面临同样的问题。尝试更改 glassfish 目录的 config 文件夹中的 domain.xml 中的网络侦听器端口。它可能是任何想法,它对我有用。

https://www.youtube.com/watch?v=cOkmuD1QyxQ

https://www.youtube.com/watch?v=cOkmuD1QyxQ

回答by Nabi

I have the same issue as well. It all started with an update of the Glassfish Tools some weeks ago. After that update I was not able to start Glassfish 4.1 via Eclipse. However, I can start it from Netbeans, IntelliJ and from the CLI. Seems to be a bug in the Glassfish Tools Plugin for Eclipse. Many people are facing this issue at the moment! See also here.

我也有同样的问题。这一切都始于几周前 Glassfish 工具的更新。在那次更新之后,我无法通过 Eclipse 启动 Glassfish 4.1。但是,我可以从 Netbeans、IntelliJ 和 CLI 启动它。似乎是 Eclipse 的 Glassfish 工具插件中的一个错误。目前很多人都面临这个问题!另请参见此处

To everyone:Please go to hereand vote for the issue! This is the only way we can get this fixed!

致大家:请到这里为问题投票!这是我们解决这个问题的唯一方法!

I blame Oracle for this disaster!Someone please take away Java, Glassfish and Netbeans from Oracle!!!! The progress of Glassfish and Netbeans feel to be so dead - bugs are open for months without any reaction! Oracle is throwing all their people onto their "Cloud Strategy".

我将这次灾难归咎于 Oracle!有人请从 Oracle 拿走 Java、Glassfish 和 Netbeans!!!!Glassfish 和 Netbeans 的进度感觉好死——bug 开了几个月没有任何反应!Oracle 正在将所有员工投入到他们的“云战略”中。

Well done, Oracle! This is how you make people switch to JBoss/WildFly and some other IDE...

干得好,甲骨文!这就是你如何让人们切换到 JBoss/WildFly 和其他一些 IDE...

回答by yakup_y

Increase Perm Size in Glassfish and Eclipse.

在 Glassfish 和 Eclipse 中增加烫发尺寸。

In Glassfish:

在玻璃鱼中:

Open

打开

glassfish4\glassfish\domains\domain1\config\domain.xml

glassfish4\glassfish\domains\domain1\config\domain.xml

file and find this lines

文件并找到这一行

<jvm-options>-XX:MaxPermSize=10000m</jvm-options>

<jvm-options>-Xmx10000m</jvm-options>

<jvm-options>-XX:MaxPermSize=10000m</jvm-options>

<jvm-options>-Xmx10000m</jvm-options>

and change this 2 values.

并更改这 2 个值。

In Eclipse:

在日食中:

Open eclipse.ini file in root eclipse folder

在 eclipse 根文件夹中打开 eclipse.ini 文件

--launcher.XXMaxPermSize

4g

-Xms4g

-Xmx4g

--launcher.XXMaxPermSize

4克

-Xms4g

-Xmx4g

and change this values.

并更改此值。

回答by muroi

I had the same problem that GlassFish server didn't boot with the message "Unable to start server on time".

我遇到了同样的问题,即 GlassFish 服务器无法启动并显示消息“无法按时启动服务器”。

In my case, I was running Jenkins on the same port number (8080). I was able to boot GlassFish after uninstalling the Jenkins application.

就我而言,我在相同的端口号 (8080) 上运行 Jenkins。卸载 Jenkins 应用程序后,我能够启动 GlassFish。

回答by Nathan

Change the port number , some other server may be using the same port number as grlassfish

更改端口号,某些其他服务器可能使用与 grassfish 相同的端口号