| Summary: | NPE when using "autodetect workflow" (XMLRPC) | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Severin Gehwolf <sgehwolf> | ||||||||||||
| Component: | Mylyn | Assignee: | Frank Becker <eclipse> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Frank Becker <eclipse> | ||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | overholt, robert.elves, steffen.pingel | ||||||||||||
| Version: | 3.5 | ||||||||||||||
| Target Milestone: | 3.6 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Linux | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Severin Gehwolf
Created attachment 194429 [details]
Fedora's MANIFEST.MF patch to make xmlrpc work with the system library
We use the system xmlrpc
$ rpm -q xmlrpc3-client
xmlrpc3-client-3.1.3-5.fc15.noarch
A little debugging discovered that location.getCredentials(AuthenticationType.REPOSITORY) in BugzillaClient.java returns null and getUserName() is called on that object without checking for null. When I change the code to:
private BugzillaXmlRpcClient getXmlRpcClient() {
boolean useXMLRPC = Boolean.parseBoolean(configParameters.get(IBugzillaConstants.BUGZILLA_USE_XMLRPC));
if (useXMLRPC && xmlRpcClient == null) {
WebLocation webLocation = new WebLocation(this.repositoryUrl + "/xmlrpc.cgi"); //$NON-NLS-1$
String username = ""; //$NON-NLS-1$
String password = ""; //$NON-NLS-1$
if (location.getCredentials(AuthenticationType.REPOSITORY) != null) {
username = location.getCredentials(AuthenticationType.REPOSITORY).getUserName();
}
if (location.getCredentials(AuthenticationType.REPOSITORY) != null) {
password = location.getCredentials(AuthenticationType.REPOSITORY).getPassword();
}
webLocation.setCredentials(AuthenticationType.REPOSITORY, username, password);
xmlRpcClient = new BugzillaXmlRpcClient(webLocation);
xmlRpcClient.setContentTypeCheckingEnabled(true);
}
return xmlRpcClient;
}
I get a bit further, but this does not allow me to a.) use anonymous connections (XMLRPC error username/pwd invalid) and b.) if I use valid credentials I get:
java.lang.NullPointerException
at org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient.updateProductInfo(BugzillaXmlRpcClient.java:379)
at org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient.updateConfiguration(BugzillaXmlRpcClient.java:370)
at org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.getRepositoryConfiguration(BugzillaClient.java:751)
at org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.getTaskData(BugzillaClient.java:1981)
at org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler.getMultiTaskData(BugzillaTaskDataHandler.java:337)
at org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler.getTaskData(BugzillaTaskDataHandler.java:261)
at org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector.getTaskData(BugzillaRepositoryConnector.java:526)
at org.eclipse.mylyn.internal.tasks.ui.OpenRepositoryTaskJob.run(OpenRepositoryTaskJob.java:112)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
In general, I think it would be a good to move to Import-Package over Require-Bundle ([1][2]) entirely ;-)
[1] http://www.osgi.org/blog/2008/06/jsr-277-and-import-package.html
[2] http://www.osgi.org/blog/2006/04/misconceptions-about-osgi-headers.html
Thanks for having a look at this.
I can reproduce by using R_3_5_0 and apply the attached MANIFEST.MF patch and using said system library (which comes from: http://ws.apache.org/xmlrpc/) Created attachment 194532 [details]
patch V2
Steffen,
I did not know what we need to change in org.eclipse.mylyn.relang and org.eclipse.mylyn.gerrit.tests.
Can you look into this?
Created attachment 194533 [details]
mylyn/context/zip
Frank, let's carefully consider that change from Import-Package to Require-Bundle since it impacts downstream integrators and requires careful testing. As far as I understand it's a separate concern from the problem described on this bug? If that is the case please open a separate bug report to change that for all distributed bundles. If the problem is related to the XML-RPC dependency please clarify how it impacts the credentials handling. (In reply to comment #6) > Frank, let's carefully consider that change from Import-Package to > Require-Bundle since it impacts downstream integrators and requires careful > testing. As far as I understand it's a separate concern from the problem > described on this bug? If that is the case please open a separate bug report to > change that for all distributed bundles. If the problem is related to the > XML-RPC dependency please clarify how it impacts the credentials handling. Steffen, I change this from Require-Bundle to Import-Package. But maybe I include some errors. I agree that we should be careful. Severin, can you file a separate bug for changing require bundle to import package? We won't be able to do that for 3.6 but we can consider it for the next release. Frank, did you already commit the changes to BugzillaClient? I think those make sense to fix the NPE but I would prefer if we didn't change manifests and features at this point. Created attachment 196303 [details]
patch V3
committed patch.
This only fix the NPE!!!
Created attachment 196304 [details]
mylyn/context/zip
Thanks Frank. I'll mark this as resolved. Severin, please feel free to open another bug for the manifest changes. |