<< Back to previous view

[QB-129] java.lang.NullPointerException when checking out files from StarTeam repository
Created: 03/Sep/06  Updated: 24/Oct/06

Status: Resolved
Project: QuickBuild
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Haim Yadid Assigned To: Robin Shen
Resolution: Fixed Votes: 1
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: Windows 2003 Advanced server

File Attachments: Zip Archive StarTeamCheckout.zip    

 Description   
I get java.lang.NullPointerException if I run the build more than once after tomcat restart.
A restart of tomcat solves the problem most of the times.
This is a blocker issue and I am going to seek other solutions (not QuickBuild) if no resolution will be available soon.

Here is the build log



2006-08-30 18:06:18,078 [Thread-80] INFO - Saving build status as running...
2006-08-30 18:06:18,140 [Thread-80] INFO - Repository "BAC": cleanup checkout started event received.
2006-08-30 18:06:18,156 [Thread-80] INFO - Cleaning up checkouts...
2006-08-30 18:06:18,156 [Thread-80] INFO - Validating steps...
2006-08-30 18:06:18,156 [Thread-80] INFO - Triggering step "default".
2006-08-30 18:06:18,156 [Thread-80] INFO - Checking necessary condition of step "default".
2006-08-30 18:06:18,156 [Thread-80] INFO - Condition satisfied, running step "default".
2006-08-30 18:06:18,156 [Thread-80] INFO - Triggering step "CheckOutBAC".
2006-08-30 18:06:18,156 [Thread-80] INFO - Checking necessary condition of step "CheckOutBAC".
2006-08-30 18:06:18,171 [Thread-80] INFO - Condition satisfied, running step "CheckOutBAC".
2006-08-30 18:06:18,171 [Thread-80] INFO - Check out artifacts from repository: BAC
2006-08-30 18:13:25,625 [Thread-80] INFO - Retrieve source path "/" of StarTeam view "AMDev"
2006-08-30 18:13:25,625 [Thread-80] INFO - Cleaning directory "D:\\StarTeam\\checkouts/../BAC/AMDev/ws" before populating...
2006-08-30 18:15:36,531 [Thread-80] INFO - Recursive Checkout from: AMDev\
2006-08-30 18:15:36,531 [Thread-80] INFO - Checking out to: D:\StarTeam\checkouts\..\BAC\AMDev\ws
2006-08-30 18:15:36,531 [Thread-80] INFO - Using view as of date 8/30/06 6:13:15 PM IDT
2006-08-30 18:15:36,531 [Thread-80] INFO - Items will be checked out with no change in lock status.
2006-08-30 18:15:36,531 [Thread-80] INFO - Items will be checked out with the current timestamp.
2006-08-30 18:15:36,531 [Thread-80] INFO - Items will be checked out in accordance with repository status.
2006-08-30 18:15:36,531 [Thread-80] INFO - Items will be checked out using the local machine's EOL convention
2006-08-30 18:15:36,531 [Thread-80] INFO - Directories will be created wherever they exist in the repository, even if empty.
2006-08-30 18:15:36,828 [Thread-80] ERROR - java.lang.NullPointerException
2006-08-30 18:15:36,828 [Thread-80] INFO - Triggering step "BuildBAC".
2006-08-30 18:15:36,828 [Thread-80] INFO - Checking necessary condition of step "BuildBAC".
2006-08-30 18:15:36,828 [Thread-80] INFO - Necessary condition not satisfied, skipping step "BuildBAC".
2006-08-30 18:15:36,828 [Thread-80] ERROR - Composite step "default" failed due to unsatisfication of step success condition.
2006-08-30 18:15:36,828 [Thread-80] INFO - Finished triggering step "default". Saving build status based on triggering result...
2006-08-30 18:15:36,828 [Thread-80] INFO - Build failed: 1.5
2006-08-30 18:15:36,828 [Thread-80] INFO - Finishing build...
2006-08-30 18:15:36,828 [Thread-80] INFO - Repository "BAC": build finished event received.
2006-08-30 18:15:36,875 [Thread-80] INFO - Build finished.
2006-08-30 18:15:36,875 [Thread-80] INFO - Save build status as "failed".



 Comments   
Comment by Brian Surratt [ 28/Sep/06 03:19 PM ]
I'm seeing this Exception on 1.1.4 (build 41) running QuickBuild on Red Hat Enterprise and StarTeam on Windows 2003 server. The QuickBuild instance is running in stand alone mode using the in-memory database.

I have three configurations and this problem occurs on one of them. I've tried changing the StarTeam view for this configuration to the view used by one of the "healthy" configs and it does not help.

I didn't see any thing suspicious in [QUICKBUILD_HOME]/logs or [QUICKBUILD_HOME]/tomcat/logs

With logging @ verbose, I'm seeing files being successfully checked out and the message "successful disconnect from StarTeam Server XXX.XXX.XXXX.XXXX" immediately before the NPE.

