Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC : checkout failure: Unable to serialize com.ibm.team.build.internal.hjplugin.RTCLoadTask@2fc19f4a

below code is failing with error :
RTC : checkout failure: Unable to serialize com.ibm.team.build.internal.hjplugin.RTCLoadTask@2fc19f4a
               java.io.IOException: Unable to serialize com.ibm.team.build.internal.hjplugin.RTCLoadTask@2fc19f4a
(check the joined file for the complete error)


@Extension
public class LRService extends RtcExtensionProvider{

 private Run<?, ?> currentBuild = null;

@Override
  public String getPathToLoadRuleFile(String workspaceUUID, String workspaceName, String buildResultUUID,
      Map<String, String> componentInfo, String repoURL, String userId, String password, PrintStream logger)
      throws IOException {

 Map<String, String> envVarsMap = currentBuild.getEnvVars();

String ServiceUrl = repoURL+........+getExcludeFilterValueFromCurrentBuiltObject; // get the string parameter value from Jenkins UI
}

@Override
  public boolean isApplicable(Run<?, ?> build) {
    this.currentBuild = build;
    return true;
  }
}

I got to know the above code is not thread safe.As for storing any instance variables,  only one extension object exists, multiple threads could end up overwriting the instance variable values.

But my Question is how to handle this with above code. I want t access build objects values inside getPathToLoadRuleFile{} extension method 

0 votes



One answer

Permanent link

Like it is being discussed in

478059: RTC bug : Two separated Jenkins pipeline jobs use same directory to generate loadrule files., if your dynamic load rules implementation requires additional information, which can't be stored in a ThreadLocal variable, then it might have to be passed from the TeamConcert plugin. I am not sure if instances of Run can be passed as is from Master to Slave, though. Need to check if it implements java.io.Serializable.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 382

Question asked: May 14 '19, 2:42 a.m.

Question was seen: 2,511 times

Last updated: May 31 '19, 4:00 a.m.

Confirmation Cancel Confirm