--------------------
有时,在运行Application时会出现下面这样的信息。
!MESSAGE Missing required bundle org.eclipse.gef_3.4.1.
!MESSAGE Missing required bundle org.eclipse.ui.editors_3.4.0.
解决办法:
1.点击Run Configuation,选中要运行的程序,
2. 选中 Plug-ins table页,点击Add Required Plug-ins
----------
出现ClassNotFound的exception,在网上找到了这样的一段回复,
First, have a look to see if the plugin is loaded. (If you've got selected 'run with all workbench plugins loaded' in the launch config, you probably do.) You should be able to check whether it's loaded by going to the 'About' mentu and looking for deployed plugins, on the assumption that your RCP app loads these.
If it's loaded but it still can't find the classes, the usual suspects are the plugin.xml (for Eclipse 2.1 and migrated projects to Eclipse 3.0) and the Manifest.MF (for E clipse 3.0+) to see if they mention the plugin (aka Bundle) explicitly by name. If not, you could try removing them and adding them again -- but using the PDE editor, not editing the source directly, as that way it will add them into the appropriate places.
不过,我发现,在出现classNotFound的异常时,需要要检查以下的文件,以插件B依赖插件A为例。
1. 检查插件A是否export了它的包,只有被export的包,插件A才能访问到。
2. 插件B是否引入了所有dependence的包,这个在plugin.xml->Dependences可以看到。
3. 检查build.properties文件,是否包含了source.. = src/output.. = bin/如果没有,一定要加上。我在开发的过程中,可能无意中删除了这两项。导致在运行时总是报classnotfound异常。
4. 检查Run configuration页面,选中Plug-ins页,点击验证插件(validate plug-ins)。看是否有问题。
注:我在开发的过程中,会遇到这样的情况,有时,明明验证已经通过了,在运行了几次程序以后又会导致依赖的插件丢失。
----------------
关于Extension,在网上看到,比较多的是使用Eclipse自己的point,比如,Views,等。但是,我们也可以创建自己的Extension。
1.首先在插件B声明自己的扩展点,extension point。
2. 插件A必须依赖插件B,直接依赖或间接的依赖都可以。
3. 在插件A的Extension页,就可以添加对插件B的Extension了。
那么在插件B中,如何访问到插件A的对象呢,有下面的两行代码就可以。
有时,在运行Application时会出现下面这样的信息。
!MESSAGE Missing required bundle org.eclipse.gef_3.4.1.
!MESSAGE Missing required bundle org.eclipse.ui.editors_3.4.0.
解决办法:
1.点击Run Configuation,选中要运行的程序,
2. 选中 Plug-ins table页,点击Add Required Plug-ins
----------
出现ClassNotFound的exception,在网上找到了这样的一段回复,
First, have a look to see if the plugin is loaded. (If you've got selected 'run with all workbench plugins loaded' in the launch config, you probably do.) You should be able to check whether it's loaded by going to the 'About' mentu and looking for deployed plugins, on the assumption that your RCP app loads these.
If it's loaded but it still can't find the classes, the usual suspects are the plugin.xml (for Eclipse 2.1 and migrated projects to Eclipse 3.0) and the Manifest.MF (for E clipse 3.0+) to see if they mention the plugin (aka Bundle) explicitly by name. If not, you could try removing them and adding them again -- but using the PDE editor, not editing the source directly, as that way it will add them into the appropriate places.
不过,我发现,在出现classNotFound的异常时,需要要检查以下的文件,以插件B依赖插件A为例。
1. 检查插件A是否export了它的包,只有被export的包,插件A才能访问到。
2. 插件B是否引入了所有dependence的包,这个在plugin.xml->Dependences可以看到。
3. 检查build.properties文件,是否包含了source.. = src/output.. = bin/如果没有,一定要加上。我在开发的过程中,可能无意中删除了这两项。导致在运行时总是报classnotfound异常。
4. 检查Run configuration页面,选中Plug-ins页,点击验证插件(validate plug-ins)。看是否有问题。
注:我在开发的过程中,会遇到这样的情况,有时,明明验证已经通过了,在运行了几次程序以后又会导致依赖的插件丢失。
----------------
关于Extension,在网上看到,比较多的是使用Eclipse自己的point,比如,Views,等。但是,我们也可以创建自己的Extension。
1.首先在插件B声明自己的扩展点,extension point。
2. 插件A必须依赖插件B,直接依赖或间接的依赖都可以。
3. 在插件A的Extension页,就可以添加对插件B的Extension了。
那么在插件B中,如何访问到插件A的对象呢,有下面的两行代码就可以。
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(pointID);