1 Reply Latest reply on Sep 26, 2008 5:40 AM by Max Rydahl Andersen

    Founded the failure of org.jboss.tools.vpe.editor.util.DocTy

    nimo stephan Master

      I found out, why and when this failure occurs:

      java.lang.NullPointerException
       at org.jboss.tools.vpe.editor.util.DocTypeUtil.getDoctype(DocTypeUtil.java:153)
       at org.jboss.tools.vpe.editor.util.DocTypeUtil.getDoctype(DocTypeUtil.java:71)
       at org.jboss.tools.vpe.editor.mozilla.MozillaEditor.createPartControl(MozillaEditor.java:281)
       at org.jboss.tools.vpe.editor.VpeEditorPart.createVisualEditor(VpeEditorPart.java:754)
       at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor.pageChange(JSPMultiPageEditor.java:223)
       at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor.createPages(JSPMultiPageEditor.java:421)
       at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart.createPartControl(JSPMultiPageEditorPart.java:125)
       at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
       at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)
       at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)



      It has to do with the kind of embeeding the template.

      I have following structure:

      view (root-directory)
      -themes
      --templates
      ---myTemplate.xhtml

      -pages
      -myPage.xhtml

      Now, I embeed the 'myTemplate.xhtml' in 'myPage.xhtml':


      The Visual Editor works with this:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       template="../themes/template/templateMain.xhtml" >
      ..



      When I do this, then the Editor throws the exception:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       template="/themes/template/templateMain.xhtml" >
      ..


      The change from
      template="/themes/template/templateMain.xhtml" >

      to
      template="../themes/template/templateMain.xhtml" >

      throws the exception "Could not open the editor: An unexpected exception was thrown."

      However, I have to change it to:
      template="../themes/template/templateMain.xhtml" >


      because with that:
      template="/themes/template/templateMain.xhtml" >


      The ServletContainer does not find my template:

      07:05:04,096 WARN [factory] /themes/template/template.xhtml not found at jndi:/localhost/myProject/themes/template/template.xhtml



      But that:
      template="../themes/template/templateMain.xhtml" >


      throws the exception of JBoss Tools.


      Any Suggestions?