Community
Participate
Working Groups
Steps to reproduce - create a new EAR project - go to Deployment Assembly page - add Archive via Path Variable - select a jar from the M2_REPO variable - click finish Results in - no library added to deployment assembly - Unhandled event loop exception in Error log: org.eclipse.core.runtime.AssertionFailedException: Adapter factory org.eclipse.jst.j2ee.internal.common.VirtualArchiveComponentAdapterFactory@88d308b returned org.eclipse.core.runtime.Path that is not an instance of org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:307) at org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent.getAdapter(VirtualArchiveComponent.java:227) at org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent.getUnderlyingDiskFile(VirtualArchiveComponent.java:282) at org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent.getAdapter(VirtualArchiveComponent.java:215) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentLoadAdapter.recomputeArchivePath(JavaEEBinaryComponentLoadAdapter.java:73) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentLoadAdapter.<init>(JavaEEBinaryComponentLoadAdapter.java:48) at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities.openBinaryArchive(JavaEEArchiveUtilities.java:250) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper$ArchiveCache.openArchive(JavaEEBinaryComponentHelper.java:612) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.openArchive(JavaEEBinaryComponentHelper.java:470) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getUniqueArchive(JavaEEBinaryComponentHelper.java:422) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getArchive(JavaEEBinaryComponentHelper.java:415) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getJavaEEQuickPeek(JavaEEBinaryComponentHelper.java:98) at org.eclipse.jst.j2ee.internal.ui.preferences.EarModuleDependenciesPropertyPage.handleAddDirective(EarModuleDependenciesPropertyPage.java:407) at org.eclipse.wst.common.componentcore.ui.propertypage.AddModuleDependenciesPropertiesPage.showReferenceWizard(AddModuleDependenciesPropertiesPage.java:619) at org.eclipse.wst.common.componentcore.ui.propertypage.AddModuleDependenciesPropertiesPage.handleAddReferenceButton(AddModuleDependenciesPropertiesPage.java:556) at org.eclipse.wst.common.componentcore.ui.propertypage.AddModuleDependenciesPropertiesPage.handleEvent(AddModuleDependenciesPropertiesPage.java:548) at org.eclipse.jst.j2ee.internal.ui.preferences.EarModuleDependenciesPropertyPage.handleEvent(EarModuleDependenciesPropertyPage.java:259) This issue prevents m2e-wtp from working properly, as it heavily relies on adding library dependencies from the M2_REPO variable, to keep portable references in eclipse settings. Causes countless error popups with: "Errors running builder 'Faceted Project Validation Builder' on project 'app-web'. Adapter factory org.eclipse.jst.j2ee.internal.common.VirtualArchiveComponentAdapterFactory@3c3e645a returned org.eclipse.core.runtime.Path that is not an instance of org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent"
How is this class intended to function? It seems it adapts all things to IPath when it's supposed to adapt things to VirtualArchiveComponent? public class VirtualArchiveComponentAdapterFactory implements IAdapterFactory { public Object getAdapter(Object adaptableObject, Class adapterType) { if (adapterType == VirtualArchiveComponent.ADAPTER_TYPE ) { VirtualArchiveComponent component = (VirtualArchiveComponent) adaptableObject; IPath path = J2EEProjectUtilities.getResolvedPathForArchiveComponent(component.getName()); return path; } return null; } public Class[] getAdapterList() { return new Class[]{VirtualArchiveComponent.class}; } }
https://git.eclipse.org/r/#/c/90539/ - Recent patch to platform enforcing adapters behave properly https://git.eclipse.org/r/#/c/90540/ - An added test case One month ago, it seems the platform added explicit checks to make sure all adapters were behaving and returning an object of the same class they were requested to adapt to. That means VirtualArchiveComponentAdapterFactory is out of spec with the current requirements of platform, because it adapts an object to an IPath when requested to adapt to a VirtualArchiveComponent
New Gerrit change created: https://git.eclipse.org/r/94623
New Gerrit change created: https://git.eclipse.org/r/94624
Sorry, I duplicated two changes by accident. The proper PR is https://git.eclipse.org/r/#/c/94624/ Unfortunately the build is failing because it is using java7 and requires java 8. Hope we can get that fixed soon.
Since the fix appears to be in J2EE Tools, I am moving it there.
Would be nice to have regression tests that show classpath variable-based dependencies are supported :-)
It seems it's not limited to jeetools. My patch is incomplete and also requires a change to common as well. My patch causes an infinite loop in VirtualArchiveComponent, because it's still trying to adapt a VirtualArchiveComponent to a VirtualArchiveComponent (a strange thing to do) when it's really trying to adapt it to an IPath. Webtools.common doesn't seem to have gerrit? I have a patch here: https://github.com/robstryker/webtools.common/tree/514672 These two patches together basically serve one purpose: the current behavior is trying to adapt a VirtualArchiveComponent to a VirtualArchiveComponent, and expecting an IPath in return. This is clearly broken. Instead, we should be trying to adapt the VirtualArchiveComponent to an IPath. Fred has both of these changes applied in his workspace and indicates that they seem to work. But I can't even replicate the original bug so I'm not much help :( Either way, these two patches need to be considered in unison, not separately. https://github.com/robstryker/webtools.common/commit/8b76ed44233cae9de39de45c316f8eb00c0aa12c https://git.eclipse.org/r/#/c/94624/
*** Bug 515495 has been marked as a duplicate of this bug. ***
Gerrit change https://git.eclipse.org/r/94624 was merged to [master]. Commit: http://git.eclipse.org/c/jeetools/webtools.javaee.git/commit/?id=515cf02aad551df026713512291a9d72c5d111b2
I committed a version of https://github.com/robstryker/webtools.common/commit/8b76ed44233cae9de39de45c316f8eb00c0aa12c that had a capitalization fix (so that it compiled correctly). (Note that the IP Log flag does not need to be set here, since Rob is a committer on common). Chuck already pushed the J2EE change through Gerrit, so this should be fixed now, for Oxygen M7.
I got this error on Eclipse 4.7 RC2 Errors occurred during the build. Errors running builder 'Faceted Project Validation Builder' on project 'AdijedEJB.ear'. Adapter factory org.eclipse.jst.j2ee.internal.common.VirtualArchiveComponentAdapterFactory@6baa1f57 returned org.eclipse.core.runtime.Path that is not an instance of org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent
report https://dev.eclipse.org/recommenders/community/aeri/v2/#!/submissions/2fbkD78qdb0OOmdXikoy3Llc1sHJFocvLzJc4vcOy3iVm3kQgqi6uADHSuGkW1ec
(In reply to Filippo Rossoni from comment #12) > I got this error on Eclipse 4.7 RC2 > > Errors occurred during the build. > Errors running builder 'Faceted Project Validation Builder' on project > 'AdijedEJB.ear'. > Adapter factory > org.eclipse.jst.j2ee.internal.common. > VirtualArchiveComponentAdapterFactory@6baa1f57 returned > org.eclipse.core.runtime.Path that is not an instance of > org.eclipse.wst.common.componentcore.internal.resources. > VirtualArchiveComponent Was this using an EPP? We found an issue where BIRT was contributing an older version of WTP to the EPPs- that was fixed for RC3.
Yes is the packaged version I'm behind a proxy and the update didn't work