"java.lang.IllegalStateException: Unable to read plugin manifest from jar" while starting sonarqube 5.6.2 server

已查看 1,265 次
跳至第一个未读帖子

ST

未读,
2016年12月14日 01:26:552016/12/14
收件人 SonarQube
Hello all,

I am facing below issue when starting sonarqube 5.6.2 server.
"java.lang.IllegalStateException: Unable to read plugin manifest from jar"

and here is my log file contents

2016.12.13 18:38:45 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Unable to read plugin manifest from jar : C:\Documents\SOFTWARES\sonarqube-5.6.2\extensions\plugins\XXX-sonar-plugin-1.0.1-SNAPSHOT.jar
at org.sonar.updatecenter.common.PluginManifest.<init>(PluginManifest.java:113) ~[sonar-update-center-common-1.13.jar:na]
at org.sonar.core.platform.PluginInfo.create(PluginInfo.java:366) ~[sonar-core-5.6.2.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.loadPreInstalledPlugins(ServerPluginRepository.java:136) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:112) ~[sonar-server-5.6.2.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.2.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.2.jar:na]
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:182) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.platform.Platform.init(Platform.java:91) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43) ~[sonar-server-5.6.2.jar:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
Caused by: java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:406) ~[na:1.8.0_102]
at java.util.jar.Manifest.read(Manifest.java:199) ~[na:1.8.0_102]
at java.util.jar.Manifest.<init>(Manifest.java:69) ~[na:1.8.0_102]
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:194) ~[na:1.8.0_102]
at java.util.jar.JarFile.getManifest(JarFile.java:180) ~[na:1.8.0_102]
at org.sonar.updatecenter.common.PluginManifest.<init>(PluginManifest.java:109) ~[sonar-update-center-common-1.13.jar:na]
... 32 common frames omitted
2016.12.13 18:38:45 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2016.12.13 18:38:45 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2016.12.13 18:38:45 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.12.13 18:38:45 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2016.12.13 18:38:45 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.12.13 18:38:45 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.2.jar:na]
at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.2.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.2.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server-5.6.2.jar:na]
2016.12.13 18:38:45 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.12.13 18:38:47 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.12.13 18:38:47 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.12.13 18:38:47 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2016.12.13 18:38:47 INFO  app[o.s.p.m.Monitor] Process[es] is stopping
2016.12.13 18:38:48 INFO   es[o.s.p.StopWatcher]  Stopping process
2016.12.13 18:38:48 INFO   es[o.elasticsearch.node]  [sonar-1481634511733] stopping ...
2016.12.13 18:38:48 INFO   es[o.elasticsearch.node]  [sonar-1481634511733] stopped
2016.12.13 18:38:48 INFO   es[o.elasticsearch.node]  [sonar-1481634511733] closing ...
2016.12.13 18:38:48 INFO   es[o.elasticsearch.node]  [sonar-1481634511733] closed
2016.12.13 18:38:49 INFO  app[o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped


my plugin has 'org.codehaus.sonar.sslr-squid-bridge' as a maven dependency in pom.xml.
I get above error for the dependency version 2.6 and I do not get this error for the dependency version 2.5.3
Could you please help me on this?

Scott B.

未读,
2016年12月14日 05:18:082016/12/14
收件人 SonarQube
Hi.

It seems that your .jar is invalid (missing or invalid MANIFEST.MF. Nothing to do with SonarQube itself.

By the way, to use the latest version of sslr-squid-bridge you can use this:

<dependency>
  <groupId>org.sonarsource.sslr-squid-bridge</groupId>
  <artifactId>sslr-squid-bridge</artifactId>
  <version>2.6.1</version>
  <exclusions>
      <exclusion>
          <groupId>org.codehaus.sonar</groupId>
          <artifactId>sonar-plugin-api</artifactId>
      </exclusion>
  </exclusions>
</dependency>

ST

未读,
2016年12月14日 05:46:082016/12/14
收件人 SonarQube
Hello Scott B,

I tried using below dependency in pom.xml replacing old one
However it is giving same error as earlier :(

Regards,
Swati

ST

未读,
2016年12月16日 08:39:482016/12/16
收件人 SonarQube
Hello,
Hello all,

as the Codehaus forge shut down and conflicts of version are not resolved by Maven. 
I have removed the library sslr-squid-bridge which brings a transitive dependency on a old sonar-plugin-api 4.5.1
Now there are no errors related to 'com.google.common.base' classes

However I am still facing below error

can you please also check attachment for pom.xml and build-logs.

2016.12.16 18:43:19 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Unable to read plugin manifest from jar : C:\Users\A602312\Documents\SOFTWARES\sonarqube-5.6.2\extensions\plugins\jdoctor-sonar-plugin-1.0.1-SNAPSHOT.jar
pom.xml
build_logs.txt

Simon Brandhof

未读,
2016年12月16日 08:51:182016/12/16
收件人 ST、SonarQube
Apparently the configuration <archive/manifest> of maven-jar-plugin conflicts with sonar-packaging-maven-plugin. Could you verify by disabling it ?

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/2f8028c4-a8af-4f5a-9fd0-00c479123aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

ST

未读,
2016年12月16日 09:28:112016/12/16
收件人 SonarQube、thakare...@gmail.com
No, it does not work. I disabled the tag <addDefaultImplementationEntries>

                                     <configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Build-Date>${maven.build.timestamp}</Build-Date>
</manifestEntries>
</archive>
</configuration>

ST

未读,
2016年12月16日 09:38:012016/12/16
收件人 SonarQube、thakare...@gmail.com
I also tried by commenting whole configuration below.

Simon Brandhof

未读,
2016年12月16日 09:53:292016/12/16
收件人 ST、SonarQube
At that point I suggest that you build the sample plugin : https://github.com/SonarSource/sonar-custom-plugin-example
then compare the generated META-INF/MANIFEST file with yours. I hope it will help you to find the root cause of issue.
Thanks


For more options, visit https://groups.google.com/d/optout.

ST

未读,
2016年12月21日 04:22:482016/12/21
收件人 SonarQube、thakare...@gmail.com
Hello Simon,

I managed to resolve the issue.
The issue was due to value of the tag <pluginDescription> in the pom.xml
The description (tag value) was given on two lines.
as manifest file expects format like header field and value.
I make the description on single line and it works now. 

Thanks,
Swati

Simon Brandhof

未读,
2017年1月21日 09:50:212017/1/21
收件人 ST、SonarQube
Good to know Swati. Thanks for the feedback. Bug is referenced at https://jira.sonarsource.com/browse/PACKMP-8.

Regards


For more options, visit https://groups.google.com/d/optout.
回复全部
回复作者
转发
0 个新帖子