我有一个用于Rhapsody的java插件,但不知何故它没有加载代码示例:
IRPApplication app = null;
public class ProjectHistory extends RPUserPlugin{
@Override
public void RhpPluginInit(final IRPApplication rpyApplication) {
app = rpyApplication;
}
}辅助文件如下所示:
#REM: Definition of the plug-in
name16=Compare...
#REM: the class that implements Rhapsody's callbacks
JavaMainClass16=com.example.rhy.ProjectHistory
#REM: Class paths your application use
JavaClassPath16=./plugins/profile.jar;./plugins/GenericLib.jar;./plugins/java_lib/api.jar
#REM: Tells Rhapsody that this helper is actually a plug-in
isPlugin16=1
isVisible16=1
#REM: Definition of the pup-up menu that trigger the plugin
name17=Compare...
#REM: Tells Rhapsody that this helper actually invokes a plug-in
isPluginCommand17=1
#REM: The command is actually the plug-in name
command17=Compare...
#REM: to create a pop-up menu item on OMDs
applicableTo17=Package
isVisible17=1但是插件甚至都没有加载。日志文件中没有错误
Rhapsody版本为8.1.4,用于编译的Java版本为1.8
发布于 2017-05-24 19:17:16
首先,我会启用插件的日志记录。这可以在rhapsody.ini文件中完成,在General部分中添加行:
JavaAPILogFile=c:\api_log.txt
如果需要,您可以为日志文件选择其他路径。在日志文件中,你会发现加载插件时所有的输出都完成了,一个很好的起点是开始搜索异常或你的插件名称。
顺便说一句,你增加了你上面提到的HEP-File中的项目数量了吗?
发布于 2017-05-24 23:04:20
除了Frank的建议之外,我想补充的是,您的插件(如这里所示)甚至不应该编译,因为您的"app“变量是在类定义之前定义的。您需要在类中向下移动它。此外,在引用包含插件的.jar文件时,我更幸运地在.hep文件中使用了完全限定路径名。最后,插件逻辑的实际执行发生在RhpPluginInvokeItem()方法中,因此请确保您提供了该方法。事实上,请确保为接口中的所有方法提供重写方法。
发布于 2017-10-26 00:18:07
一些潜在或明确的问题:
rhapsody目前支持
- and as mentioned in comments above, IRPApplication shall not be defined outside the class anyway.
https://stackoverflow.com/questions/44132985
复制相似问题