Warnings plugin extension: how to make it show up and to define input log file

30 views
Skip to first unread message

Simon M

unread,
Jun 6, 2017, 8:16:49 PM6/6/17
to Jenkins Users
So, after getting my own log parser written and built, my next questions are:

1. How to get it to show up when adding a new parser? What needs to be defined for this?
2. How the input file to the parser is defined.

I would very much appreciate any advice on these topics. My present current version (which doesn't show up in the list of Parsers is in:
https://github.com/SimonMatthews-BP/BPWarnings.git

Simon

Slide

unread,
Jun 7, 2017, 9:13:15 AM6/7/17
to Jenkins Users
It should show up after installing your plugin and restarting Jenkins. I checked the source and it looked like you added the @Extension to your parser, so it should get pulled in once the plugin is installed. What do you mean by #2? Are you asking how to use the warnings plugin in general?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/28f0e216-7dca-472f-af11-9766bd1a653e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Slide

unread,
Jun 7, 2017, 9:29:03 AM6/7/17
to Jenkins Users
By the way, you shouldn't need this at all


The ID is one of the parameters you are passing to super in your constructor.

Simon M

unread,
Jun 7, 2017, 10:47:50 AM6/7/17
to Jenkins Users


On Wednesday, June 7, 2017 at 6:13:15 AM UTC-7, slide wrote:
It should show up after installing your plugin and restarting Jenkins. I checked the source and it looked like you added the @Extension to your parser, so it should get pulled in once the plugin is installed. What do you mean by #2? Are you asking how to use the warnings plugin in general?


I realized my misunderstanding which resulted in question #2.

Simon

Simon Matthews

unread,
Jun 7, 2017, 3:03:37 PM6/7/17
to jenkins...@googlegroups.com
I really appreciate the help you have given me.

However, my plugin extension is still not working.

I updated my git repository: https://github.com/SimonMatthews-BP/BPWarnings

The Jenkins log shows the following error:


Jun 07, 2017 6:54:02 PM
hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate
Key[type=hudson.plugins.bluepearl.RunBluePearlParser,
annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Unable to provision, see the
following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError:
hudson.plugins.warnings.parser.Messages._Warnings_runbluepearl_ParserName()Lorg/jvnet/localizer/Localizable;
at hudson.plugins.bluepearl.RunBluePearlParser.<init>(RunBluePearlParser.java:44)

1 error
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:477)
at hudson.ExtensionList.load(ExtensionList.java:365)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
at hudson.ExtensionList.iterator(ExtensionList.java:157)
at hudson.plugins.warnings.parser.ParserRegistry.addParsersWithDeprecatedApi(ParserRegistry.java:69)
at hudson.plugins.warnings.parser.ParserRegistry.all(ParserRegistry.java:62)
at hudson.plugins.warnings.parser.ParserRegistry.getAllParsers(ParserRegistry.java:209)
at hudson.plugins.warnings.parser.ParserRegistry.getParsers(ParserRegistry.java:169)
at hudson.plugins.warnings.parser.ParserRegistry.getParsers(ParserRegistry.java:139)
at hudson.plugins.warnings.parser.ParserRegistry.exists(ParserRegistry.java:186)
at hudson.plugins.warnings.WarningsPublisher.replaceConsoleParsersWithChangedName(WarningsPublisher.java:214)
at hudson.plugins.warnings.WarningsPublisher.readResolve(WarningsPublisher.java:204)
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:498)
at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:66)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:271)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:197)
at hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:273)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
at hudson.util.XStream2.unmarshal(XStream2.java:114)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1053)
at hudson.XmlFile.read(XmlFile.java:143)
at hudson.model.Items.load(Items.java:371)
at jenkins.model.Jenkins$17.run(Jenkins.java:3095)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:1088)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
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.NoSuchMethodError:
hudson.plugins.warnings.parser.Messages._Warnings_runbluepearl_ParserName()Lorg/jvnet/localizer/Localizable;
at hudson.plugins.bluepearl.RunBluePearlParser.<init>(RunBluePearlParser.java:44)
at hudson.plugins.bluepearl.RunBluePearlParser$$FastClassByGuice$$1595dec3.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
... 60 more

Jun 07, 2017 6:54:02 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Jun 07, 2017 6:54:02 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Jun 07, 2017 6:54:02 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Jun 07, 2017 6:54:02 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 4 ms
Jun 07, 2017 6:54:02 PM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.web.context.support.StaticWebApplicationContext@2b119b19:
display name [Root WebApplicationContext]; startup date [Wed Jun 07
18:54:02 GMT 2017]; root of context hierarchy
Jun 07, 2017 6:54:02 PM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.web.context.support.StaticWebApplicationContext@2b119b19]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1ae3c67b
Jun 07, 2017 6:54:02 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1ae3c67b:
defining beans [authenticationManager]; root of factory hierarchy
Jun 07, 2017 6:54:02 PM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.web.context.support.StaticWebApplicationContext@41afa1b0:
display name [Root WebApplicationContext]; startup date [Wed Jun 07
18:54:02 GMT 2017]; root of context hierarchy
Jun 07, 2017 6:54:02 PM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.web.context.support.StaticWebApplicationContext@41afa1b0]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1847c74a
Jun 07, 2017 6:54:02 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1847c74a:
defining beans [filter,legacy]; root of factory hierarchy
Jun 07, 2017 6:54:02 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVdbtzNwVVVmCwac6GjZThrx4bXupEduwsfEboRZR23_qw%40mail.gmail.com.

Simon M

unread,
Jun 7, 2017, 8:22:27 PM6/7/17
to Jenkins Users
Anyone?

As far as I can see the method Messages._Warnings_runbluepearl_ParserName() isn't defined, but looking at other extensions, (for example GccParser), this and similar methods don't appear to be explicitly defined. So, how to define them implicitly?

Simon

Slide

unread,
Jun 8, 2017, 1:51:10 AM6/8/17
to Jenkins Users

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Simon M

unread,
Jun 8, 2017, 2:02:50 AM6/8/17
to Jenkins Users

Slide

unread,
Jun 8, 2017, 10:05:32 AM6/8/17
to Jenkins Users
That's not matching the package layout of your code:

The resources for your class need to be in the same package layout, since you have your code in:
src/main/java/hudson/plugins/bluepearl

Your resource would need to be in 

src/main/resources/hudson/plugins/bluepearl  

Simon M

unread,
Jun 8, 2017, 7:17:56 PM6/8/17
to Jenkins Users
Thanks for the suggestion.

I made the changes (see repository https://github.com/SimonMatthews-BP/BPWarnings), but I still get the same error. 

The repository version uses src/main/java/hudson/plugins/warnings/parser/RunBluePearlParser.java and src/main/resources/hudson/plugins/warnings/parser/Messages.properties for the paths, but I also tried the exact paths you suggested.

I tried adding my code to the warnings-plugin source and building that. This approach worked: my new parser shows up and works.

Simon
Reply all
Reply to author
Forward
0 new messages