| Summary: | P2 Nullpointer Exception at RepositoryTransport.download | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Suganya Devi <suganyadevi.selvaraj> | ||||||
| Component: | p2 | Assignee: | P2 Inbox <equinox.p2-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | henrik.lindberg, irbull, jasonab, pascal, thomas, w.northcott | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.7 M3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 330030 | ||||||||
| Attachments: |
|
||||||||
Created attachment 177001 [details]
Remote P2 repository structure
Is this something to do with the proxy setting? Can someone have a look at this issue? Pascal, this seems to be a duplicate of bug 313732 (which is a duplicate of bug 313502). Although the problem may be with the setup of an external bundle, it seems like we should be protecting against an NPE. The javadoc for Job#getResult says that it may return null so we should be checking for it. What should we do in this case? Which type of exception should we throw? It works fine with the local repository. Also, I noticed that the logic to download the index file from remote P2 repository is different from the local repository. I thought the index files are optional ones. (In reply to comment #4) > Pascal, this seems to be a duplicate of bug 313732 (which is a duplicate of bug > 313502). > > Although the problem may be with the setup of an external bundle, it seems like > we should be protecting against an NPE. The javadoc for Job#getResult says that > it may return null so we should be checking for it. What should we do in this > case? Which type of exception should we throw? It currently does this: IStatus result = reader.getResult(); if (result.getSeverity() == IStatus.CANCEL) throw new UserCancelledException(); if (!result.isOK()) throw new CoreException(result); // Download status is expected on success DownloadStatus status = new DownloadStatus(IStatus.OK, Activator.ID, Status.OK_STATUS.getMessage()); return statusOn(target, status, reader); I think it is enough to return statusOn(...) with a DownloadStatus having IStatus.ERROR, and code ProvisionException.REPOSITORY_FAILED_READ, and suitable message. (In reply to comment #4) > Although the problem may be with the setup of an external bundle, it seems like Can you please explain me what kind of a problem it could be? Even if the NPE is fixed, my download from remote repository would still fail. So I would like to resolve that as well. Ok, I've released a fix with Henrik's suggestions to protect against the NPE. Bug 313732 comment 9 says that it is because of a problem with SLF4J. Perhaps Pascal can comment on this further for you. (In reply to comment #8) > Ok, I've released a fix with Henrik's suggestions to protect against the NPE. Can you please tell me where can I get the patch from? > Bug 313732 comment 9 says that it is because of a problem with SLF4J. Perhaps > Pascal can comment on this further for you. Bug 313732 is breaking because of SLF4J, but our RCP application is not. Anyways, will wait for Pascal to answer this. You can see it in CVS here: server: dev.eclipse.org repo: /cvsroot/rt path: org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository (In reply to comment #10) Applied the patch and included in my RCP application. It doesn't throw NPE at RepositoryTransport. But, I see exceptions in loading simpleRepository and compositeRepository. Please see the attached .log file. Also the update is not downloaded. Created attachment 180275 [details]
ECF filetransfer exception
Note: I'm getting INFO status with STATUS_NOTHING_TO_UPDATE. (In reply to comment #13) > Note: I'm getting INFO status with STATUS_NOTHING_TO_UPDATE. The stack trace has this at the top: java.lang.NoClassDefFoundError at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientBrowseFileTransferFactory$1.sendBrowseRequest(HttpClientBrowseFileTransferFactory.java:53) at org.eclipse.ecf.provider.filetransfer.browse.MultiProtocolFileSystemBrowserAdapter.sendBrowseRequest(MultiProtocolFileSystemBrowserAdapter.java:95) at org.eclipse.equinox.internal.p2.repository.FileInfoReader.sendBrowseRequest(FileInfoReader.java:181) This indicates that ECF is not configured correctly. Guessing that HttpClient is missing in your configuration (i.e. not a p2 issue, although if this results in a silent "nothing to update", than this is no good and should be logged as separate issue "misconfigured ECF is (almost) silently ignored" (In reply to comment #14) Henrik, Thanks for the tip. I will check the configuration. But, the same application downloads the update if I point to a local repository / map the remote repository to a local drive. (In reply to comment #15) OMG, it works now. Once again thanks for the tip on HttpClient. I verified the configuration, and found that all the ECF file transfer and related bundles were available and started properly. So I just included a piece of line in one of our class files to invoke HttpClient (to see if it throws NoClassDefFoundError). When I started the application, I got InvocationTarget exception caused by the following ClassCastException at HttpClient. "The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'com.ibm.ws.commons.logging.TrLogFactory' cannot be converted to 'org.apache.commons.logging.LogFactory'................." HttpClient has a static loader (at line 66) and it was loading WebSphere's TrLogFactory, which caused the ClassCastException. So, the HttpClient was not loaded and further caused NoClassDefFoundError at HttpClientBrowseFileTransferFactory. I found the explanation and fixes for the ClassCastException at http://commons.apache.org/logging/troubleshooting.html#Symptoms. I added "-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl" to the system properties and when I started the application, it downloaded from the remote P2 repository and updated perfectly. Thanks for the all the help and support from P2 team. Is there some workaround for this other then applying the patch? I get the same error when I use the director app. Slightly different stack trace. java.lang.NullPointerException at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:75) at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:127) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:718) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:639) at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:99) at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:95) at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.initializeRepositories(DirectorApplication.java:380) at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.run(DirectorApplication.java:796) at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.start(DirectorApplication.java:954) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at If you apply the patch you might come to know the root cause (as in my case). If you can identify & fix the root cause, there is no need to apply the patch. But, I applied the patch even though the root cause in my application was fixed. *** Bug 327172 has been marked as a duplicate of this bug. *** This bug may be the cause for some people... Spring IDE: https://jira.springsource.org/browse/IDE-1163 |
Build Identifier: 3.6.0 I20100608-0911 I'm following the Product based build for our RCP application. The build creates a local repository in the build directory in my local system. Once the build is successful, I copy the P2 repository to a remote URL (http). The application is pointing to the remote URL. Now when I start my application, I'm getting NullPointer Exception at RepositoryTransport.download(RepositoryTransport.java:75). If I connect to the local repository (in build directory), it works fine. The following is the exception that I'm getting, java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:477) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at ams.client.eclipse.actions.UpdateAction.run(Unknown Source) at ams.client.eclipse.AMSClientWorkbenchAdvisor.preStartup(Unknown Source) at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1564) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2537) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at ams.client.eclipse.AMSClient.start(Unknown Source) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Caused by: java.lang.NullPointerException at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:75) at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:127) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:719) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:640) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92) at org.eclipse.equinox.p2.engine.ProvisioningContext.loadMetadataRepository(ProvisioningContext.java:211) at org.eclipse.equinox.p2.engine.ProvisioningContext.getLoadedMetadataRepositories(ProvisioningContext.java:194) at org.eclipse.equinox.p2.engine.ProvisioningContext.getMetadata(ProvisioningContext.java:275) at org.eclipse.equinox.internal.p2.director.SimplePlanner.updatesFor(SimplePlanner.java:769) at org.eclipse.equinox.p2.operations.UpdateOperation.updatesFor(UpdateOperation.java:144) at org.eclipse.equinox.p2.operations.UpdateOperation.computeProfileChangeRequest(UpdateOperation.java:181) at org.eclipse.equinox.p2.operations.UpdateOperation$1.run(UpdateOperation.java:325) at org.eclipse.equinox.internal.p2.operations.SearchForUpdatesResolutionJob.runModal(SearchForUpdatesResolutionJob.java:37) at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:115) at ams.client.eclipse.actions.UpdateAction$Runner.checkForUpdates(Unknown Source) at ams.client.eclipse.actions.UpdateAction$Runner.run(Unknown Source) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) Reproducible: Always