0

我正在尝试借助 Equinox jars(org.aspectj.runtime、org.aspectj.weaver、org.eclipse.equinox.weaving.aspectj on bundles 文件夹和 org.eclipse)在 OSGI 上使用 aspectJ Load Time Weaving(无 Spring) .equinox.weaving.hook 位于与 org.eclipse.osgi 物理位置相同的文件夹)根据:https ://wiki.eclipse.org/Equinox_Weaving_QuickStart

这是捆绑包的加载顺序:

[org.eclipse.equinox.weaving.hook::1 -> INSTALLED]
[org.aspectj.runtime::11 -> INSTALLED]
[org.aspectj.weaver::12 -> INSTALLED]
[org.eclipse.equinox.weaving.aspectj::13 -> INSTALLED]
[com.common-calculations_2.11::19 -> INSTALLED] //here I used aspects
[com.instrumentation_2.11::48 -> INSTALLED] //here I defined the aspects 
Done installing bundles
Starting bundles...
[org.eclipse.equinox.weaving.aspectj::13 -> ACTIVE]
[org.aspectj.runtime::11 -> ACTIVE]
[org.eclipse.osgi::0 -> ACTIVE]
 FRAGMENT Bundle - skip starting: org.eclipse.equinox.weaving.hook
 FRAGMENT Bundle - skip starting: org.aspectj.runtime
[org.aspectj.weaver::12 -> ACTIVE]
 FRAGMENT Bundle - skip starting: org.eclipse.equinox.weaving.aspectj
 Bundle started: [com.common-calculations_2.11::19 -> ACTIVE]
 Bundle started: [com.instrumentation_2.11::48 -> ACTIVE]

我想知道我应该如何启动钩罐?我会很感激任何帮助... ps有人通过将包“org.eclipse.osgi”和片段“org.eclipse.equinox.weaving.hook”作为“带有链接内容的二进制项目”导入他的工作区来解决他的问题,但我不太确定该怎么做: https ://www.eclipse.org/forums/index.php?t=msg&th=440862

感谢您的回复

4

1 回答 1

1

有一次,当我在工作中遇到铁路交通控制应用程序的问题时,我在我的博客上写了一篇关于这个主题的更大的文章。它仍然在其核心功能方面运行 - 不仅用于调用跟踪,还用于 JPA 和线程安全方面的自动资源和事务处理等(所以我知道该解决方案在我以前的项目中仍然有效):

http://ballmerpeak.web.elte.hu/devblog/setting-up-aspect-orienting-programming-with-equinox-osgi-and-ajdt.html

我的 github 上提供了独立的示例代码:

https://github.com/prenex/equinox_osgi_skeleton

如果可能对其他人有帮助,我还会在此处添加我们的电子邮件内容:

“ 你好!

不久前,当我研究这个主题时,它肯定对我们很有效,并且仍然是基于插件的铁路交通控制应用程序的一部分。

对于您的问题:

1.) 您是否将 equinox.weaving.hook 包放在核心 org.eclipse.osgi 包附近?上次我处理这个要求时,有一些不太清楚的东西,这就是我在博客文章中写下来的原因。2.) 您是否尝试了以下链接中的示例代码?

https://github.com/prenex/equinox_osgi_skeleton

我会首先尝试运行我的这个已经包含 AspectJ 的示例项目,然后在相关位置逐行比较您的解决方案,直到它开始工作。

查看以下提交,了解我在通用 Equinox+osgi 框架项目中所做的更改以添加简单的 AspectJ 支持: https ://github.com/prenex/equinox_osgi_skeleton/commit/882d7765f31a3fc8ee136e88b689fce116a73d1c

最好的问候,理查德蒂尔

PS.:你是怎么偶然发现我的博客的?我很高兴有人真正阅读并发现它很有帮助,即使它不能完全解决他们的所有问题。:-)”

于 2018-09-25T09:27:55.810 回答