在 glassfish 上发射 felix shell
我正在尝试启动 felix shell,它允许我与 glassfish 上的 OSGI 运行时交互并启动/停止捆绑包。根据我的阅读,它应该可以通过 telnet localhost 6666 访问,但是当我尝试这样做时,我连接失败。我尝试按照此处提到的步骤进行操作,但仍然没有运气。
我找不到任何其他方法通过 shell 访问 OSGI 运行时,有人有任何见解吗?
I am trying to launch the felix shell that would allow me to interact with OSGI runtime on glassfish and start/stop bundles. From what I read it should be accessible via telnet localhost 6666, but when I try to do so I get Connect failed. I tried following the steps mentioned here but still no luck.
I can't find any other way to access OSGI runtime via shell, does anyone have any insight?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您需要告诉 GlassFish 启用 Felix OSGi shell。如何执行此操作取决于 GlassFish 版本。
GlassFish 3.1.1 及更早版本:
停止服务器
编辑domain.xml(在您的域的配置目录中)并将此字符串:
org.apache.felix.shell.remote,
的值中
添加到-Dorg.glassfish.additionalOSGiBundlesToStart
它应该看起来像这样:
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell.remote,org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org. apache.felix.gogo.command
GlassFish 3.1.2 及更高版本
asadmin create-jvm-options -Dglassfish.osgi.start.level.final=3
所有版本
(重新)启动服务器。
远程登录本地主机 6666
You need to tell GlassFish to enable the Felix OSGi shell. How to do that depends on the GlassFish version.
GlassFish 3.1.1 and earlier:
Stop the server
Edit domain.xml (in your domain's config directory) and add this string:
org.apache.felix.shell.remote,
to the value for
-Dorg.glassfish.additionalOSGiBundlesToStart
It should look like this:
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell.remote,org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command
GlassFish 3.1.2 and later
asadmin create-jvm-options -Dglassfish.osgi.start.level.final=3
All Versions
(Re)start the server.
telnet localhost 6666
使用 GlassFish 3.1.2 并尝试
重新启动服务器。有用。
use GlassFish 3.1.2 and try
and restart the server. It works.
之前的答案大部分是正确的,只是缺少 3.1.1 的信息。对于3.1.1,您需要添加
org.apache.felix.shell.remote.jar 到自动启动包列表中
osgi/felix/config.properties,如 osgi 功能的 #10.4.1 节中所述文档。
The previous answer was mostly correct except that it lacked the information for 3.1.1. For 3.1.1, you need to add
org.apache.felix.shell.remote.jar to the autostart bundles list in
osgi/felix/config.properties as described in section #10.4.1 of the osgi features document.
对于 Glassfish 4,请参阅 Sahoo 的文档 &部分; OSGi访问不再使用telnet,而是使用asadmin下的子命令。
For Glassfish 4, see Sahoo's document & section; OSGi access no longer uses telnet, but subcommands under asadmin.