问题描述
我正在将 maven-classpath-plugin 集成到我的 fitnesse 项目中,并在添加具有以下值的 plugins.properties 之后
SymbolTypes = fitnesse.wikitext.widgets.MavenClasspathSymbolType
我在启动项目时收到 NullPointerException。
请在pom.xml
<profile>
<id>fitnesse</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>start-fitnesse</id>
<phase>test</phase>
<configuration>
<tasks>
<echo taskname="fitnesse" message="Starting fitnesse..."/>
<java classname="fitnesseMain.fitnesseMain"
classpathref="maven.runtime.classpath"
fork="true">
<arg line="-p 9001"/>
<arg line="-d ."/>
</java>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.fitnesse.plugins</groupId>
<artifactId>maven-classpath-plugin</artifactId>
<version>1.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
下面是我得到的异常
fitnesse.components.ComponentInstantiationException: Unable to instantiate component for type fitnesse.wikitext.widgets.MavenClasspathSymbolType
at fitnesse.components.ComponentFactory.createComponent(ComponentFactory.java:81)
at fitnesse.plugins.PropertyBasedpluginFeatureFactory$8.register(PropertyBasedpluginFeatureFactory.java:152)
at fitnesse.plugins.PropertyBasedpluginFeatureFactory.forEachClass(PropertyBasedpluginFeatureFactory.java:144)
at fitnesse.plugins.PropertyBasedpluginFeatureFactory.forEachObject(PropertyBasedpluginFeatureFactory.java:150)
at fitnesse.plugins.PropertyBasedpluginFeatureFactory.registerSymbolTypes(PropertyBasedpluginFeatureFactory.java:75)
at fitnesse.plugins.PluginsLoader.loadSymbolTypes(PluginsLoader.java:101)
at fitnesse.ContextConfigurator.makefitnesseContext(ContextConfigurator.java:187)
at fitnesseMain.fitnesseMain.launchfitnesse(fitnesseMain.java:72)
at fitnesseMain.fitnesseMain.launchfitnesse(fitnesseMain.java:59)
at fitnesseMain.fitnesseMain.main(fitnesseMain.java:39)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at fitnesse.components.ComponentFactory.createComponent(ComponentFactory.java:78)
... 9 more
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.logging.console.ConsoleLoggerManager.getLoggerForComponent(ConsoleLoggerManager.java:134)
at org.codehaus.plexus.logging.AbstractLoggerManager.getLoggerForComponent(AbstractLoggerManager.java:28)
at fitnesse.wikitext.widgets.MavenClasspathExtractor.<init>(MavenClasspathExtractor.java:37)
at fitnesse.wikitext.widgets.MavenClasspathSymbolType.<init>(MavenClasspathSymbolType.java:21)
... 14 more
Java Result: 1
在查看 ConsoleLoggerManager.java
的源代码时,我发现 NPE 是针对 private Map loggers
的,当 ConsoleLoggerManager
通过调用 initialize()
方法或它的参数化构造函数。
我在这里遗漏了什么吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)