启用安全性后,从 Eclipse 启动 Websphere 挂起

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

Starting Websphere from Eclipse hangs when security is enabled

javaeclipseradwebsphere-8

提问by Thomas Stets

I have a Websphere Application Server 8.0.0.6, which was installed as part of RAD.

我有一个 Websphere Application Server 8.0.0.6,它是作为 RAD 的一部分安装的。

I need to run the server from an Eclipse Java EE Kepler or Luna. There is no problem when administrative security is disabled. However, once security is enabled, the server either doesn't start completely, or Ecplise is unable to to detect it.

我需要从 Eclipse Java EE Kepler 或 Luna 运行服务器。禁用管理安全性时没有问题。但是,一旦启用安全性,服务器要么没有完全启动,要么 Ecplise 无法检测到它。

The progress bar stops at 23%. The last message logged is "Server server1 open for e-business". The status however is still "starting". After a while I get an error complaining that the server didn't start within 300 seconds. It then tries to stop the server, and remains in "stopping" indefinitely.

进度条停在 23%。记录的最后一条消息是“为电子商务打开服务器 server1”。然而,状态仍然是“开始”。过了一会儿,我收到一个错误,抱怨服务器没有在 300 秒内启动。然后它尝试停止服务器,并无限期地保持“停止”状态。

The server is started, Eclipse just seems unable to see it. I can't access the admin console from within Eclipse (though I can with a browser), I can't publish or debug applications, and I can't stop the server from Eclipse.

服务器启动了,Eclipse 似乎无法看到它。我无法从 Eclipse 中访问管理控制台(尽管我可以使用浏览器),我无法发布或调试应用程序,并且我无法从 Eclipse 停止服务器。

This happens with both Kepler and Luna.

这种情况发生在开普勒和卢娜身上。

The server starts fine in RAD, or when started with the start script.

服务器在 RAD 中正常启动,或者在使用启动脚本启动时。

I have checked start websphere server from RAD hangs at "Server server1 open for e-business". There is a similar question: Websphere in RAD hangs on startup, but there was no solution.

我已经检查过从 RAD 启动 websphere 服务器挂在“服务器 server1 open for e-business”。有一个类似的问题:Websphere in RAD hangs on startup,但没有解决方案。

Update:The problem is the communication between Ecipse and Websphere, after Websphere has started (as wFateem also has pointed out).

更新:问题是 Ecipse 和 Websphere 之间的通信,在 Websphere 启动后(正如 wFateem 也指出的)。

Eclipse makes SOAP calls to Websphere to check the status. If administrative security is disabled in WAS, it accepts SOAP calls in plain HTTP. Once security is enabled, only HTTPS is allowed.

Eclipse 对 Websphere 进行 SOAP 调用以检查状态。如果在 WAS 中禁用了管理安全性,它会接受纯 HTTP 中的 SOAP 调用。启用安全性后,只允许使用 HTTPS。

I checked communications between Eclipse and WAS using the TCP-Monitor built into Eclipse. With disabled security I can see the successful SOAP calls. After enabling security I expected to see just the binary SSL data. However, Eclipse was still trying to use HTTP, without any success of course.

我使用 Eclipse 中内置的 TCP-Monitor 检查了 Eclipse 和 WAS 之间的通信。在禁用安全性的情况下,我可以看到成功的 SOAP 调用。启用安全性后,我希望只看到二进制 SSL 数据。然而,Eclipse 仍在尝试使用 HTTP,当然没有任何成功。

Eclipse has a setting for the WAS server to indicate that the server is secured, and which user and password to use for the calls. It even has a flag pertaining to the SSL communication ("automatically trust server certificate during SSL handshake"). But still, it is not using SSL for some reason.

Eclipse 具有 WAS 服务器的设置,用于指示服务器是安全的,以及用于调用的用户和密码。它甚至有一个与 SSL 通信有关的标志(“在 SSL 握手期间自动信任服务器证书”)。但是,出于某种原因,它仍然没有使用 SSL。

