| Unable to update Bugzilla [message #61891] | 
Sun, 16 November 2008 13:06  | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi 
While running the below code I got this error message 
 
org.eclipse.core.runtime.CoreException: Mid-air collision occurred while submitting to http://ptc.hursley.ibm.com/ptc//bugzilla/. 
Synchronize task and re-submit changes. 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.pars eHtmlError(BugzillaClient.java:1221) 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.post TaskData(BugzillaClient.java:868) 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHan dler.postTaskData(BugzillaTaskDataHandler.java:254) 
	at test.main(test.java:47) 
 
 
test code is  
import org.eclipse.core.runtime.CoreException; 
import org.eclipse.mylyn.commons.net.AuthenticationCredentials; 
import org.eclipse.mylyn.commons.net.AuthenticationType; 
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; 
import  org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; 
import  org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryC onnector; 
import org.eclipse.mylyn.internal.commons.net.CommonsNetPlugin; 
import org.eclipse.mylyn.tasks.core.ITaskMapping; 
import org.eclipse.mylyn.tasks.core.TaskRepository; 
import org.eclipse.mylyn.tasks.core.data.TaskAttribute; 
import org.eclipse.mylyn.tasks.core.data.TaskData; 
 
public class test { 
	private static final String URL = "http://bugzilla-link/"; 
 
	private static final String BUG_ID = "4534"; 
	public static void main(String[] args){ 
		System.out.println("flkds"); 
		 
		TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, URL); 
		AuthenticationCredentials credentials = new AuthenticationCredentials("xyz", "xyz"); 
		repository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); 
		BugzillaRepositoryConnector connector = new BugzillaRepositoryConnector(); 
		try { 
			// get a report from repository 
			TaskData taskData = connector.getTaskData(repository, BUG_ID, null); 
 
			// access task information 
			ITaskMapping taskMapping = connector.getTaskMapping(taskData); 
			System.out.println("Summary:     " + taskMapping.getSummary()); 
			System.out.println("Priority:    " + taskMapping.getPriority()); 
			System.out.println("status       " + taskMapping.getStatus()); 
			 
			TaskAttribute descriptionAttribute =  taskData.getRoot().getMappedAttribute(TaskAttribute.COMPONEN T); 
			System.out.println("Component:   " + descriptionAttribute.getValue()); 
 
			// ...or by Bugzilla keys 
			TaskAttribute severityAttribute =  taskData.getRoot().getAttribute(BugzillaAttribute.BUG_SEVERI TY.getKey()); 
			System.out.println("Severity:    " + severityAttribute.getValue()); 
			// Post modified report to repository 
			System.out.print("\nPosting a new comment... "); 
			TaskAttribute newCommentAttribute =  taskData.getRoot().getMappedAttribute(TaskAttribute.COMMENT_ NEW); 
			newCommentAttribute.setValue("Hello world."); 
			 
			connector.getTaskDataHandler().postTaskData(repository, taskData, null, null); 
			System.out.println("done"); 
		} 
		catch (Exception e) { 
			e.printStackTrace(); 
		} finally { 
			CommonsNetPlugin.getExecutorService().shutdown(); 
		} 
 
	} 
 
} 
 
 
Output of the code is 
Summary:     test  
Priority:    P2 
status       NEW 
Component:   tasks 
Severity:    normal 
 
Posting a new comment... org.eclipse.core.runtime.CoreException: Mid-air collision occurred while submitting to http://ptc.hursley.ibm.com/ptc/bugzilla/. 
Synchronize task and re-submit changes. 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.pars eHtmlError(BugzillaClient.java:1221) 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.post TaskData(BugzillaClient.java:868) 
	at  org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHan dler.postTaskData(BugzillaTaskDataHandler.java:254) 
	at test.main(test.java:47) 
 
 
can I any one help me  
thanks in advance
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03696 seconds