I have tried deleting the configuration and recreating several times, but this problem still happens. This suggested that the problem may be with my configuration, so I copied (a great feature BTW) one of the working configs and made the appropriate variable changes, but the problem still occurred.

I can confirm the following:
* restarting the QuickBuild instance helps.
* the problem is in the StarTeam integration point. If I remove my check out step the problem does not occur and Ant build task fires up fine.
Comment by Robin Shen [ 28/Sep/06 05:51 PM ]
Brian,

Is it possible that there are no enough concurrent licenses at QuickBuild side when connects to StarTeam server? And can you send me your full build log containing the NPE with verbose turned on? We've tried a lot at our side but can not repeat the same problem.

Thanks.
Robin
Comment by Brian Surratt [ 28/Sep/06 06:29 PM ]
Robin,

Thanks for the quick response. Unfortunately, I deleted all the previous builds of that configuration. If it happens again, I will send you that section of the log.

FYI, I have been able to do two successful builds, with checkouts, since I restarted QuickBuild. The original reporter stated that he could only do one checkout before the problem reoccurred. If it happens again, I'll e-mail you.

There were no additional details in the log other than what I described in my comment. There's no stack trace to go along with the exception message. It was just the list of files checked out, if any, and then the "successful disconnect from StarTeam Server XXX.XXX.XXXX.XXXX" then the NPE. (BTW, I really like the way that the log is color coded based on message type)

You mean StarTeam licenses, right? I don't know for sure, but I would not expect that is the problem. I've been running CruiseControl, numerous Ant scripts and even custom code using the StarTeam SDK against this StarTeam server for years, with no problems.

But then, we've only just started working the StarTeam Cross Platform SDK in the last few weeks, since we started moving to Linux. Everything else has been the Java wrapper around the Windows native DLLs. Be we've had no problems with the CP SDK doing checkouts through the Ant tasks or QuickBuild until this problem.

I will check with our StarTeam admin and see if he spots anything in the logs. I should have thought of that.

Based on the success of the "restart" technique, I was wondering the problem was some kind of corruption of the in-memory database. My plan tomorrow is to switch to over to using MySQL for the back end. I'll let you know if this helps or hinders.

Thanks again,
Brian
Comment by Robin Shen [ 29/Sep/06 05:04 AM ]
Brian,

Thank you for willing to track this down. When you try to repeat this problem, please use the new build (1.1.4 build 42) which can print the stack trace of this NPE into build log.

Regards.
Robin
Comment by Brian Surratt [ 29/Sep/06 11:11 AM ]
One thing to test on your end.

I never encountered this problem until I tried to rebuild a version that already existed. That is, build version 1.0.1, then do another build as the same build version. I hit some kind of error (which I kinda expected) so then I deleted the 1.0.1 build and rebuilt as 1.0.1 again.

I don't recall if I immediately started encountering this problem or not.
Comment by Robin Shen [ 29/Sep/06 04:05 PM ]
I've made the test, and still found it goes well.
Comment by Brian Surratt [ 30/Sep/06 08:19 AM ]
Found that littel bugger...

2006-09-30 01:09:31,588 [Thread-84] DEBUG - successful disconnect from StarTeam Server 10.3.56.27
2006-09-30 01:09:31,588 [Thread-84] ERROR - Build failed.
java.lang.NullPointerException
at com.starbase.starteam.FileBasedStatusManager.setFileSyncInfo(FileBasedStatusManager.java:291)
at com.starbase.starteam.Server.cacheStatusData(Server.java:2410)
at com.starbase.starteam.File.resyncStatusCore(File.java:2043)
at com.starbase.starteam.File.updateStatus(File.java:1970)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.processFile(StarTeamCheckout.java:501)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:404)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.TreeBasedTask.execute(TreeBasedTask.java:633)
at com.pmease.quickbuild.repository.StarTeamRepository.retrieveModule(StarTeamRepository.java:108)
at com.pmease.quickbuild.repository.StarTeamRepository.checkout(StarTeamRepository.java:311)
at com.pmease.quickbuild.repository.Repository.doCheckout(Repository.java:144)
at com.pmease.quickbuild.step.CheckoutStep.run(CheckoutStep.java:60)
at com.pmease.quickbuild.step.Step.trigger(Step.java:179)
at com.pmease.quickbuild.step.SerialStep.triggerMembers(SerialStep.java:35)
at com.pmease.quickbuild.step.CompositeStep.run(CompositeStep.java:129)
at com.pmease.quickbuild.step.Step.trigger(Step.java:179)
at com.pmease.quickbuild.model.Configuration.performBuild(Configuration.java:1276)
at com.pmease.quickbuild.model.Configuration.trigger(Configuration.java:976)
at com.pmease.quickbuild.triggeringinstance.ScheduledTriggeringInstance.execute(ScheduledTriggeringInstance.java:39)
at com.pmease.quickbuild.model.Queue$BuildRunner.run(Queue.java:221)
at java.lang.Thread.run(Thread.java:595)
2006-09-30 01:09:31,589 [Thread-84] INFO - Save build status as "failed".
Comment by Robin Shen [ 01/Oct/06 04:05 PM ]
Thanks Brian, this should be of great help.
Comment by Brian Surratt [ 02/Oct/06 07:31 AM ]
FYI, I checked with our StarTeam admin and he did not see any server side errors to go along with this problem.
Comment by Robin Shen [ 03/Oct/06 07:07 AM ]
Hi Brian,

