Community
Participate
Working Groups
Importing any EE artifact will fail if any of the zip entries contain leading slashes, e.g "/foo.txt" instead of "foo.txt". It's not clear to me how the exmple ear archive was created, but it fails with an exception like the following: java.lang.RuntimeException: /com/ibm/websphere/csi/ must be relative. at org.eclipse.jst.jee.archive.AbstractArchiveLoadAdapter.verifyRelative(Unknown Source) at org.eclipse.jst.jee.archive.AbstractArchiveLoadAdapter.createDirectory(Unknown Source) at org.eclipse.jst.jee.archive.internal.ZipFileArchiveLoadAdapterImpl.createFile(Unknown Source) at org.eclipse.jst.jee.archive.internal.ZipFileArchiveLoadAdapterImpl.getArchiveResources(Unknown Source) at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities$JavaEEWrappingLoadAdapter.getArchiveResources(Unknown Source) at org.eclipse.jst.jee.archive.internal.ArchiveImpl.getArchiveResources(Unknown Source) at org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper.getSize(Unknown Source) at org.eclipse.jst.j2ee.internal.archive.operations.EARComponentImportOperation.computeTotalWork(Unknown Source) at org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactImportOperation.execute(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1CatchThrowableRunnableWithProgress.run(Unknown Source) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown Source) The fix is very simple and safe which is to ensure the paths are relative by calling Path.makeRelative(). This method will return itself if it is already relative so will not have performance implications.
Created attachment 168286 [details] patch
I approve of this fix.
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. Import fails with exceptions * Is there a work-around? If so, why do you believe the work-around is insufficient? No * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? UI * Give a brief technical overview. Who has reviewed this fix? See description * What is the risk associated with this fix? No
code checked into head for wtp 32 rc1