I had no problem in this scenario on my old development machine, which got replaced by my current machine a few days ago.

我的旧开发机器在这种情况下没有问题,几天前它被我现在的机器取代。

So, the current status is: Eclipse does not use SSL when talking to the WAS, even though it knows the server is secured.

因此,当前状态是:Eclipse 在与 WAS 通信时不使用 SSL,即使它知道服务器是安全的。

The question now is: What did I do wrong that Eclipse does not use SSL to talk to a secured server?

现在的问题是:Eclipse 不使用 SSL 与安全服务器通信,我做错了什么?

采纳答案by Gas

If you suspect problems with SSL, you could try the following workaround.
Once server is started (e.g. via command line), go to web admin console and then to: Global security > CSIv2 inbound communicationsand in transport section set transport to TCP-IP. Save and restart the server. This will disable SSL for RMI/IIOP connections.

如果您怀疑 SSL 有问题,您可以尝试以下解决方法。
一旦服务器启动(例如通过命令行),转到 web 管理控制台,然后到:Global security > CSIv2 inbound communications并在传输部分设置传输到TCP-IP。保存并重新启动服务器。这将为 RMI/IIOP 连接禁用 SSL。

Then in RAD in Server settings change Server connection types...to Manually provide connection settingsand select only RMI.

然后在 RAD 中的 Server settings 更改Server connection types...Manually provide connection settings并选择 only RMI

Check if it will work better.

检查它是否会更好地工作。

As last resort you could also try to start the server, then exit the RAD and restart the RAD again, it should detect server as already running. But it's not very useful...

作为最后的手段,您也可以尝试启动服务器,然后退出 RAD 并再次重新启动 RAD,它应该检测到服务器已在运行。不过用处不大...

回答by Sergey Batsura

I solved same problems for WebSphere 7 and Eclipse Neon. Just run eclipse with ibm jdk 8 (type in google "ibm jdk 8 download").

我为 WebSphere 7 和 Eclipse Neon 解决了同样的问题。只需使用 ibm jdk 8 运行 eclipse(输入谷歌“ibm jdk 8 下载”)。

My eclipse ini is

我的日食ini是

-vm 
..\ibm_sdk80\jre\bin\javaw.exe 
-vmargs
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-XX:MaxPermSize=320m   
-Dcom.ibm.ws.management.event.max_polling_interval=1000
-Dcom.ibm.websphere.thinclient=true

Best regards, Sergey Batsura

最好的问候, Sergey Batsura

回答by wFateem

I'm not too familiar with starting WAS from Eclipse. However, from the sound of it this looks like a communication issue between your IDE and the WAS server. If you're able to start the server and you get the "open for e-business" message, but Eclipse is unable to see the proper status and this only occurs when security is enabled then you need to look into how Eclipse authenticates and performs SSL handshake with the WAS server.

我不太熟悉从 Eclipse 启动 WAS。但是,从它的声音来看,这看起来像是 IDE 和 WAS 服务器之间的通信问题。如果您能够启动服务器并收到“为电子商务开放”消息,但 Eclipse 无法看到正确的状态,并且这仅在启用安全性时发生,那么您需要查看 Eclipse 如何进行身份验证和执行与 WAS 服务器的 SSL 握手。

You can start the server without any issues, but other tasks would require authentication (stopping server, retrieving status, etc...).

您可以毫无问题地启动服务器,但其他任务需要身份验证(停止服务器、检索状态等)。

You may need to retrieve the WAS server's personal certificate into Eclipse's local trust store for example.

例如,您可能需要将 WAS 服务器的个人证书检索到 Eclipse 的本地信任库中。

回答by Andreas Bisiach

it's important to modify the eclipse.ini. First of all specifying the WebSphere -vm BEFORE -vmargs Here are my parameters:

修改 eclipse.ini 很重要。首先指定 WebSphere -vm BEFORE -vmargs 以下是我的参数:

