Failing to install developed plugin

213 views
Skip to first unread message

mohan kumar Muddana

unread,
Sep 5, 2013, 4:02:08 PM9/5/13
to jenkin...@googlegroups.com
Hi,
I have developed a plugin on windows for version 1.509.2.
It works perfectly fine on Windows and Ubuntu.
It also worked on 1.428, 1.528 Jenkins version.

However when giving it to customer for testing it fails to install with the following exception.

lib\classes.jar might need to be rebuilt: java.lang.ClassNotFoundException (I mean the main project class file)
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:628)
at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617)
No jobs created so workspace folder.

Built the plugin using skiptests package maven command.

Is it something to do with JRE. Or, some extensions annotations in our code?

Help is appreciated in advance.

Thanks
Mohan



mohan kumar Muddana

unread,
Sep 5, 2013, 4:18:46 PM9/5/13
to jenkin...@googlegroups.com
Also there are two file which are being created in plugins\pluginname\WEB-INF\classes\META-INF\annotations
One is hudson.Extension the other is org.kohsuke.stapler.export.ExportedBean

Let me know if any additional info required.

Thanks in advance.

mohan kumar Muddana

unread,
Sep 11, 2013, 3:21:10 AM9/11/13
to jenkin...@googlegroups.com
No response yet. I suspect the information provided may be not enough.
Please let me know what further info is required to help me out.

Thanks in advance.
Mohan

Jesse Glick

unread,
Sep 13, 2013, 1:44:25 PM9/13/13
to jenkin...@googlegroups.com
On Thu, Sep 5, 2013 at 4:02 PM, mohan kumar Muddana <moha...@gmail.com> wrote:
> lib\classes.jar might need to be rebuilt: java.lang.ClassNotFoundException
> (I mean the main project class file)
> at net.java.sezpoz.IndexItem.element(IndexItem.java:144)

Something is very wrong with your class loading: your
@Extension-annotated plugin class seems to be present on the JRE’s
boot classpath. Or at least that is my reading of the exception. I
cannot really guess at what is actually going on.

mohan kumar Muddana

unread,
Sep 14, 2013, 7:24:50 AM9/14/13
to jenkin...@googlegroups.com
Thanks Jesse,
If your guess is right, how to avoid it.
Because I assume we are packaging proper hpi file and Jenkins takes care of loading the classes appropriately.
Now after skipping tests while packaging it gives exception for classes.jar being not found.

Noticed that two things happen:
1) If Jenkins server is started with war, classes.jar is present in the lib folder of the plugin.
2) If Jenkins is started as windows services (after normal windows installation) the classes are exploded to the plugin directory.

Quite not sure in which scenarios it might be looking for classes.jar or exploded class files.

Thanks
Mohan


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/za3PR_2KFTo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jesse Glick

unread,
Sep 15, 2013, 8:13:22 AM9/15/13
to jenkin...@googlegroups.com
On Sat, Sep 14, 2013 at 7:24 AM, mohan kumar Muddana
<moha...@gmail.com> wrote:
> If Jenkins server is started with war, classes.jar is present in the lib folder of the plugin.

classes.jar? From the JRE? Bizarre. Did you perhaps declare a
dependency on classes.jar in your POM (for some reason I cannot guess)
and fail to mark it <scope>provided</scope>?

mohan kumar Muddana

unread,
Sep 15, 2013, 9:35:47 AM9/15/13
to jenkin...@googlegroups.com
Hi Jesse thanks for your support.
There is no dependency mentioned in pom file.

Initially we got exception as "Failed to scout com.mobilecloud.project.MobileCloudProject"
java.lang.InstantiationException: file:/N:/Jenkins/plugins/MobileCloudPlugin/WEB-INF/classes/META-INF/annotations/hudson.Extension might need to be rebuilt: java.lang.ClassNotFoundException: com.mobilecloud.project.MobileCloudProject

After we did package the hpi using -DskipTests package using maven command this error has gone.

Now it gives (I guess it is on a different machine)
WARNING: Failed to load com.mobilecloud.project.MobileCloudProject
java.lang.InstantiationException: C:\Users\.jenkins\plugins\mobilecloud\WEB-INF\lib\classes.jar might need to be rebuilt:    java.lang.ClassNotFoundException: com.mobilecloud.project.MobileCloudProject
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)

Jesse: Any guesses.

We are building package using maven command line. Do you think it is something to do with how we are building the plugin.
Problem is it run perfectly on our machines (both Windows and Ubuntu) and it is on our client machine which gives these exceptions, which is also becoming difficult for us to understand what exactly is happening as we don't have access to it.

Thanks
Mohan



Baptiste Mathus

unread,
Sep 16, 2013, 2:44:05 AM9/16/13
to jenkin...@googlegroups.com


Le 15 sept. 2013 15:35, "mohan kumar Muddana" <moha...@gmail.com> a écrit :
>
> Hi Jesse thanks for your support.
> There is no dependency mentioned in pom file.
>
> Initially we got exception as "Failed to scout com.mobilecloud.project.MobileCloudProject"
> java.lang.InstantiationException: file:/N:/Jenkins/plugins/MobileCloudPlugin/WEB-INF/classes/META-INF/annotations/hudson.Extension might need to be rebuilt: java.lang.ClassNotFoundException: com.mobilecloud.project.MobileCloudProject
>
> After we did package the hpi using -DskipTests package using maven command this error has gone.

