FTP Publisher: NullPointer exception.

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

FTP Publisher: NullPointer exception.

townsfolk
Hi, I updated my hudson instance today - after a couple of months, and a FTPPublisher update came along with it.

Now all the builds have become "unstable" because the files couldn't be published.

The console's show:
[quote]
ERROR: Failed to upload files
java.lang.NullPointerException
    at com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
    at hudson.model.Build$RunnerImpl.post2(Build.java:158)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
    at hudson.model.Run.run(Run.java:1280)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:129)
[/quote]

This setup was working perfectly before I performed the update.

I checked the settings and everything was still set up as it was before the update - I didn't modify the settings after the update.

Is anyone else experiencing the same issue, or have a fix. If not, I'll submit a jira ticket.

Any help would be greatly appreciated.

Thanks,
Eric

--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Kedar Mhaswade-3
On 07/20/2010 04:40 PM, Eric Berry wrote:

> Hi, I updated my hudson instance today - after a couple of months, and
> a FTPPublisher update came along with it.
>
> Now all the builds have become "unstable" because the files couldn't
> be published.
>
> The console's show:
> [quote]
> ERROR: Failed to upload files
> java.lang.NullPointerException
>     at
> com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>     at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>     at
> hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
>     at
> hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
>     at
> hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
>     at hudson.model.Build$RunnerImpl.post2(Build.java:158)
>     at
> hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
>     at hudson.model.Run.run(Run.java:1280)
>     at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>     at hudson.model.ResourceController.execute(ResourceController.java:88)
>     at hudson.model.Executor.run(Executor.java:129)
> [/quote]
>
> This setup was working perfectly before I performed the update.
>
> I checked the settings and everything was still set up as it was
> before the update - I didn't modify the settings after the update.
>
> Is anyone else experiencing the same issue, or have a fix. If not,
> I'll submit a jira ticket.
>
> Any help would be greatly appreciated.

More information is needed. The code line (FTPPublisher:150) where NPE
generates is:
EntryCopier copier = new EntryCopier(build, listener, ftpsite, flatten,
useTimestamps);