Can you help to apply the attached file to see if it resolves your problem? To apply the patch, extract files from "StarTeamCheckout.zip" and put them into directory "WEB-INF/classes/com/pmease/quickbuild/ant/starteam" (relative to the directory wherever you install Quickbuild web application) to overwrite existing files.

Thanks.
Robin
Comment by Brian Surratt [ 03/Oct/06 11:05 AM ]
I'll apply the patch this evening and let you know if the problem reoccurs.
Comment by Haim Yadid [ 04/Oct/06 03:43 AM ]
I have tried this patch and I still get this NPE
Comment by Robin Shen [ 04/Oct/06 05:04 AM ]
OK, I think I should implement the checkout functionality with StarTeam command line tool, which should be more reliable.

New implementation will be available in several days.

Robin
Comment by Brian Surratt [ 04/Oct/06 10:27 AM ]
I've done 16 builds on two different configurations (8 each) since applying this "patch" and have not had any problems. This is many more consecutive builds than I've been able to do since I started having this problem.

Of course, now that I've hinted that the problem may be fixed, it will fail next time I NEED to make a build.
Comment by Brian Surratt [ 05/Oct/06 09:42 AM ]
It finally happened again

2006-10-05 11:19:42,103 [Thread-209] DEBUG - successful disconnect from StarTeam Server xx.xx.xx.xx
2006-10-05 11:19:42,104 [Thread-209] ERROR - Build failed.
java.lang.NullPointerException
at com.starbase.starteam.FileBasedStatusManager.setFileSyncInfo(FileBasedStatusManager.java:291)
at com.starbase.starteam.Server.cacheStatusData(Server.java:2410)
at com.starbase.starteam.File.updateStatusCore(File.java:2523)
at com.starbase.starteam.File.updateStatusCore(File.java:2469)
at com.starbase.starteam.File.checkoutImpl(File.java:1930)
at com.starbase.starteam.File.checkoutCore(File.java:1736)
at com.starbase.starteam.File.checkout(File.java:1500)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.processFile(StarTeamCheckout.java:540)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:404)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.StarTeamCheckout.visit(StarTeamCheckout.java:397)
at com.pmease.quickbuild.ant.starteam.TreeBasedTask.execute(TreeBasedTask.java:633)
at com.pmease.quickbuild.repository.StarTeamRepository.retrieveModule(StarTeamRepository.java:108)
at com.pmease.quickbuild.repository.StarTeamRepository.checkout(StarTeamRepository.java:311)
at com.pmease.quickbuild.repository.Repository.doCheckout(Repository.java:144)
at com.pmease.quickbuild.step.CheckoutStep.run(CheckoutStep.java:60)
at com.pmease.quickbuild.step.Step.trigger(Step.java:179)
at com.pmease.quickbuild.step.SerialStep.triggerMembers(SerialStep.java:35)
at com.pmease.quickbuild.step.CompositeStep.run(CompositeStep.java:129)
at com.pmease.quickbuild.step.Step.trigger(Step.java:179)
at com.pmease.quickbuild.model.Configuration.performBuild(Configuration.java:1276)
at com.pmease.quickbuild.model.Configuration.trigger(Configuration.java:976)
at com.pmease.quickbuild.triggeringinstance.ManualTriggeringInstance.execute(ManualTriggeringInstance.java:51)
at com.pmease.quickbuild.model.Queue$BuildRunner.run(Queue.java:221)
at java.lang.Thread.run(Thread.java:595)
2006-10-05 11:19:42,104 [Thread-209] INFO - Save build status as "failed".
Comment by Robin Shen [ 08/Oct/06 05:04 PM ]
Hi All,

Please try with the new build (1.1.4, build 45) to see if this problem has been resolved. In this build, Quickbuild can be configured to use StarTeam command line (stcmd) to check out code by setting the property "is checkout using stcmd" as "yes", and two related properties "path to stcmd executable" and "datetime format" accordingly.

Regards.
Robin
Comment by Haim Yadid [ 09/Oct/06 02:40 PM ]
Sorry but I do not understad where can I find this specific build...
TIA
Comment by Robin Shen [ 09/Oct/06 04:31 PM ]
Just go to http://www.pmease.com/Download.page and you'll get the new build.

