atlas-run: Unable to scan for host components in plugin clases
Asked by Dani:

I've searched through all available topics in the Atlassian community and couldn't find a resolution.

The error message is:

\[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.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:471)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.plugin.manager.DefaultPluginManager.init(DefaultPluginManager.java:446)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.bamboo.container.BambooContainer.init(BambooContainer.java:206)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.bamboo.container.BambooContainer.initialise(BambooContainer.java:187)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.bamboo.upgrade.UpgradeLauncher.initialiseBambooContainer(UpgradeLauncher.java:185)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.bamboo.upgrade.UpgradeLauncher.upgradeAndStartBamboo(UpgradeLauncher.java:95)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.bamboo.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:40)  
\[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:511)  
\[INFO\] \[talledLocalContainer\] at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
\[INFO\] \[talledLocalContainer\] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
\[INFO\] \[talledLocalContainer\] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
\[INFO\] \[talledLocalContainer\] at java.lang.Thread.run(Thread.java:748)  
\[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(HostComponentSpringStage.java:194)  
\[INFO\] \[talledLocalContainer\] at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.execute(HostComponentSpringStage.java:58)  
\[INFO\] \[talledLocalContainer\] ... 26 more  
\[INFO\] \[talledLocalContainer\] Caused by: java.lang.ArrayIndexOutOfBoundsException: 18  
\[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 com.atlassian.plugin.osgi.util.ClassBinaryScanner.scanClassBinary(ClassBinaryScanner.java:38)  
\[INFO\] \[talledLocalContainer\] ... 28 more

Could anyone help in identifying what is the cause of this?


Answers:
author: Gabriel Ribeiro
body: Hi Dani,

Which java source level are you using to compile your plugin? I'm asking you that because a very similar problem was observed when we were switching from Java 1.7. to 1.8

* [PLUG-1098 - The plugin system fails to load plugins compiled with a java 8 source level](https://ecosystem.atlassian.net/browse/PLUG-1098)

thanks

comments: author: Dani
body: Hey [@Gabriel Ribeiro](/t5/user/viewprofilepage/user-id/352687)

I couldn't find any Java version specified in the pom file, could it be the problem?


author: Gabriel Ribeiro
body: Hi Dani,

Usually, if don't specify the Java version, Maven will use the default JDK option, you can check what's the default version running **mvn -version**in the terminal.

To specify which JDK version you want Maven to use to compile your project, you can set the *-source* and *-target* options in the compiler or, you can add the following parameters to the POM file:

```
<project>

  [...]

  <properties>

  <maven.compiler.source>1.8</maven.compiler.source>

  <maven.compiler.target>1.8</maven.compiler.target>

  </properties>

  [...]

</project>
```

You will find more details in the [Apache Maven Plugin](https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html) documentation.

thanks


author: Dani
body: So I have been using JDK 1.8 to compile, But Bamboo says that for that specific version they support 1.8 JDK version.


Tags: bamboo-app