[ 
https://jira.codehaus.org/browse/CONTINUUM-2705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=326389#comment-326389
 ] 

Brent N Atkinson commented on CONTINUUM-2705:
---------------------------------------------

I don't think the stacktrace reported on CONTINUUM-2346 came from the reported 
version. I looked at 
[ParallelBuildsManager.java:193|http://svn.apache.org/viewvc/continuum/tags/continuum-1.3.3/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?view=markup]
 from 1.3.3 and the line numbers don't match up to anything meaningful. 
However, it appears the only field on {{BuildDefinition}} that could cause an 
NPE in that method is the schedule since we call 
{{buildDef.getSchedule().getBuildQueues()}} and 
{{buildDefinition.getSchedule().getMaxJobExecutionTime()}} (and try to use a 
possibly null value for arithmetic) on 
[ParallelBuildsManager.java:201,242|http://svn.apache.org/viewvc/continuum/tags/continuum-1.4.1/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?view=markup].

The original fix was less than ideal because it introduced coupling to details 
of the various build types in a way that isn't appropriate for a generic build 
manager. These checks would be more appropriate as polymorphic behavior so we 
wouldn't have to code for every build variant.

Also, the patch doesn't look to capture the spirit of the original rule if 
we're not just concerned with NPEs in the method invocation. The rule should be:

{code:java}
boolean mavenBuild = MAVEN_TWO_BUILD_EXECUTOR.equals( buildDef.getType() ) || 
MAVEN_ONE_BUILD_EXECUTOR.equals( buildDef.getType() );

if ( ( mavenBuild && buildDef.getGoals() == null ) || buildDef.getBuildFile() 
== null || buildDef.getSchedule() == null )
{code}

The reason is that all build types need a build file:

  * shell: command
  * ant: build.xml or equivalent
  * m1/m2: project.xml/pom.xml

They also need a schedule, but maven builds also require goals:

  * m1: goal(s)
  * m2: phase(s)

Oddly, the build definition template interface doesn't require these for the 
build types.
                
> Trunk 1.4.2-SNAPSHOT- error in Shell Build
> ------------------------------------------
>
>                 Key: CONTINUUM-2705
>                 URL: https://jira.codehaus.org/browse/CONTINUUM-2705
>             Project: Continuum
>          Issue Type: Bug
>    Affects Versions: 1.4.1
>         Environment: linux, tomcat
>            Reporter: Murali Mohan
>            Assignee: Brent N Atkinson
>             Fix For: 1.4.2
>
>         Attachments: CONTINUUM-2705.patch, Screenshot-8.png
>
>
> I am trying to understand the code and may be provide some fixes/patches 
> (example: http://jira.codehaus.org/browse/CONTINUUM-2704). Checked out latest 
> code from trunk (1.4.2-SNAPSHOT). Trying to execute a shell build when it 
> fails. StackTrace given below. This is a new build created after running the 
> continuum-webapp (built from trunk code) for the first time. This is not a 
> migrated build (meaning it was a new build defined in the fresh instance).
> Screenshot of continuum UI showing the failing build (Test.sh) is also 
> attached.
> Can someone please help? What is the reason for this error?
> StackTrace
> =========
> 2013-03-05 15:42:17,691 [pool-3-thread-2] ERROR 
> org.apache.continuum.buildmanager.ParallelBuildsManager  - Null values set on 
> build definition (id=6)
> 2013-03-05 15:42:17,691 [pool-3-thread-2] ERROR 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor  - 
> Unable to build project due to null values set on ( GOALS , ARGUMENTS , 
> BUILD_FILE, SCHEDULE_ID_OID ) of BUILDDEFINITION ID : 6 Please notify your 
> system adminitrator
> org.apache.continuum.buildmanager.BuildManagerException: Unable to build 
> project due to null values set on ( GOALS , ARGUMENTS , BUILD_FILE, 
> SCHEDULE_ID_OID ) of BUILDDEFINITION ID : 6 Please notify your system 
> adminitrator
>     at 
> org.apache.continuum.buildmanager.ParallelBuildsManager.buildProjects(ParallelBuildsManager.java:193)
>     at 
> org.apache.maven.continuum.core.action.CreateBuildProjectTaskAction.execute(CreateBuildProjectTaskAction.java:123)
>     at 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor.buildProjects(PrepareBuildProjectsTaskExecutor.java:647)
>     at 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor.executeTask(PrepareBuildProjectsTaskExecutor.java:215)
>     at 
> org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ParallelBuildsThreadedTaskQueueExecutor.java:120)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
>     at java.lang.Thread.run(Thread.java:662)
> 2013-03-05 15:42:17,692 [pool-3-thread-2] ERROR 
> org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor
>   - Error executing task
> org.codehaus.plexus.taskqueue.execution.TaskExecutionException: Error 
> executing action 'build-project'
>     at 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor.buildProjects(PrepareBuildProjectsTaskExecutor.java:657)
>     at 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor.executeTask(PrepareBuildProjectsTaskExecutor.java:215)
>     at 
> org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ParallelBuildsThreadedTaskQueueExecutor.java:120)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
>     at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
>     at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.continuum.buildmanager.BuildManagerException: Unable to 
> build project due to null values set on ( GOALS , ARGUMENTS , BUILD_FILE, 
> SCHEDULE_ID_OID ) of BUILDDEFINITION ID : 6 Please notify your system 
> adminitrator
>     at 
> org.apache.continuum.buildmanager.ParallelBuildsManager.buildProjects(ParallelBuildsManager.java:193)
>     at 
> org.apache.maven.continuum.core.action.CreateBuildProjectTaskAction.execute(CreateBuildProjectTaskAction.java:123)
>     at 
> org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTaskExecutor.buildProjects(PrepareBuildProjectsTaskExecutor.java:647)
>     ... 7 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to