Regards.
Robin
Comment by Haim Yadid [ 10/Oct/06 02:55 AM ]
I cannot understand why the -cfgd property is mandatory and how to set it correctly
Comment by Robin Shen [ 10/Oct/06 11:31 PM ]
When check out files from StarTeam repository, Quickbuild uses current time stamp, and this time stamp
will be passed to label step later (if necessary) to make sure the labeled source code is exactly the
same as checked out source code. To determine the correct date time format, please open the command line
prompt, change to the directory containing StarTeam binaries, and run "stcmd co". The usage for checkout
command will be displayed, among which some date time samples will be displayed. Based on this, you can
conclude correct date time format.

If you can post out the command output here, I'll be glad to suggest the correct date time format.

Thanks.
Robin
Comment by Haim Yadid [ 11/Oct/06 02:20 PM ]
Here is the output of stcmd

-cfgd date : Valid Date and Time Formats:
        "10/11/06 10:50 PM"
        "Oct 11, 2006 10:50:43 PM"
        "October 11, 2006 10:50:43 PM IST"
        "Wednesday, October 11, 2006 10:50:43 PM IST"

What do I do with it?

I still do not understand why should I need to specify it
I am not going to label the build.
Comment by Robin Shen [ 11/Oct/06 08:24 PM ]
You may specify format "MM/dd/yy h:mm:ss a" (without quote of course) for "date time format" property when define starteam repository.

Although you are not going to label the build, but this decision is not known by Quickbuild at check out time . In your case, it is never been labeled. However, in other cases a label step may exist to apply the label on the same set of source code being checked out.

Hope it helps.
Robin


Comment by Haim Yadid [ 12/Oct/06 08:35 AM ]
Thanks Robin
It do help
However...
I get an error for one of my repositories

2006-10-12 17:02:49,562 [Thread-42] ERROR - ERROR: Failed to run command: Executing 'C:\Program Files\Borland\StarTeam 2005 R2\stcmd.exe' with arguments:
'co'
'-p'
'haimy:******@venus:49201/BAC/mam/'
'-x'
'-stop'
'-is'
'-ts'
'-fp'
'D:\StarTeam\BAC\mam\ws'
'-q'
'-cfgd'
'10/12/06 5:00:14 PM'
'-eol'
'on'



When I am tring to execute the command line myself I get

Using ini file: C:\Documents and Settings\All Users\Application Data\Borland\Sta
rTeam\ConnectionManager.ini
SchedulerExecutionTask.java: file status is Unknown, will not check out. Use -o
option to force checkout.


I think you should add -o param to the execution
Can I add it my self somehow?
Comment by Robin Shen [ 12/Oct/06 06:54 PM ]
It seems the file status is not saved after initial checkout, and StarTeam complains about "file status unknown" for subsequent updates, and I believe this is also the reason for the NPE when using StarTeam SDK. Altough we can add the "-o" option to force the checkout, it will checkout files even there is no changes aginst it since last build.

Please try below to narrow down the problem:

1. Login to the build machine with proper account.

2. Delete everything under directory "D:\StarTeam\BAC\mam\ws".

3. Run StarTeam graphical client to connect to project: haimy:******@venus:49201/BAC/, and setting the working folder to be "D:\StarTeam\BAC\mam\ws".

4. Check out all files from the project, the directory "D:\StarTeam\BAC\mam\ws" should be populated with files from the repository.

5. Run checkout again to see if file updating works properly.

6. Run Quickbuild as a foreground process by executing <Quickbuild installation directory>/bin/startup.bat.

7. Edit steps of the problematic configuration so that it only execute the checkout step for project "venus:49201/BAC" (please exclude ALL other steps from execution series temporarily).

8. Run the configuration several times to see if StarTeam still reports "Unknown file status".

Also is there any way I can contact you by instant messengers? It can speed up the process of resolving this issue ultimately.

Thanks.
Robin
Comment by Brian Surratt [ 24/Oct/06 02:27 PM ]
Robin,

I got this working, but when I do the checkout the files get checked out all over the place, not just in my checkouts directory. I think that this has something to do with overridden working directories in StarTeam.

Since we're actively working on getting off of StarTeam, I really don't want to waste any more time trying to get it to behave. I'm going to drop back to do my checkouts using the Ant tasks. Once we get off of StarTeam, I'll try letting QB manage the check-outs again.

Thanks.
Comment by Robin Shen [ 24/Oct/06 05:08 PM ]
Brian,

Thanks a lot for your help though.

Robin
Comment by Robin Shen [ 24/Oct/06 05:09 PM ]
This problem is believed to be fixed with the new implementation (through using stcmd).
Generated at Tue Oct 14 19:54:18 UTC 2025 using JIRA 189.