--launcher.XXMaxPermSize 
512M
-vm
C:\IBM\WebSphere\AppServer\java\jre\bin\javaw.exe
-vmargs
-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m
-Xmx1024m
-Xshareclasses:name=IBMSDP_%u
-Xcompressedrefs
-Xquickstart
-Xgcpolicy:gencon
-Xmnx64m
-XX:+UseCompressedOops 
-Dcom.ibm.ws.management.event.max_polling_interval=1000
-Dcom.ibm.websphere.thinclient=true

After the above changes, communication from eclipse to WebSphere with security enabled works without problems

进行上述更改后,从 eclipse 到启用安全性的 WebSphere 的通信没有问题

回答by rickespana

I was experiencing the same issue when trying to start WebSphere from Eclipse Luna. Finally I was able to start it following the guidelines posted by Aleksander Kova? in an answer from developer works forum: Unable to initialize SSL connection(WASCE7)

我在尝试从 Eclipse Luna 启动 WebSphere 时遇到了同样的问题。最后我能够按照 Aleksander Kova 发布的指南启动它?在开发者工作论坛的回答中:无法初始化 SSL 连接(WASCE7)

I hope this helps!

我希望这有帮助!

回答by Chinmoy

Update the JDK in eclipse.ini file to IBM JDB 1.8 64Bit. I am using WAS 8.5.0 with Eclipse MARS. -vm C:/IBM/WebSphere8.5/AppServer/java_1.8_64/bin/javaw

将 eclipse.ini 文件中的 JDK 更新为 IBM JDB 1.8 64Bit。我在 Eclipse MARS 中使用 WAS 8.5.0。-vm C:/IBM/WebSphere8.5/AppServer/java_1.8_64/bin/javaw

If eclipse does not start and return code=13, then check in eclipse.ini version is 1.7 -vmargs -Dosgi.requiredJavaVersion=1.7 -Xms256m -Xmx1024m

如果eclipse没有启动并返回code=13,那么在eclipse.ini中check in version是1.7 -vmargs -Dosgi.requiredJavaVersion=1.7 -Xms256m -Xmx1024m

Note:I have already commented in Sergey's answer,but needed to update some info.

注意:我已经在 Sergey 的回答中发表了评论,但需要更新一些信息。

回答by PMFrank

I had the similar issue (Websphereapplication server hung in eclipse after adding Security).
Resolved the same by adding com.ibm.ws.orb_8.5.0.jarfile from your appserver/runtimes and placed it in C:\Temp\endorsed folder and specify the same in your eclipse.ini file as below.
Eg:

我遇到了类似的问题(Websphere添加安全性后应用程序服务器挂在 Eclipse 中)。
通过com.ibm.ws.orb_8.5.0.jar从您的应用程序服务器/运行时添加文件并将其放置在 C:\Temp\endorsed 文件夹中并在您的 eclipse.ini 文件中指定相同的内容来解决相同的问题,如下所示。
例如

  • vmargs
  • Djava.endorsed.dirs=C:\Temp\endorsed
  • 虚拟机
  • Djava.endorsed.dirs=C:\Temp\endorsed

回答by Victor Sosa

Maybe this is a silly advise, but have you tried using WebSphere Developer Tools? They are installed on top of Eclipse, either Luna or Kepler, using P2

也许这是一个愚蠢的建议,但是您是否尝试过使用 WebSphere Developer Tools?它们使用 P2 安装在 Eclipse(Luna 或 Kepler)之上

https://developer.ibm.com/wasdev/

https://developer.ibm.com/wasdev/

Look at this web page to learn how to install the tools

查看此网页以了解如何安装这些工具

http://www-01.ibm.com/support/knowledgecenter/was_beta_devtools/com.ibm.websphere.wdt.doc/topics/t_install_wdt.htm

http://www-01.ibm.com/support/knowledgecenter/was_beta_devtools/com.ibm.websphere.wdt.doc/topics/t_install_wdt.htm