Jira plugin cannot startup due to "Error parsing class file"

在做jira插件开发的时候,使用 atlas-create-jira-plugin 命令创建 plugin skeleton 后,导入自己的工程代码,然后跑 atlas-run 出现下面的错误:

[INFO] [talledLocalContainer] java.lang.ArrayIndexOutOfBoundsException: 60
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:448)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:369)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:359)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:349)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Analyzer.analyzeJar(Analyzer.java:1591)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:1501)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Analyzer.analyze(Analyzer.java:118)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Builder.analyze(Builder.java:304)
[INFO] [talledLocalContainer]   at aQute.lib.osgi.Analyzer.calcManifest(Analyzer.java:295)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.stage.GenerateManifestStage.execute(GenerateManifestStage.java:169)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.DefaultPluginTransformer.transform(DefaultPluginTransformer.java:146)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.createOsgiPluginJar(OsgiPluginFactory.java:324)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.create(OsgiPluginFactory.java:229)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.MasterPluginFactory.create(MasterPluginFactory.java:81)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.ScanningPluginLoader.deployPluginFromUnit(ScanningPluginLoader.java:155)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.ScanningPluginLoader.loadAllPlugins(ScanningPluginLoader.java:89)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.PermissionCheckingPluginLoader.loadAllPlugins(PermissionCheckingPluginLoader.java:24)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:461)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.JiraPluginManager.earlyStartup(JiraPluginManager.java:113)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.JiraPluginManager.start(JiraPluginManager.java:101)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager$PluginSystem.start(ComponentManager.java:801)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:265)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager.start(ComponentManager.java:239)
[INFO] [talledLocalContainer]   at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:29)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:137)
[INFO] [talledLocalContainer]   at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl
.java:345)
[INFO] [talledLocalContainer]   at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurat
ionManagerImpl.java:215)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:124)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86)
[INFO] [talledLocalContainer]   at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
[INFO] [talledLocalContainer]   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
[INFO] [talledLocalContainer]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[INFO] [talledLocalContainer]   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[INFO] [talledLocalContainer]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[INFO] [talledLocalContainer]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[INFO] [talledLocalContainer]   at java.lang.Thread.run(Thread.java:745)
[INFO] [talledLocalContainer] 2015-12-29 11:23:36,119 localhost-startStop-1 ERROR      [atlassian.plugin.loaders.ScanningPluginLoader] Unable to deplo
y plugin 'com.pine2.testplugin' from 'Unit: D:\NewWS\testplugin\target\jira\home\plugins\installed-plugins\testplugin-1.jar (1451359332797)'.
[INFO] [talledLocalContainer] 2015-12-29 11:23:36,120 localhost-startStop-1 ERROR      [atlassian.plugin.loaders.ScanningPluginLoader] Because of the
following exception:
[INFO] [talledLocalContainer] com.atlassian.plugin.PluginParseException: Unable to scan for host components in plugin classes
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.execute(HostComponentSpringStage.java:62
)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.DefaultPluginTransformer.transform(DefaultPluginTransformer.java:146)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.createOsgiPluginJar(OsgiPluginFactory.java:324)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.create(OsgiPluginFactory.java:229)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.MasterPluginFactory.create(MasterPluginFactory.java:81)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.ScanningPluginLoader.deployPluginFromUnit(ScanningPluginLoader.java:155)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.ScanningPluginLoader.loadAllPlugins(ScanningPluginLoader.java:89)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.loaders.PermissionCheckingPluginLoader.loadAllPlugins(PermissionCheckingPluginLoader.java:24)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:461)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.JiraPluginManager.earlyStartup(JiraPluginManager.java:113)
[INFO] [talledLocalContainer]   at com.atlassian.jira.plugin.JiraPluginManager.start(JiraPluginManager.java:101)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager$PluginSystem.start(ComponentManager.java:801)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:265)
[INFO] [talledLocalContainer]   at com.atlassian.jira.ComponentManager.start(ComponentManager.java:239)
[INFO] [talledLocalContainer]   at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:29)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:137)
[INFO] [talledLocalContainer]   at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl
.java:345)
[INFO] [talledLocalContainer]   at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurat
ionManagerImpl.java:215)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:124)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86)
[INFO] [talledLocalContainer]   at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81)
[INFO] [talledLocalContainer]   at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
[INFO] [talledLocalContainer]   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
[INFO] [talledLocalContainer]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[INFO] [talledLocalContainer]   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[INFO] [talledLocalContainer]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[INFO] [talledLocalContainer]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[INFO] [talledLocalContainer]   at java.lang.Thread.run(Thread.java:745)
[INFO] [talledLocalContainer] Caused by: java.io.IOException: Error parsing class file
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.util.ClassBinaryScanner.scanClassBinary(ClassBinaryScanner.java:66)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.findUsedHostComponents(HostComponentSpri
ngStage.java:194)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.execute(HostComponentSpringStage.java:58
)
[INFO] [talledLocalContainer]   ... 36 more
[INFO] [talledLocalContainer] Caused by: java.lang.ArrayIndexOutOfBoundsException

Google 搜的都不能解决我的问题,于是我的方法是移除我所有的代码,只保留 skeleton,然后一点点的加代码进去,每次跑 atlas-run 之前我都把工程 target 目录下maven产生的文件全部删掉,知道最后才发现原来是我的 dom4j 这个包引入出了问题,代码如下:

<dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.5</version>
            <scope>provided</scope>
        </dependency>

我尝试着先修改版本,改为 1.6 的,结果就好了,真是奇怪。



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Allen_jinjie/article/details/50426252
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