- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试捕捉评论状态事件,例如有人正在关闭它。并在从插件中获得任何生命迹象之后。向日志文件(从任何日志级别)或 STDOUT 发送一行。atlassian-plugins.xml 看起来像这样:
<component-import key="eventPublisher" interface="com.atlassian.event.api.EventPublisher"/>
<component key="reviewListenerNew" class="com.harman.ListenerNew.ReviewListenerNew">
<description>Class that processes the incoming Review events.</description>
</component>
类本身在这里:
package com.harman.ListenerNew;
import com.atlassian.crucible.event.ReviewStateChangedEvent;
import com.atlassian.crucible.spi.data.ReviewData;
import com.atlassian.crucible.spi.services.ReviewService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
public class ReviewListenerNew implements InitializingBean, DisposableBean{
private final EventPublisher eventPublisher;
private final ReviewService reviewService;
private final ReviewManager reviewManager;
private final UserManager userManager;
private final Logger log = Logger.getLogger(ReviewListenerNew.class);
public ReviewListenerNew(EventPublisher eventPublisher, ReviewService reviewService, ReviewManager reviewManager, UserManager userManager){
this.eventPublisher = eventPublisher;
this.reviewService = reviewService;
this.reviewManager = reviewManager;
this.userManager = userManager;
}
public Class[] getHandledEventClasses() {
return new Class[0];
}
public void handEvent(ReviewStateChangedEvent event) {
if (event.getNewState().equals(ReviewData.State.Closed))
{
log.warn("Event occured" + event);
log.info("Event occured" + event);
log.info("Event occured" + event.getNewState());
log.error("Event occured" + event);
log.debug("Event occured" + event);
System.out.println("Event: " + event);
}
return;
}
@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);
}
@Override
public void afterPropertiesSet() throws Exception {
eventPublisher.register(this);
}
}
这可以成功构建和上传,但无法启动。错误信息是:
2015-07-03 14:58:00,790 WARN [UpmAsynchronousTaskManager:thread-1 ] com.atlassian.plugin.util.resource.AlternativeDirectoryResourceLoader AlternativeDirectoryResourceLoader-<init> - Resource directory , which resolves to C:\AtlasPlugins\standalon does not exist
2015-07-03 14:58:00,946 ERROR [ThreadPoolAsyncTaskExecutor::Thread 26 ] com.atlassian.plugin.osgi.factory.OsgiPlugin OsgiPlugin-onPluginContainerFailed - Unable to start the plugin container for plugin 'com.harman.ListenerNew.ListenerNew'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reviewListenerNew' defined in URL [bundle://94.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No listener invokers were found for listener <com.harman.ListenerNew.ReviewListenerNew@4b488637>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: No listener invokers were found for listener <com.harman.ListenerNew.ReviewListenerNew@4b488637>
at com.atlassian.event.internal.LockFreeEventPublisher$InvokerBuilder.build(LockFreeEventPublisher.java:271)
at com.atlassian.event.internal.LockFreeEventPublisher.register(LockFreeEventPublisher.java:88)
at com.atlassian.fisheye.event.FisheyeEventPublisher.register(FisheyeEventPublisher.java:43)
at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
at com.sun.proxy.$Proxy136.register(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy1255.register(Unknown Source)
at com.harman.ListenerNew.ReviewListenerNew.afterPropertiesSet(ReviewListenerNew.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 19 more
2015-07-03 14:58:00,955 ERROR [ThreadPoolAsyncTaskExecutor::Thread 26 ] org.springframework.osgi.extender.internal.activator.ContextLoaderListener DefaultOsgiBundleApplicationContextListener-onOsgiApplicationEvent - Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.harman.ListenerNew.ListenerNew, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reviewListenerNew' defined in URL [bundle://94.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No listener invokers were found for listener <com.harman.ListenerNew.ReviewListenerNew@4b488637>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: No listener invokers were found for listener <com.harman.ListenerNew.ReviewListenerNew@4b488637>
at com.atlassian.event.internal.LockFreeEventPublisher$InvokerBuilder.build(LockFreeEventPublisher.java:271)
at com.atlassian.event.internal.LockFreeEventPublisher.register(LockFreeEventPublisher.java:88)
at com.atlassian.fisheye.event.FisheyeEventPublisher.register(FisheyeEventPublisher.java:43)
at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
at com.sun.proxy.$Proxy136.register(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy1255.register(Unknown Source)
at com.harman.ListenerNew.ReviewListenerNew.afterPropertiesSet(ReviewListenerNew.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 19 more
还有另一个类的尝试:
package com.harman.ListenerNew;
import com.atlassian.crucible.event.ReviewStateChangedEvent;
import com.atlassian.crucible.spi.data.ReviewData;
import com.atlassian.crucible.spi.services.ReviewService;
import com.atlassian.event.api.EventPublisher;
import com.cenqua.crucible.model.Review;
import com.cenqua.crucible.model.managers.ReviewManager;
import com.cenqua.fisheye.user.UserManager;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import com.atlassian.event.api.EventListener;
public class ReviewListenerNew{
private final Logger log = Logger.getLogger(ReviewListenerNew.class);
public Class[] getHandledEventClasses() {
return new Class[0];
}
@EventListener
public void handleEvent(ReviewStateChangedEvent event) {
if (event.getNewState().equals(ReviewData.State.Closed))
{
log.warn("Event occured" + event);
log.info("Event occured" + event);
log.info("Event occured" + event.getNewState());
log.error("Event occured" + event);
log.debug("Event occured" + event);
System.out.println("Event: " + event);
}
return;
}
}
但在这种情况下,这可以构建和上传,看起来甚至已经开始,但没有任何 Action 。
最佳答案
似乎关键组件必须是 eventListener:
<component key="eventListener" class="com.harman.NewEventListener">
<description>Class that processes the new Crucible event</description>
</component>
关于java - 坩埚 : No listener invokers were found for listener,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31208678/
我有以下代码: Public Delegate Sub SetStatusBarTextDelegate(ByVal StatusText As String) Private Sub SetStat
在调用 Invoke-RestMethod 时使用 Powershell,例如: Invoke-RestMethod -Method Get -Uri "https://google.com/api/
我正在尝试将 Winform 应用程序转换为控制台应用程序。 Winform 应用程序有一个委托(delegate)处理程序。如何在 console 应用程序中编写相同的功能? this.Invoke
在 WPF 中,Dispatcher.Invoke 和直接在控件实例上调用的 Invoke 有什么区别。据我了解,调度程序负责处理线程的消息,Control.Invoke 是否会继续调用 Dispat
我正在研究性能监控系统,它可以将其例程注入(inject)现有程序集。为此,我试图了解 dalvik 代码的工作原理。 下面是我要完成的工作的示例。输入类可能如下所示: class MyClass{
我正在使用 powershell 命令来执行脚本和 cmdlet。因此,在执行 cmdlet 时,我使用了 powershell.invoke,而在执行脚本时,我使用了 pipeline.invoke
有人能解释一下 Invoke-Expression $test 之间的区别吗?和 Invoke-Expression -Command $test ? 变量测试是: $test = "notepad
我有四个类,即 MapperOne、ReducerOne、MapperTwo、ReducerTwo。我想要其中的一个链。 MapperOne-->ReducerOne-->输出文件生成,输入到Mapp
我正在阅读 Java ForkJoin 框架。不直接在 ForkJoinTask 的实现上调用 invoke()(例如 RecursiveTask),而是实例化 ForkJoinPool 有什么额外的
我在调用 Invoke-SqlCmd 时遇到问题,因为它包含第二个 Invoke-SqlCmd 调用: function Get-Foo { $query=` @" WITH data AS (
有人知道如何解决这个问题吗?我创建了一个客户端来使用网络服务。客户端代码为: package cliente; import java.util.List; import handler.Header
我希望使用 P/Invoke 来允许我的 C# 程序集与 native C 库互操作;这需要是跨平台的(即 Mono),因此不能使用混合模式程序集。我想知道使用不安全的 P/invoke 调用并在不安
一般来说,我对使用 Invoke-RestMethod/Invoke-WebRequest 比较陌生 - 我认为这是以下问题的重要背景。 我正在调用如下电话: $Headers = @{ "A
在 Jenkins 的一个自由风格项目(不是说 Maven2/3 项目)中,我有两个可能的构建步骤: 调用 Maven 3 调用顶级 Maven 目标 在不同的安装中,我有不同的组合(有些两者都有,有
这是完整的错误: e: C:\Users\HP\AndroidStudioProjects\MoneyManager\app\src\main\java\com\cruxrepublic\moneym
我正在编写 jQuery 插件并将它们与 AJAX 集成。我正在减少脂肪并专注于基础知识: (function($) { function MyPlugin(el, options) {
有人可以建议我如何处理这条消息吗? CA1060 Move P/Invokes to NativeMethods class Because it is a P/Invoke method, 'UCo
在java中我们可以“用类名调用一个静态方法”也可以“用一个对象调用一个静态方法”java中“用类名调用静态方法”和“用对象调用静态方法”有什么区别? 最佳答案 没有区别,但建议以静态方式调用 sta
尝试从对话框中的 EditText 获取 Edit Text 的值,但一次又一次地出现此错误 Attempt to invoke virtual method 'android.text.Editab
我正在开发一款扑翼应用程序。在出现此错误之前,读取和写入FireStore数据库没有任何问题,但随后突然出现错误(如下所示),并阻止我读取或写入数据库。我一直在寻找答案,但不幸的是,我找不到任何可以解
我是一名优秀的程序员,十分优秀!