6 Replies Latest reply on Sep 1, 2008 7:29 AM by maxandersen

    Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137)

    mail.micke

      Hi,
      using a nightly from the 26th of July with eclipse 3.4 and get the following uncaught NPE :

      java.lang.NullPointerException
       at org.jboss.tools.vpe.editor.util.DocTypeUtil.getDoctype(DocTypeUtil.java:137)
       at org.jboss.tools.vpe.editor.util.DocTypeUtil.getDoctype(DocTypeUtil.java:60)
       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:213)
       at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor.createPages(JSPMultiPageEditor.java:408)
       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)
       at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:266)
       at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2820)
       at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2729)
       at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2721)
       at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2673)
       at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
       at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
       at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2652)
       at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2643)
       at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
       at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
       at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:318)
       at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:160)
       at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
       at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:207)
       at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
       at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
       at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:363)
       at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open(PackageExplorerPart.java:603)
       at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
       at org.eclipse.core.runtime.Platform.run(Platform.java:880)
       at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
       at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
       at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
       at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
       at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
       at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
       at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
       at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
       at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
       at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
       at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
       at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
       at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
       at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
       at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
       at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
       at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
      
      


      Currently get this for every XHTML page which uses a template.

      Cheers,
      Micke


        • 1. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
          nhpvti

          Hi,

          I've the same problem in Eclipse 3.4 with JBoss Tools 3.0.0 Alpha1 installed via Eclipse Update


          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)


          aret there any news?

          • 2. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
            dgolovin

            What kind of XHTML are you opening, could you post here a simple example that fails for you with error your mentioned above?

            • 3. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
              maxandersen

              Yes, please report bugs in jira with steps on how to reproduce - otherwise we can't really give you news :)

              • 4. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
                nhpvti

                Hi,

                Yes, please report bugs in jira with steps on how to reproduce - otherwise we can't really give you news :)


                I was not sure that this is a bug, it could be programming mistake or misconfiguration.

                There are no Null Pointer exceptions on Windows workstations, only on a Linux one.

                After some research I've discovered that the problem occurs if our XHTML files start with "<html xmlns=...", e.g.:

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:s="http://jboss.com/products/seam/taglib"
                 xmlns:a="https://ajax4jsf.dev.java.net/ajax"
                 xmlns:rich="http://richfaces.ajax4jsf.org/rich">
                <ui:composition template="/layout/template.xhtml">


                And there is no problem when XHTML files start with "<ui:composition...", e.g.:

                <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <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:a="https://ajax4jsf.dev.java.net/ajax"
                 xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                 template="layout/template.xhtml">
                


                Now after migration to the 2nd "style" there are no null pointer exceptions any more during opening XHTML files,
                but Visual Editor is still not working on my Linux workstation :-(

                The following link didn't help:
                http://wiki.jboss.org/wiki/JBosstoolsVisualEditorFAQ
                There is already compat-libstdc++-5.0.7-22.2 installed and symbolic link libstdc++.so.5 pointing to it already exists.

                But hope that this will help...
                https://jira.jboss.org/jira/browse/JBDS-170

                • 5. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
                  maxandersen

                  JBDS -170 is an old issue, did you open another one ?

                  • 6. Re: Nightly: NPE DocTypeUtil.getDoctype(DocTypeUtil.java:137
                    maxandersen

                    I can see https://jira.jboss.org/jira/browse/JBIDE-2711 have been created that resembles this issue.