Announcement Announcement Module
Collapse
No announcement yet.
Content type extensions had UI dependencies Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Content type extensions had UI dependencies

    (I was ready to open a JIRA for this, but I gather it's good practice to mention this in the Forum first

    The STS bundle com.springsource.sts.config.ui registers some contentType extensions (i.e. using org.eclipse.core.contenttype.contentTypes) in a UI plugin. At least it does in 2.3.3.CI-R5547-B44.

    While this could be OK to do from a UI plugin (at least I think), the problem is that the first time the code is loaded (e.g. when describeContent is , it will trigger an start of the bundle and its dependencies, which will not work there is no UI (yet). So the non-UI API for resources, etc. is now suddenly dependent on UI.

    This stack trace (from a non-UI JUnit test inside WTP running against a Helios installation containing STS) explains it best:

    org.eclipse.swt.SWTError: Invalid thread access
    at org.eclipse.ui.plugin.AbstractUIPlugin.createImage Registry(AbstractUIPlugin.java:213)
    at org.eclipse.ui.plugin.AbstractUIPlugin.getImageReg istry(AbstractUIPlugin.java:257)
    at org.springframework.ide.eclipse.beans.ui.namespace s.NamespaceUtils.getImage(NamespaceUtils.java:345)
    at org.springframework.ide.eclipse.beans.ui.namespace s.NamespaceUtils.getNamespaceDefinitions(Namespace Utils.java:187)
    at org.springframework.ide.eclipse.beans.ui.namespace s.NamespaceUtils.getNamespaceDefinitions(Namespace Utils.java:131)
    at com.springsource.sts.config.ui.contenttype.SpringE lementContentDescriber.checkCriteria(SpringElement ContentDescriber.java:60)
    at com.springsource.sts.config.ui.contenttype.SpringE lementContentDescriber.describe(SpringElementConte ntDescriber.java:78)
    at org.eclipse.core.internal.content.ContentTypeCatal og.describe(ContentTypeCatalog.java:218)
    at org.eclipse.core.internal.content.ContentTypeCatal og.collectMatchingByContents(ContentTypeCatalog.ja va:190)
    at org.eclipse.core.internal.content.ContentTypeCatal og.internalFindContentTypesFor(ContentTypeCatalog. java:403)
    at org.eclipse.core.internal.content.ContentTypeCatal og.internalFindContentTypesFor(ContentTypeCatalog. java:450)
    at org.eclipse.core.internal.content.ContentTypeCatal og.findContentTypesFor(ContentTypeCatalog.java:298 )
    at org.eclipse.core.internal.content.ContentTypeMatch er.findContentTypeFor(ContentTypeMatcher.java:38)
    at org.eclipse.wst.sse.core.internal.modelhandler.Mod elHandlerRegistry.getHandlerFor(ModelHandlerRegist ry.java:215)
    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl.calculateType(ModelManagerImpl.java:734)
    at org.eclipse.wst.sse.core.internal.model.ModelManag erImpl.getModelForRead(ModelManagerImpl.java:1458)
    at org.eclipse.wst.xml.xpath2.processor.test.TestWTPD OMXPath2.load(TestWTPDOMXPath2.java:1789)
    at org.eclipse.wst.xml.xpath2.processor.test.TestWTPD OMXPath2.test_ForExpr005(TestWTPDOMXPath2.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at junit.framework.TestCase.runTest(TestCase.java:168 )
    at junit.framework.TestCase.runBare(TestCase.java:134 )
    at junit.framework.TestResult$1.protect(TestResult.ja va:110)
    at junit.framework.TestResult.runProtected(TestResult .java:128)
    at junit.framework.TestResult.run(TestResult.java:113 )
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:2 32)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at junit.framework.TestSuite.runTest(TestSuite.java:2 32)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run( JUnit38ClassRunner.java:83)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
    at org.eclipse.pde.internal.junit.runtime.RemotePlugi nTestRunner.main(RemotePluginTestRunner.java:62)
    at org.eclipse.pde.internal.junit.runtime.CoreTestApp lication.run(CoreTestApplication.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppContain er.callMethodWithException(EclipseAppContainer.jav a:587)
    at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known 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.ja va:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:14 07)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1 383)

    The offending class is com.springsource.sts.config.ui.contenttype.SpringE lementContentDescriber.
    The JavaDoc for IContentDescriber explains the requirement for this to not happen. The easiest option is to move this into a bundle which has no UI dependencies.

    Hope this helps. Shall I open a JIRA?

  • #2
    Yes please open a JIRA for this, as I think this will also require changes to Spring IDE's NamespaceUtils.
    Last edited by ldossantos; Aug 12th, 2010, 03:35 PM.

    Comment

    Working...
    X