如何更改eclipse osgi服务超时

How to change the eclipse osgi service to timeout

我需要通过在 Eclipse RCP 应用程序中启动 OSGi 动态服务进行调试,但超时时间太短(或者我调试速度太慢!)。

!ENTRY org.eclipse.equinox.ds 2 0 2015-02-25 21:46:26.374
!MESSAGE Getting a lock required more than 10000 ms. There might be a synchronization problem in this callstack or just the build/dispose process of some components took too long! 

有没有办法将超时值设置为比默认值 10000 长?

看起来可以在 'org.eclipse.equinox.ds' 插件的调试“.options”文件中配置:

# Debugging options for the org.eclipse.equinox.ds plugin

# Turns on/off debugging of SCR
org.eclipse.equinox.ds/debug=true
# Specifies that logged entries should be printed to the framework runtime console 
org.eclipse.equinox.ds/print_on_console=false
# Enables generating and printing logs about the time performance of the operations executed by the SCR
org.eclipse.equinox.ds/performance=false
# Makes instance of each component nevertheless components are "immediate" or not
org.eclipse.equinox.ds/instantiate_all=false

#Advanced options 
# Enables caching of the parsed XML documents of the component descriptions
#org.eclipse.equinox.ds/cache_descriptions=false
# Specifies the maximum time in milliseconds, which is allowed to a user component's activate or bind method to take. If the method invocation has not finished, a new dispatcher thread will be launched to process the pending work of SCR 
org.eclipse.equinox.ds/block_timeout=30000

要使用此文件,请在 eclipse 命令中指定 -debug <path to options file>

如果您使用运行配置

启动eclipse实例,您还可以设置VM参数
-Dequinox.ds.block_timeout=300000000

要增加时间请看Equinox/RuntimeOptions:

http://wiki.eclipse.org/Equinox/RuntimeOptions

例如:

-Dequinox.scr.waitTimeOnBloc=15000