I would personally stop there first. You should better fix your tests before you try deploying your plugin. Moreover, who knows, the tests currently failing might already be showing the cause of your issue.

Cheers


>
> Now it gives (I guess it is on a different machine)
> WARNING: Failed to load com.mobilecloud.project.MobileCloudProject
> java.lang.InstantiationException: C:\Users\.jenkins\plugins\mobilecloud\WEB-INF\lib\classes.jar might need to be rebuilt:    java.lang.ClassNotFoundException: com.mobilecloud.project.MobileCloudProject
> at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
>
> Jesse: Any guesses.
>
> We are building package using maven command line. Do you think it is something to do with how we are building the plugin.
> Problem is it run perfectly on our machines (both Windows and Ubuntu) and it is on our client machine which gives these exceptions, which is also becoming difficult for us to understand what exactly is happening as we don't have access to it.
>
> Thanks
> Mohan
>
>
>
> On Sun, Sep 15, 2013 at 5:43 PM, Jesse Glick <jgl...@cloudbees.com> wrote:
>>
>> On Sat, Sep 14, 2013 at 7:24 AM, mohan kumar Muddana
>> <moha...@gmail.com> wrote:
>> > If Jenkins server is started with war, classes.jar is present in the lib folder of the plugin.
>>
>> classes.jar? From the JRE? Bizarre. Did you perhaps declare a
>> dependency on classes.jar in your POM (for some reason I cannot guess)
>> and fail to mark it <scope>provided</scope>?
>>
>> --
>> You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/za3PR_2KFTo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --

> 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-de...@googlegroups.com.

evernat

unread,
Sep 16, 2013, 5:20:06 PM9/16/13
to jenkin...@googlegroups.com, bma...@batmat.net
For information, it's not classes.jar from the JRE.
It's WEB-INF/lib/classes.jar and they are now created in Jenkins for each plugin, to be remoting friendly.
Since https://github.com/jenkinsci/jenkins/commit/f7330d7a158eff6705706b1f812993a9b918c351

Emeric

Jesse Glick

unread,
Sep 16, 2013, 6:20:12 PM9/16/13
to jenkin...@googlegroups.com
On Mon, Sep 16, 2013 at 5:20 PM, evernat <eve...@free.fr> wrote:
> It's WEB-INF/lib/classes.jar and they are now created in Jenkins for each
> plugin, to be remoting friendly.

So that is a possible explanation for the bug: the repacking might
produce different content somehow.

mohan kumar Muddana

unread,
Sep 17, 2013, 3:32:04 AM9/17/13
to jenkin...@googlegroups.com
I assume the following commands will try to resolve, but not quite confident.

mvn clean compile
mvn clean -DskipTests=true package

Also a failed/older plugin installation leaves the .jpi  file as well exploded folder as it is.
So, deleting these older ones might also help it seems.

What do you say?

Thanks
Mohan

Baptiste Mathus

unread,
Sep 18, 2013, 2:38:43 AM9/18/13
to jenkin...@googlegroups.com


Le 17 sept. 2013 09:32, "mohan kumar Muddana" <moha...@gmail.com> a écrit :
>
> I assume the following commands will try to resolve, but not quite confident.
>
> mvn clean compile

Useless. Next command you give already includes the compilation phase.

> mvn clean -DskipTests=true package

Again, why would you skip the tests of your plugin?

mohan kumar Muddana

unread,
Oct 3, 2013, 3:12:01 AM10/3/13
to jenkin...@googlegroups.com, bma...@batmat.net
Hi,
Even if we don't skip tests and hand over the package (hpi) as it is, still gives the exception while installation of the plugin.

hudson.ExtensionFinder$Sezpoz scout
WARNING: Failed to scout com.mobilecloud.project.MobileCloudProject java.lang.InstantiationException: file:/N:/Jenkins/plugins/mobilecloud/WEB-INF/classes/META-INF/annotations/hudson.Extension might need to be rebuilt:

Quite not sure whether existing plugins causing it or any other plugin needs to be installed.
Any pointers will be highly appreciated.

Thanks
Mohan

Han Qin

unread,
Nov 20, 2013, 10:16:43 AM11/20/13
to jenkin...@googlegroups.com, bma...@batmat.net
hello,

We met similar issue, have you checked the JDK version where you build the hpi and also the JDK version of your jenkins env.

Just to clarify, we built the hpi with JDK7 and found installation of the plugin failed on a jenkins server with JDK6.

hope this helps.

mohan kumar Muddana

unread,
Nov 21, 2013, 2:52:22 AM11/21/13
to jenkin...@googlegroups.com, bma...@batmat.net
Hi Han,
It was very kind of you to reply and mention about the issue and solution. We found out that classes.jar was missing when the plugin is exploded during its installation. However we have another issue right now is our clients are using the plugin within Proxy server for which it is unable to connect to a service endpoint outside.

Thanks anyway
Mohan



--

Gabi Karasin

unread,
Dec 9, 2013, 7:33:24 AM12/9/13
to jenkin...@googlegroups.com
Hi,

I had the same error and As Han Qin said, What solved the issue was upgrading the JDK.

Thanks a lot!
Reply all
Reply to author
Forward
0 new messages