Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-19028

Prefix string too short prevents EL content assist with Seam taglib

XMLWordPrintable

    • Hide

      1. Install JBoss Tools with Seam Tools into Eclipse Luna SR1 (verify XML Catalog shows "s.tld" file as a plugin specified entry for "http://jboss.com/products/seam/taglib" URI)
      2. Create a Dynamic Web Project with Facelet (XHTML) file:
      <ui:composition
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:s="http://jboss.com/products/seam/taglib">
      <!-- any content here -->
      </ui:composition>

      3. Open this file in Visual Page Editor (Source Tab) and try any Content Assist (Ctrl+space) in EL.

      Eclipse Error Log will show at least one "prefix too short" error message.

      Show
      1. Install JBoss Tools with Seam Tools into Eclipse Luna SR1 (verify XML Catalog shows "s.tld" file as a plugin specified entry for "http://jboss.com/products/seam/taglib" URI) 2. Create a Dynamic Web Project with Facelet (XHTML) file: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"> <!-- any content here --> </ui:composition> 3. Open this file in Visual Page Editor (Source Tab) and try any Content Assist (Ctrl+space) in EL. Eclipse Error Log will show at least one "prefix too short" error message.

      When Seam Tools is installed in Eclipse Luna SR1, Expression Language (EL) content assist in Visual Page Editor stopped working (no suggestion at all, JBoss related or not). This occurs only when xmlns:s="http://jboss.com/products/seam/taglib" tag library is used in a Facelet page.

      Eclipse log shows following stacktrace on any such content assist attempt:

      org.jboss.tools.common.validation.JBTValidationException: Prefix string too short
      at org.jboss.tools.common.validation.AsYouTypeValidatorManager.validate(AsYouTypeValidatorManager.java:187)
      at org.jboss.tools.common.validation.AsYouTypeValidatorManager.validateString(AsYouTypeValidatorManager.java:205)
      at org.jboss.tools.common.validation.AsYouTypeValidatorManager.validateString(AsYouTypeValidatorManager.java:200)
      at org.jboss.tools.common.validation.AsYouTypeValidatorManager.validate(AsYouTypeValidatorManager.java:254)
      at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.validate(ReconcileStepForValidator.java:381)
      at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.reconcileModel(ReconcileStepForValidator.java:259)
      at org.eclipse.jface.text.reconciler.AbstractReconcileStep.reconcile(AbstractReconcileStep.java:95)
      at org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy.reconcile(ValidatorStrategy.java:269)
      at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:321)
      at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:258)
      at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor$BackgroundThread.run(DirtyRegionProcessor.java:691)
      Caused by: java.lang.IllegalArgumentException: Prefix string too short
      at java.io.File.createTempFile(File.java:2001)
      at org.jboss.tools.jst.web.kb.taglib.TagLibraryManager.convertUriToFile(TagLibraryManager.java:182)
      at org.jboss.tools.jst.web.kb.taglib.TagLibraryManager.getStaticTLD(TagLibraryManager.java:100)
      at org.jboss.tools.jst.web.kb.internal.StaticLibraries.getLibraries(StaticLibraries.java:44)
      at org.jboss.tools.jst.web.kb.internal.KbProject.getTagLibraries(KbProject.java:135)
      at org.jboss.tools.jst.web.kb.taglib.TagLibraryManager.getLibraries(TagLibraryManager.java:57)
      at org.jboss.tools.jst.web.kb.PageContextFactory.fillXMLNamespacesForNode(PageContextFactory.java:996)
      at org.jboss.tools.jst.web.kb.PageContextFactory.fillContextForNode(PageContextFactory.java:698)
      at org.jboss.tools.jst.web.kb.PageContextFactory.fillContextForChildNodes(PageContextFactory.java:687)
      at org.jboss.tools.jst.web.kb.PageContextFactory.createPageContext(PageContextFactory.java:431)
      at org.jboss.tools.jst.web.kb.PageContextFactory.createPageContext(PageContextFactory.java:236)
      at org.jboss.tools.jst.web.kb.PageContextFactory.createPageContext(PageContextFactory.java:199)
      at org.jboss.tools.jst.web.kb.PageContextFactory.createPageContext(PageContextFactory.java:184)
      at org.jboss.tools.jst.web.kb.internal.validation.ELValidator.validate(ELValidator.java:253)
      at org.jboss.tools.common.validation.AsYouTypeValidatorManager.validate(AsYouTypeValidatorManager.java:183)
      ... 10 more

      Digging more deeply into the cause, Eclipse loaded a plugin specified entry for this URI as:

      Entry element: URI
      Location: taglibs\tld\s.tld in jar file C:\DevTools\IDE\eclipse\eclipse-ee-luna-sr1-64bit\plugins\org.jboss.tools.seam.core_3.6.1.Final-v20141209-0505-B79.jar
      URI: jar:file:/C:/DevTools/IDE/eclipse/eclipse-ee-luna-sr1-64bit/plugins/org.jboss.tools.seam.core_3.6.1.Final-v20141209-0505-B79.jar!/taglibs/tld/s.tld
      Key type: URI
      Key: http://jboss.com/products/seam/taglib

      Line 182 of org.jboss.tools.jst.web.kb.taglib.TagLibraryManager shows the "too short" prefix is derived from the name of the file. Here, the culprit prefix is "s" (derived from "s.tld"). Temporary file prefix must be at least 3 characters long (javadoc: http://docs.oracle.com/javase/8/docs/api/java/io/File.html#createTempFile-java.lang.String-java.lang.String-java.io.File-).

      I managed to work around this issue temporarily by renaming s.tld and s.taglib.xml in org.jboss.tools.seam.core_3.6.1.Final-v20141209-0505-B79.jar to seam.tld and seam.taglib.tld respectively. Then I changed the entry in JAR's plugin.xml accordingly and started eclipse with "-clean" option for the changes to take effect. Now, content assist runs expectedly.

      Either renaming the plugin's TLD file or ensuring the minimum prefix length in code should do the trick.

            scabanovich Viacheslav Kabanovich (Inactive)
            jurri@jurri.cz Jiří Jansa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: