Details

      Description

      Steps to Reproduce:

      1. Checkout the 4.0.0 branch of the Bridge Implementation:

      cd ~/Projects/liferay.com/liferay-faces-bridge-impl && git checkout 4.0.0
      

      2. Start Netbeans with an empty user dir (reproduced with 8.1 but likely occurs with other versions):

      /Applications/NetBeans/NetBeans\ 8.1.app/Contents/MacOS/netbeans --userdir ~/tmp/
      

      3. Open the Bridge Implementation project in Netbeans:

      /Applications/NetBeans/NetBeans\ 8.1.app/Contents/MacOS/netbeans --open ./
      

      4. Open alloy-applicant-portlet's applicant.xhtml:

      /Applications/NetBeans/NetBeans\ 8.1.app/Contents/MacOS/netbeans --open ./demo/alloy-applicant-portlet/src/main/webapp/WEB-INF/views/applicant.xhtml
      

      5. In applicant.xhtml, attempt to complete an Alloy component by typing "<alloy:" and pressing Ctrl + Space.

      If the bug still exists, the Notifications window will show the following error message: Unexpected Exception. If you click on the error and click Show Details in the window that pops up, the following exception will be displayed:

      java.lang.NullPointerException: Unable locate service for com.liferay.faces.util.logging.LoggerFactory
          at com.liferay.faces.util.logging.LoggerFactory.<clinit>(LoggerFactory.java:47)
      Caused: java.lang.ExceptionInInitializerError
          at com.liferay.faces.alloy.taghandler.LoadConstants.<clinit>(LoadConstants.java:41)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:340)
          at org.netbeans.modules.web.jsf.editor.facelets.mojarra.FaceletsTaglibConfigProcessor.loadClass(FaceletsTaglibConfigProcessor.java:223)
          at org.netbeans.modules.web.jsf.editor.facelets.mojarra.FaceletsTaglibConfigProcessor.processHandlerClass(FaceletsTaglibConfigProcessor.java:408)
          at org.netbeans.modules.web.jsf.editor.facelets.mojarra.FaceletsTaglibConfigProcessor.processTags(FaceletsTaglibConfigProcessor.java:364)
          at org.netbeans.modules.web.jsf.editor.facelets.mojarra.FaceletsTaglibConfigProcessor.processTagLibrary(FaceletsTaglibConfigProcessor.java:312)
          at org.netbeans.modules.web.jsf.editor.facelets.mojarra.FaceletsTaglibConfigProcessor.process(FaceletsTaglibConfigProcessor.java:255)
          at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport.parseLibraries(FaceletsLibrarySupport.java:422)
          at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport._findLibraries(FaceletsLibrarySupport.java:346)
          at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport.findLibraries(FaceletsLibrarySupport.java:291)
          at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport.getLibraries(FaceletsLibrarySupport.java:193)
          at org.netbeans.modules.web.jsf.editor.JsfSupportImpl.getLibrary(JsfSupportImpl.java:241)
          at org.netbeans.modules.web.jsf.editor.JsfPageMetadataProvider.getMetadataMap(JsfPageMetadataProvider.java:97)
          at org.netbeans.modules.web.common.api.WebPageMetadata.getMetadata(WebPageMetadata.java:70)
          at org.netbeans.modules.html.editor.api.Utils.getWebPageMimeType(Utils.java:143)
          at org.netbeans.modules.html.editor.gsf.HtmlSemanticAnalyzer.run(HtmlSemanticAnalyzer.java:83)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:303)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:82)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:133)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:142)
          at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
          at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:153)
          at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:137)
          at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:204)
          at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:201)
          at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
          at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
          at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:141)
          at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:88)
          at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:201)
          at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:104)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.run(SemanticHighlighter.java:123)
          at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.run(SemanticHighlighter.java:82)
          at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
          at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
          at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
          at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
          at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
          at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
          at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
          at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
          ...
      

        Activity

        Hide
        kyle.stiemann Kyle Stiemann added a comment - - edited

        The cause of this failure is in FaceletLibrarySupport.java which is in Netbeans "JSF Editor for XHTML" (org.netbeans.modules.web.jsf.editor module):

        	ClassLoader proxyLoader = new URLClassLoader(urlsToLoad.toArray(new URL[]{}), originalLoader) {
        
        	//prevent services loading from mojarra's sources
        	@Override
        	public URL findResource(String name) {
        	return name.startsWith("META-INF/services") ? null : super.findResource(name); //NOI18N
        	}
        
        	@Override
        	public Enumeration<URL> findResources(String name) throws IOException {
        	if(name.startsWith("META-INF/services")) { //NOI18N
        		return Collections.enumeration(Collections.<URL>emptyList());
        	} else {
        		return super.findResources(name);
        	}
        	}
        
        };
        

        Netbeans is attempting to workaround Mojarra and avoid loading its services, but in doing so, it breaks Liferay Faces Util (which breaks every other Liferay Faces jar) when running in Netbeans.

        Show
        kyle.stiemann Kyle Stiemann added a comment - - edited The cause of this failure is in FaceletLibrarySupport.java which is in Netbeans "JSF Editor for XHTML" ( org.netbeans.modules.web.jsf.editor module): ClassLoader proxyLoader = new URLClassLoader(urlsToLoad.toArray( new URL[]{}), originalLoader) { //prevent services loading from mojarra's sources @Override public URL findResource( String name) { return name.startsWith( "META-INF/services" ) ? null : super .findResource(name); //NOI18N } @Override public Enumeration<URL> findResources( String name) throws IOException { if (name.startsWith( "META-INF/services" )) { //NOI18N return Collections.enumeration(Collections.<URL>emptyList()); } else { return super .findResources(name); } } }; Netbeans is attempting to workaround Mojarra and avoid loading its services, but in doing so, it breaks Liferay Faces Util (which breaks every other Liferay Faces jar) when running in Netbeans.

          People

          • Assignee:
            kyle.stiemann Kyle Stiemann
            Reporter:
            kyle.stiemann Kyle Stiemann
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development

                Subcomponents