I think you should still prefer trying to extract the gist of your code and
create a PR or something reviewable online to maximize your chances to get
feedback, ideally on GitHub where it's easy to do. Reviewing code in emails
is a quite a bit cumbersome.

After a quick glance at the code, aren't you missing the @Extension
annotation?

2017-08-08 8:23 GMT+02:00 Nikhil Bhoski <nikhil.bho...@gmail.com>:

> Thanks Oleg , could not share my code due to organizational policies
> however . My moto is to create one top level Item (new project type) which
> is similar to freestyle project & whenever a job is created using this
> project it should get invoked . i have referred to  jenkins freestyle
> project & freestly build class to design my own project type. i have used
> the exact  same methods and constructors in my project & build file . my
> project class is like as below
>
> public class MatlabItemp extends Project<MatlabItemp, MatlabItemBuild>
> implements TopLevelItem {
>
>
> public MatlabItemp(ItemGroup parent, String name) {
> super(parent, name);
>
> }
>
>
>
>
>
> @Override
> public TopLevelItemDescriptor getDescriptor() {
>
> return (TopLevelItemDescriptor)Jenkins.getInstance().
> getDescriptorOrDie(getClass());
> }
>
> @Override
> protected Class<MatlabItemBuild> getBuildClass() {
>
> return MatlabItemBuild.class;
> }
>
> /-----------------------------------------------------------
> -----------------------End----------------------------------
> ------------------------------------------------------------
> --------------------------------/
>
> and my build class is like below
>
> public class MatlabItemBuild extends Build<MatlabItemp, MatlabItemBuild> {
>
> protected MatlabItemBuild(MatlabItemp project) throws IOException {
> super(project);
> }
>
>
>
>
> public MatlabItemBuild(MatlabItemp job, Calendar timestamp) {
> super(job, timestamp);
>
> }
>
>
>
>
> public MatlabItemBuild(MatlabItemp project, File buildDir) throws
> IOException {
> super(project, buildDir);
> }
>
>
>
> @Override
> public void run() {
>
>
> super.run();
>
>
> /-----------------------------------------------------------
> --------------------------------------------------------------------------------End
> ------------------------------------------------------------
> ------------------------------------------------------------
>
>
> On Monday, 7 August 2017 17:17:44 UTC+5:30, Oleg Nenashev wrote:
>>
>> You will unlikely get help here without sharing a link to your code.
>> My guess is that you use the default BuildMixIn type without providing a
>> constructor required for it
>>
>> понедельник, 7 августа 2017 г., 7:08:18 UTC+2 пользователь Nikhil Bhoski
>> написал:
>>>
>>> Hi ,
>>>
>>> I have created new project type . which invokes the appropriate build
>>> class to run the build . however i am receiving below error and the build
>>> wont get invoked . could someone pls help ?.
>>>
>>> java.lang.Error: java.lang.NoSuchMethodException:
>>> matlabjenkins.matlabjnk.MatlabItemBuild.<init>(matlabjenkins
>>> .matlabjnk.MatlabItem)
>>>         at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.
>>> java:188)
>>>         at hudson.model.AbstractProject.newBuild(AbstractProject.java:1
>>> 019)
>>>         at hudson.model.AbstractProject.createExecutable(AbstractProjec
>>> t.java:1209)
>>>         at hudson.model.AbstractProject.createExecutable(AbstractProjec
>>> t.java:145)
>>>         at hudson.model.Executor$1.call(Executor.java:362)
>>>         at hudson.model.Executor$1.call(Executor.java:344)
>>>         at hudson.model.Queue._withLock(Queue.java:1404)
>>>         at hudson.model.Queue.withLock(Queue.java:1269)
>>>         at hudson.model.Executor.run(Executor.java:344)
>>> Caused by: java.lang.NoSuchMethodException:
>>> matlabjenkins.matlabjnk.MatlabItemBuild.<init>(matlabjenkins
>>> .matlabjnk.MatlabItem)
>>>         at java.lang.Class.getConstructor0(Class.java:3082)
>>>         at java.lang.Class.getConstructor(Class.java:1825)
>>>         at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.
>>> java:177)
>>>
>>>
>>> I am using super.run in build class of mine and all the constructors in
>>> Build<?,?> classes are defined in my build file . <init> method may be due
>>> to no default constructor in build class . how can i resolve this and get
>>> this build invoked .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/1d12c8bc-5686-4073-bb5c-30be0417606b%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/1d12c8bc-5686-4073-bb5c-30be0417606b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS4kWQU8oTAWFgDO-PM_nVh2u2UKZK3%2BZWu2WwxXhGfRrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to