Out of that, last two are booleans, so they are not the source of NPE.
The third argument is not null because
if it were null, you would have gotten NPE before this line (the code
tries to log ftp site's host name). That means
either build, listener or something therein generates an NPE.

Can you check to see what the log file says? (Maybe compare the logs
from two builds - the last successful one and
the failing one)? They are at:
<hudson-home>/jobs/<job-name>/builds/<build-number>.

Hope that helps.

-Kedar

>
> Thanks,
> Eric
>
> --
> Learn from the past. Live in the present. Plan for the future.
> Blog: http://www.townsfolkdesigns.com/blogs/elberry
> jEdit <http://www.jedit.org> - Programmer's Text Editor
> Bazaar <http://bazaar.canonical.com> - Version Control for Humans


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

townsfolk
Hi Kedar,
    Thank you so much for the quick reply.

I looked in the logs under the builds directory. The one from yesterday (successful) and today have minimal differences. The differences include the change set, the shell script name, and then the error. There wasn't any more to the exception than below.

Is there another place where logs can be found that might be helpful?

I do see the ftp site being logged - so that's not null.

What would cause the build, or listener to be null?

On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net@gmail.com> wrote:
On 07/20/2010 04:40 PM, Eric Berry wrote:
[quote]
ERROR: Failed to upload files
java.lang.NullPointerException
   at com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
   at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
   at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
   at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
   at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
   at hudson.model.Build$RunnerImpl.post2(Build.java:158)
   at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
   at hudson.model.Run.run(Run.java:1280)
   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
   at hudson.model.ResourceController.execute(ResourceController.java:88)
   at hudson.model.Executor.run(Executor.java:129)
[/quote]

More information is needed. The code line (FTPPublisher:150) where NPE generates is:
EntryCopier copier = new EntryCopier(build, listener, ftpsite, flatten, useTimestamps);

Out of that, last two are booleans, so they are not the source of NPE. The third argument is not null because
if it were null, you would have gotten NPE before this line (the code tries to log ftp site's host name). That means
either build, listener or something therein generates an NPE.

Can you check to see what the log file says? (Maybe compare the logs from two builds - the last successful one and
the failing one)? They are at: <hudson-home>/jobs/<job-name>/builds/<build-number>.

Hope that helps.

-Kedar



--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Kedar Mhaswade-3
On 07/20/2010 06:28 PM, Eric Berry wrote:

> Hi Kedar,
>     Thank you so much for the quick reply.
>
> I looked in the logs under the builds directory. The one from
> yesterday (successful) and today have minimal differences. The
> differences include the change set, the shell script name, and then
> the error. There wasn't any more to the exception than below.
>
> Is there another place where logs can be found that might be helpful?
>
> I do see the ftp site being logged - so that's not null.
>
> What would cause the build, or listener to be null?
Hmmm. Strange. I was looking at the latest source. I am hoping that that
is what
relates to the plugin version you're using. Can you tell me the version
of the plugin (that you
see under Installed Plugins page?)

The reason I think this is strange is the line where stack trace
originates can't throw an NPE. That
line constructs an instance of EntryCopier which may generate (possibly)
an NPE. So the trace should
start with something like:
java.lang.NullPointerException
    at EntryCopier.<Init> (EntryCopier.java:xxx).
    at com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
...

(This is of course if I am looking at the correct source code associated
with the plugin version
you are using).

>
> On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net
> <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:
>
>     On 07/20/2010 04:40 PM, Eric Berry wrote:
>
>         [quote]
>         ERROR: Failed to upload files
>         java.lang.NullPointerException
>            at
>         com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>            at
>         hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>            at
>         hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
>            at
>         hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
>            at
>         hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
>            at hudson.model.Build$RunnerImpl.post2(Build.java:158)
>            at
>         hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
>            at hudson.model.Run.run(Run.java:1280)
>            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>            at
>         hudson.model.ResourceController.execute(ResourceController.java:88)
>            at hudson.model.Executor.run(Executor.java:129)
>         [/quote]
>
>
>     More information is needed. The code line (FTPPublisher:150) where
>     NPE generates is:
>     EntryCopier copier = new EntryCopier(build, listener, ftpsite,
>     flatten, useTimestamps);
>
>     Out of that, last two are booleans, so they are not the source of
>     NPE. The third argument is not null because
>     if it were null, you would have gotten NPE before this line (the
>     code tries to log ftp site's host name). That means
>     either build, listener or something therein generates an NPE.
>
>     Can you check to see what the log file says? (Maybe compare the
>     logs from two builds - the last successful one and
>     the failing one)? They are at:
>     <hudson-home>/jobs/<job-name>/builds/<build-number>.
>
>     Hope that helps.
>
>     -Kedar
>
>
>
> --
> Learn from the past. Live in the present. Plan for the future.
> Blog: http://www.townsfolkdesigns.com/blogs/elberry
> jEdit <http://www.jedit.org> - Programmer's Text Editor
> Bazaar <http://bazaar.canonical.com> - Version Control for Humans


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

townsfolk
The installed version says 1.0.

I haven't updated in months, so I think it's the same as the latest release:
http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin

Could the problem be originating from some changes in hudson?
My current hudson version is 1.367

On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net@gmail.com> wrote:
On 07/20/2010 06:28 PM, Eric Berry wrote:
Hi Kedar,
   Thank you so much for the quick reply.

I looked in the logs under the builds directory. The one from yesterday (successful) and today have minimal differences. The differences include the change set, the shell script name, and then the error. There wasn't any more to the exception than below.

Is there another place where logs can be found that might be helpful?

I do see the ftp site being logged - so that's not null.

What would cause the build, or listener to be null?
Hmmm. Strange. I was looking at the latest source. I am hoping that that is what
relates to the plugin version you're using. Can you tell me the version of the plugin (that you
see under Installed Plugins page?)

The reason I think this is strange is the line where stack trace originates can't throw an NPE. That
line constructs an instance of EntryCopier which may generate (possibly) an NPE. So the trace should
start with something like:
java.lang.NullPointerException
  at EntryCopier.<Init> (EntryCopier.java:xxx).

  at com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
...

(This is of course if I am looking at the correct source code associated with the plugin version
you are using).



On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:

   On 07/20/2010 04:40 PM, Eric Berry wrote:

       [quote]
       ERROR: Failed to upload files
       java.lang.NullPointerException
          at
       com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
          at
       hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at
       hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
          at
       hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
          at
       hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
          at hudson.model.Build$RunnerImpl.post2(Build.java:158)
          at
       hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
          at hudson.model.Run.run(Run.java:1280)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at
       hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:129)
       [/quote]


   More information is needed. The code line (FTPPublisher:150) where
   NPE generates is:
   EntryCopier copier = new EntryCopier(build, listener, ftpsite,
   flatten, useTimestamps);

   Out of that, last two are booleans, so they are not the source of
   NPE. The third argument is not null because
   if it were null, you would have gotten NPE before this line (the
   code tries to log ftp site's host name). That means
   either build, listener or something therein generates an NPE.

   Can you check to see what the log file says? (Maybe compare the
   logs from two builds - the last successful one and
   the failing one)? They are at:
   <hudson-home>/jobs/<job-name>/builds/<build-number>.

   Hope that helps.

   -Kedar



--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Alan Harder-2
What if you re-save the project config?  Does that help?

"Out of that, last two are booleans, so they are not the source of NPE"

-- actually, the variables there are Boolean, not boolean, so I suspect
one of them IS the source of the NPE.. as you mentioned, if the other
values were null then java would happily pass them along into the
constructor (and may get NPE on some line there).. however, when java
auto-converts Boolean to boolean to pass into the constructor it can get
NPE if the Boolean is null.

So, perhaps re-saving the project config will get a non-null value back
into those 2 fields.

    - Alan



Eric Berry wrote:

> The installed version says 1.0.
>
> I haven't updated in months, so I think it's the same as the latest
> release:
> http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin
>
> Could the problem be originating from some changes in hudson?
> My current hudson version is 1.367
>
> On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net
> <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:
>
>     On 07/20/2010 06:28 PM, Eric Berry wrote:
>
>         Hi Kedar,
>            Thank you so much for the quick reply.
>
>         I looked in the logs under the builds directory. The one from
>         yesterday (successful) and today have minimal differences. The
>         differences include the change set, the shell script name, and
>         then the error. There wasn't any more to the exception than below.
>
>         Is there another place where logs can be found that might be
>         helpful?
>
>         I do see the ftp site being logged - so that's not null.
>
>         What would cause the build, or listener to be null?
>
>     Hmmm. Strange. I was looking at the latest source. I am hoping
>     that that is what
>     relates to the plugin version you're using. Can you tell me the
>     version of the plugin (that you
>     see under Installed Plugins page?)
>
>     The reason I think this is strange is the line where stack trace
>     originates can't throw an NPE. That
>     line constructs an instance of EntryCopier which may generate
>     (possibly) an NPE. So the trace should
>     start with something like:
>     java.lang.NullPointerException
>       at EntryCopier.<Init> (EntryCopier.java:xxx).
>
>       at
>     com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>     ...
>
>     (This is of course if I am looking at the correct source code
>     associated with the plugin version
>     you are using).
>
>
>
>         On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net
>         <http://kedar.java.net> <http://kedar.java.net>@gmail.com
>         <http://gmail.com> <http://gmail.com>> wrote:
>
>            On 07/20/2010 04:40 PM, Eric Berry wrote:
>
>                [quote]
>                ERROR: Failed to upload files
>                java.lang.NullPointerException
>                   at
>              
>          com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>                   at
>              
>          hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>                   at
>              
>          hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
>                   at
>              
>          hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
>                   at
>              
>          hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
>                   at hudson.model.Build$RunnerImpl.post2(Build.java:158)
>                   at
>              
>          hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
>                   at hudson.model.Run.run(Run.java:1280)
>                   at
>         hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>                   at
>              
>          hudson.model.ResourceController.execute(ResourceController.java:88)
>                   at hudson.model.Executor.run(Executor.java:129)
>                [/quote]
>
>
>            More information is needed. The code line
>         (FTPPublisher:150) where
>            NPE generates is:
>            EntryCopier copier = new EntryCopier(build, listener, ftpsite,
>            flatten, useTimestamps);
>
>            Out of that, last two are booleans, so they are not the
>         source of
>            NPE. The third argument is not null because
>            if it were null, you would have gotten NPE before this line
>         (the
>            code tries to log ftp site's host name). That means
>            either build, listener or something therein generates an NPE.
>
>            Can you check to see what the log file says? (Maybe compare the
>            logs from two builds - the last successful one and
>            the failing one)? They are at:
>            <hudson-home>/jobs/<job-name>/builds/<build-number>.
>
>            Hope that helps.
>
>            -Kedar
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

townsfolk
Hi Alan,
   Thank you very much, this fixed the issue. There were two new options under the FTP section on each project that weren't there previously.

Actually, from an upgrade standpoint this was not the best experience, the new plugin works quite differently than the last version I had.

Not only did I need to check both of these options, I also needed to change the destination directories to include the job name in order to have it function the same as it did prior to upgrading. The previous version automatically created sub directories for the job name, and the timestamp. It also put the artifacts directly under those directories. I now need to go through each of my 30 jobs and change these settings.

Regardless, thank you very much for helping me fix the issue.

Cheers,
Eric

On Wed, Jul 21, 2010 at 10:15 AM, Alan Harder <[hidden email]> wrote:
What if you re-save the project config?  Does that help?


"Out of that, last two are booleans, so they are not the source of NPE"

-- actually, the variables there are Boolean, not boolean, so I suspect one of them IS the source of the NPE.. as you mentioned, if the other values were null then java would happily pass them along into the constructor (and may get NPE on some line there).. however, when java auto-converts Boolean to boolean to pass into the constructor it can get NPE if the Boolean is null.

So, perhaps re-saving the project config will get a non-null value back into those 2 fields.

  - Alan



Eric Berry wrote:
The installed version says 1.0.

I haven't updated in months, so I think it's the same as the latest release:
http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin

Could the problem be originating from some changes in hudson?
My current hudson version is 1.367

On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:

   On 07/20/2010 06:28 PM, Eric Berry wrote:

       Hi Kedar,
          Thank you so much for the quick reply.

       I looked in the logs under the builds directory. The one from
       yesterday (successful) and today have minimal differences. The
       differences include the change set, the shell script name, and
       then the error. There wasn't any more to the exception than below.

       Is there another place where logs can be found that might be
       helpful?

       I do see the ftp site being logged - so that's not null.

       What would cause the build, or listener to be null?

   Hmmm. Strange. I was looking at the latest source. I am hoping
   that that is what
   relates to the plugin version you're using. Can you tell me the
   version of the plugin (that you
   see under Installed Plugins page?)

   The reason I think this is strange is the line where stack trace
   originates can't throw an NPE. That
   line constructs an instance of EntryCopier which may generate
   (possibly) an NPE. So the trace should
   start with something like:
   java.lang.NullPointerException
     at EntryCopier.<Init> (EntryCopier.java:xxx).

     at
   com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
   ...

   (This is of course if I am looking at the correct source code
   associated with the plugin version
   you are using).



       On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net
       <http://kedar.java.net> <http://kedar.java.net>@gmail.com

       <http://gmail.com> <http://gmail.com>> wrote:

          On 07/20/2010 04:40 PM, Eric Berry wrote:

              [quote]
              ERROR: Failed to upload files
              java.lang.NullPointerException
                 at
                     com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
                 at
                     hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
                 at hudson.model.Build$RunnerImpl.post2(Build.java:158)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
                 at hudson.model.Run.run(Run.java:1280)
                 at
       hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
                 at
                     hudson.model.ResourceController.execute(ResourceController.java:88)
                 at hudson.model.Executor.run(Executor.java:129)
              [/quote]


          More information is needed. The code line
       (FTPPublisher:150) where
          NPE generates is:
          EntryCopier copier = new EntryCopier(build, listener, ftpsite,
          flatten, useTimestamps);

          Out of that, last two are booleans, so they are not the
       source of
          NPE. The third argument is not null because
          if it were null, you would have gotten NPE before this line
       (the
          code tries to log ftp site's host name). That means
          either build, listener or something therein generates an NPE.

          Can you check to see what the log file says? (Maybe compare the
          logs from two builds - the last successful one and
          the failing one)? They are at:
          <hudson-home>/jobs/<job-name>/builds/<build-number>.

          Hope that helps.

          -Kedar




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Kedar Mhaswade-3
In reply to this post by Alan Harder-2
On 07/21/2010 10:15 AM, Alan Harder wrote:

> What if you re-save the project config?  Does that help?
>
> "Out of that, last two are booleans, so they are not the source of NPE"
>
> -- actually, the variables there are Boolean, not boolean, so I
> suspect one of them IS the source of the NPE.. as you mentioned, if
> the other values were null then java would happily pass them along
> into the constructor (and may get NPE on some line there).. however,
> when java auto-converts Boolean to boolean to pass into the
> constructor it can get NPE if the Boolean is null.
Argh. Bitten by autoboxing/unboxing. You are right. If any of the values
are null at the call-site,
the autounboxing into primitive boolean is going to throw NPE right
there. So, that mystery is resolved.

So, I'd say resaving the project configuration (especially with flatten
and timestamp checkboxes checked for now)
should get you going.

As an aside, the Boolean variables in question are not declared
volatile, although initialized to non-null values!
So, it's a bit puzzling why any of the would be null. Maybe the later
/sets/ are actually causing them to be null.
I think the code needs to take better care of such things in the
setters, especially with booleans (there are
backward compatibility concerns here, if I understand/recall it correctly).

I'd say this is a candidate for a bug (maybe minor), no?

>
> So, perhaps re-saving the project config will get a non-null value
> back into those 2 fields.
>
>    - Alan
>
>
>
> Eric Berry wrote:
>> The installed version says 1.0.
>>
>> I haven't updated in months, so I think it's the same as the latest
>> release:
>> http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin
>>
>> Could the problem be originating from some changes in hudson?
>> My current hudson version is 1.367
>>
>> On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net
>> <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:
>>
>>     On 07/20/2010 06:28 PM, Eric Berry wrote:
>>
>>         Hi Kedar,
>>            Thank you so much for the quick reply.
>>
>>         I looked in the logs under the builds directory. The one from
>>         yesterday (successful) and today have minimal differences. The
>>         differences include the change set, the shell script name, and
>>         then the error. There wasn't any more to the exception than
>> below.
>>
>>         Is there another place where logs can be found that might be
>>         helpful?
>>
>>         I do see the ftp site being logged - so that's not null.
>>
>>         What would cause the build, or listener to be null?
>>
>>     Hmmm. Strange. I was looking at the latest source. I am hoping
>>     that that is what
>>     relates to the plugin version you're using. Can you tell me the
>>     version of the plugin (that you
>>     see under Installed Plugins page?)
>>
>>     The reason I think this is strange is the line where stack trace
>>     originates can't throw an NPE. That
>>     line constructs an instance of EntryCopier which may generate
>>     (possibly) an NPE. So the trace should
>>     start with something like:
>>     java.lang.NullPointerException
>>       at EntryCopier.<Init> (EntryCopier.java:xxx).
>>
>>       at
>>     com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>>     ...
>>
>>     (This is of course if I am looking at the correct source code
>>     associated with the plugin version
>>     you are using).
>>
>>
>>
>>         On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net
>> <http://kedar.java.net> <http://kedar.java.net>@gmail.com
>> <http://gmail.com> <http://gmail.com>> wrote:
>>
>>            On 07/20/2010 04:40 PM, Eric Berry wrote:
>>
>>                [quote]
>>                ERROR: Failed to upload files
>>                java.lang.NullPointerException
>>                   at
>>                      
>> com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>>                   at
>>                      
>> hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>>                   at
>>                      
>> hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
>>
>>                   at
>>                      
>> hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
>>
>>                   at
>>                      
>> hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
>>
>>                   at hudson.model.Build$RunnerImpl.post2(Build.java:158)
>>                   at
>>                      
>> hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
>>                   at hudson.model.Run.run(Run.java:1280)
>>                   at
>>         hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>                   at
>>                      
>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>                   at hudson.model.Executor.run(Executor.java:129)
>>                [/quote]
>>
>>
>>            More information is needed. The code line
>>         (FTPPublisher:150) where
>>            NPE generates is:
>>            EntryCopier copier = new EntryCopier(build, listener,
>> ftpsite,
>>            flatten, useTimestamps);
>>
>>            Out of that, last two are booleans, so they are not the
>>         source of
>>            NPE. The third argument is not null because
>>            if it were null, you would have gotten NPE before this line
>>         (the
>>            code tries to log ftp site's host name). That means
>>            either build, listener or something therein generates an NPE.
>>
>>            Can you check to see what the log file says? (Maybe
>> compare the
>>            logs from two builds - the last successful one and
>>            the failing one)? They are at:
>> <hudson-home>/jobs/<job-name>/builds/<build-number>.
>>
>>            Hope that helps.
>>
>>            -Kedar
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Alan Harder-2


kedar wrote:
> As an aside, the Boolean variables in question are not declared
> volatile, although initialized to non-null values!
> So, it's a bit puzzling why any of the would be null. Maybe the later
> /sets/ are actually causing them to be null.
> I think the code needs to take better care of such things in the
> setters, especially with booleans (there are
> backward compatibility concerns here, if I understand/recall it
> correctly).

When Hudson loads xml for project configs, etc. it uses XStream..
XStream does not run constructors, but creates a completely blank (all
null) object and then populates the fields from the xml data.. so the
defaults for these fields don't apply when loading xml.. and of course
people who saved projects before these new fields were added don't have
those in their xml, so they remain null.
You can add a readResolve() method to take care of initializing things
after XStream does its work.. this is how you can take care of upgrade
issues.  Grep for readResolve in core or other plugins to look for
examples.. hope this helps,

    - Alan

>
> I'd say this is a candidate for a bug (maybe minor), no?
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

townsfolk
In reply to this post by Kedar Mhaswade-3
Kedar, Alan,
   Thank you both for the help. Modifying the settings and then resaving the project has definitely fixed the issue.

Kedar, did you want me to still create a bug for the upgrade issues? The settings should probably default to a point that the plugin behaves as it did before the upgrade.

Thanks again,
Eric

On Wed, Jul 21, 2010 at 11:07 AM, kedar <kedar.java.net@gmail.com> wrote:
On 07/21/2010 10:15 AM, Alan Harder wrote:
What if you re-save the project config?  Does that help?

"Out of that, last two are booleans, so they are not the source of NPE"

-- actually, the variables there are Boolean, not boolean, so I suspect one of them IS the source of the NPE.. as you mentioned, if the other values were null then java would happily pass them along into the constructor (and may get NPE on some line there).. however, when java auto-converts Boolean to boolean to pass into the constructor it can get NPE if the Boolean is null.
Argh. Bitten by autoboxing/unboxing. You are right. If any of the values are null at the call-site,
the autounboxing into primitive boolean is going to throw NPE right there. So, that mystery is resolved.

So, I'd say resaving the project configuration (especially with flatten and timestamp checkboxes checked for now)
should get you going.

As an aside, the Boolean variables in question are not declared volatile, although initialized to non-null values!
So, it's a bit puzzling why any of the would be null. Maybe the later /sets/ are actually causing them to be null.
I think the code needs to take better care of such things in the setters, especially with booleans (there are
backward compatibility concerns here, if I understand/recall it correctly).

I'd say this is a candidate for a bug (maybe minor), no?



So, perhaps re-saving the project config will get a non-null value back into those 2 fields.

  - Alan



Eric Berry wrote:
The installed version says 1.0.

I haven't updated in months, so I think it's the same as the latest release:
http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin

Could the problem be originating from some changes in hudson?
My current hudson version is 1.367

On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:

   On 07/20/2010 06:28 PM, Eric Berry wrote:

       Hi Kedar,
          Thank you so much for the quick reply.

       I looked in the logs under the builds directory. The one from
       yesterday (successful) and today have minimal differences. The
       differences include the change set, the shell script name, and
       then the error. There wasn't any more to the exception than below.

       Is there another place where logs can be found that might be
       helpful?

       I do see the ftp site being logged - so that's not null.

       What would cause the build, or listener to be null?

   Hmmm. Strange. I was looking at the latest source. I am hoping
   that that is what
   relates to the plugin version you're using. Can you tell me the
   version of the plugin (that you
   see under Installed Plugins page?)

   The reason I think this is strange is the line where stack trace
   originates can't throw an NPE. That
   line constructs an instance of EntryCopier which may generate
   (possibly) an NPE. So the trace should
   start with something like:
   java.lang.NullPointerException
     at EntryCopier.<Init> (EntryCopier.java:xxx).

     at
   com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
   ...

   (This is of course if I am looking at the correct source code
   associated with the plugin version
   you are using).



       On Tue, Jul 20, 2010 at 5:35 PM, kedar <kedar.java.net
<http://kedar.java.net> <http://kedar.java.net>@gmail.com
<http://gmail.com> <http://gmail.com>> wrote:

          On 07/20/2010 04:40 PM, Eric Berry wrote:

              [quote]
              ERROR: Failed to upload files
              java.lang.NullPointerException
                 at
                     com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
                 at
                     hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
                 at hudson.model.Build$RunnerImpl.post2(Build.java:158)
                 at
                     hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
                 at hudson.model.Run.run(Run.java:1280)
                 at
       hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
                 at
                     hudson.model.ResourceController.execute(ResourceController.java:88)
                 at hudson.model.Executor.run(Executor.java:129)
              [/quote]


          More information is needed. The code line
       (FTPPublisher:150) where
          NPE generates is:
          EntryCopier copier = new EntryCopier(build, listener, ftpsite,
          flatten, useTimestamps);

          Out of that, last two are booleans, so they are not the
       source of
          NPE. The third argument is not null because
          if it were null, you would have gotten NPE before this line
       (the
          code tries to log ftp site's host name). That means
          either build, listener or something therein generates an NPE.

          Can you check to see what the log file says? (Maybe compare the
          logs from two builds - the last successful one and
          the failing one)? They are at:
<hudson-home>/jobs/<job-name>/builds/<build-number>.

          Hope that helps.

          -Kedar




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Reply | Threaded
Open this post in threaded view
|

Re: FTP Publisher: NullPointer exception.

Kedar Mhaswade-3
On 07/22/2010 09:33 AM, Eric Berry wrote:
> Kedar, Alan,
> �� Thank you both for the help. Modifying the settings and then
> resaving the project has definitely fixed the issue.
>
> Kedar, did you want me to still create a bug for the upgrade issues?
> The settings should probably default to a point that the plugin
> behaves as it did before the upgrade.
Eric,

Thanks for the offer. Yes. I think we can/should provide a fix that
makes the plugin (more) backward compatible.

benjaminjaton,
you seem to be the current maintainer of the ftp-publisher plugin. Would
you agree?

Regards,
Kedar

>
> Thanks again,
> Eric
>
> On Wed, Jul 21, 2010 at 11:07 AM, kedar <kedar.java.net
> <http://kedar.java.net>@gmail.com <http://gmail.com>> wrote:
>
>     On 07/21/2010 10:15 AM, Alan Harder wrote:
>
>         What if you re-save the project config? �Does that help?
>
>         "Out of that, last two are booleans, so they are not the
>         source of NPE"
>
>         -- actually, the variables there are Boolean, not boolean, so
>         I suspect one of them IS the source of the NPE.. as you
>         mentioned, if the other values were null then java would
>         happily pass them along into the constructor (and may get NPE
>         on some line there).. however, when java auto-converts Boolean
>         to boolean to pass into the constructor it can get NPE if the
>         Boolean is null.
>
>     Argh. Bitten by autoboxing/unboxing. You are right. If any of the
>     values are null at the call-site,
>     the autounboxing into primitive boolean is going to throw NPE
>     right there. So, that mystery is resolved.
>
>     So, I'd say resaving the project configuration (especially with
>     flatten and timestamp checkboxes checked for now)
>     should get you going.
>
>     As an aside, the Boolean variables in question are not declared
>     volatile, although initialized to non-null values!
>     So, it's a bit puzzling why any of the would be null. Maybe the
>     later /sets/ are actually causing them to be null.
>     I think the code needs to take better care of such things in the
>     setters, especially with booleans (there are
>     backward compatibility concerns here, if I understand/recall it
>     correctly).
>
>     I'd say this is a candidate for a bug (maybe minor), no?
>
>
>
>         So, perhaps re-saving the project config will get a non-null
>         value back into those 2 fields.
>
>         � - Alan
>
>
>
>         Eric Berry wrote:
>
>             The installed version says 1.0.
>
>             I haven't updated in months, so I think it's the same as
>             the latest release:
>             http://wiki.hudson-ci.org/display/HUDSON/FTP-Publisher+Plugin
>
>             Could the problem be originating from some changes in hudson?
>             My current hudson version is 1.367
>
>             On Tue, Jul 20, 2010 at 6:54 PM, kedar <kedar.java.net
>             <http://kedar.java.net> <http://kedar.java.net>@gmail.com
>             <http://gmail.com> <http://gmail.com>> wrote:
>
>             � �On 07/20/2010 06:28 PM, Eric Berry wrote:
>
>             � � � �Hi Kedar,
>             � � � � � Thank you so much for the quick reply.
>
>             � � � �I looked in the logs under the builds directory.
>             The one from
>             � � � �yesterday (successful) and today have minimal
>             differences. The
>             � � � �differences include the change set, the shell
>             script name, and
>             � � � �then the error. There wasn't any more to the
>             exception than below.
>
>             � � � �Is there another place where logs can be found that
>             might be
>             � � � �helpful?
>
>             � � � �I do see the ftp site being logged - so that's not
>             null.
>
>             � � � �What would cause the build, or listener to be null?
>
>             � �Hmmm. Strange. I was looking at the latest source. I am
>             hoping
>             � �that that is what
>             � �relates to the plugin version you're using. Can you
>             tell me the
>             � �version of the plugin (that you
>             � �see under Installed Plugins page?)
>
>             � �The reason I think this is strange is the line where
>             stack trace
>             � �originates can't throw an NPE. That
>             � �line constructs an instance of EntryCopier which may
>             generate
>             � �(possibly) an NPE. So the trace should
>             � �start with something like:
>             � �java.lang.NullPointerException
>             � � �at EntryCopier.<Init> (EntryCopier.java:xxx).
>
>             � � �at
>             �
>             �com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>             � �...
>
>             � �(This is of course if I am looking at the correct
>             source code
>             � �associated with the plugin version
>             � �you are using).
>
>
>
>             � � � �On Tue, Jul 20, 2010 at 5:35 PM, kedar
>             <kedar.java.net <http://kedar.java.net>
>             <http://kedar.java.net> <http://kedar.java.net>@gmail.com
>             <http://gmail.com>
>             <http://gmail.com> <http://gmail.com>> wrote:
>
>             � � � � � On 07/20/2010 04:40 PM, Eric Berry wrote:
>
>             � � � � � � � [quote]
>             � � � � � � � ERROR: Failed to upload files
>             � � � � � � � java.lang.NullPointerException
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �com.zanox.hudson.plugins.FTPPublisher.perform(FTPPublisher.java:150)
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
>
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
>
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
>
>             � � � � � � � � �at
>             hudson.model.Build$RunnerImpl.post2(Build.java:158)
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
>             � � � � � � � � �at hudson.model.Run.run(Run.java:1280)
>             � � � � � � � � �at
>             � � � �hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>             � � � � � � � � �at
>             � � � � � � � � � �
>             �hudson.model.ResourceController.execute(ResourceController.java:88)
>             � � � � � � � � �at
>             hudson.model.Executor.run(Executor.java:129)
>             � � � � � � � [/quote]
>
>
>             � � � � � More information is needed. The code line
>             � � � �(FTPPublisher:150) where
>             � � � � � NPE generates is:
>             � � � � � EntryCopier copier = new EntryCopier(build,
>             listener, ftpsite,
>             � � � � � flatten, useTimestamps);
>
>             � � � � � Out of that, last two are booleans, so they are
>             not the
>             � � � �source of
>             � � � � � NPE. The third argument is not null because
>             � � � � � if it were null, you would have gotten NPE
>             before this line
>             � � � �(the
>             � � � � � code tries to log ftp site's host name). That means
>             � � � � � either build, listener or something therein
>             generates an NPE.
>
>             � � � � � Can you check to see what the log file says?
>             (Maybe compare the
>             � � � � � logs from two builds - the last successful one and
>             � � � � � the failing one)? They are at:
>             <hudson-home>/jobs/<job-name>/builds/<build-number>.
>
>             � � � � � Hope that helps.
>
>             � � � � � -Kedar
>
>
>
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: [hidden email]
>         <mailto:[hidden email]>
>         For additional commands, e-mail:
>         [hidden email]
>         <mailto:[hidden email]>
>
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: [hidden email]
>     <mailto:[hidden email]>
>     For additional commands, e-mail: [hidden email]
>     <mailto:[hidden email]>
>
>
>
>
> --
> Learn from the past. Live in the present. Plan for the future.
> Blog: http://www.townsfolkdesigns.com/blogs/elberry
> jEdit <http://www.jedit.org> - Programmer's Text Editor
> Bazaar <http://bazaar.canonical.com> - Version Control for Humans


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]