Leonardo,
The URL, bundle://636.3:0/helloWorld.xhtml, passed to MyFaces is the same in 
v2.1.x and 2.2.x, so it appears the default resource resolver has changed in 
its support OSGi Resource URLs.  

Is there a ResourceResolver included in MyFaces that will properly resolve URL 
above?
  If not, what is involved in writing a ResourceResolver?

This incompatibility is preventing me from using MyFaces 2.2 with Karaf v3.0.x

Paul Spencer


On Sep 6, 2014, at 6:49 PM, Leonardo Uribe <[email protected]> wrote:

> Hi
> 
> The line that throw the exception has this code:
> 
> String alias = "/" + _removeFirst(url.getFile(), getBaseUrl().getFile());
> 
> the base url is ("/"), so probably it is resolved as null. This reference
> is taken through ResourceResolver, so a custom implementation could fix the
> issue.
> 
> regards,
> 
> Leonardo Uribe
> 
> 
> 2014-09-06 4:44 GMT-05:00 Paul Spencer <[email protected]>:
> 
>> The log entries below are from MyFaces 2.1.15 and 2.2.4, so is this a
>> regression bug?
>> 
>> ***
>> * MyFaces 2.1.15
>> ***
>> 2014-09-06 05:16:40,601 | TRACE | qtp195585050-76  |
>> FaceletViewDeclarationLanguage   | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Initializing
>> 2014-09-06 05:16:40,657 | DEBUG | qtp195585050-76  |
>> FaceletViewDeclarationLanguage   | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Successfully loaded library:
>> bundle://632.0:1/META-INF/primefaces-p.taglib.xml
>> 2014-09-06 05:16:40,660 | DEBUG | qtp195585050-76  |
>> FaceletViewDeclarationLanguage   | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Successfully loaded library:
>> bundle://632.0:1/META-INF/primefaces-pm.taglib.xml
>> 2014-09-06 05:16:40,663 | DEBUG | qtp195585050-76  | Resource
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Resource-Url
>> from external context: null
>> 2014-09-06 05:16:40,665 | DEBUG | qtp195585050-76  |
>> DefaultFaceletFactory            | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Using ResourceResolver: DefaultResourceResolver
>> 2014-09-06 05:16:40,665 | DEBUG | qtp195585050-76  |
>> DefaultFaceletFactory            | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Using Refresh Period: -1
>> 2014-09-06 05:16:40,666 | TRACE | qtp195585050-76  |
>> FaceletViewDeclarationLanguage   | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Initialization Successful
>> 2014-09-06 05:16:40,668 | DEBUG | qtp195585050-76  | Resource
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Resource-Url
>> from external context: bundle://636.3:0/helloWorld.xhtml
>> 2014-09-06 05:16:40,670 | DEBUG | qtp195585050-76  | Resource
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Resource-Url
>> from external context: bundle://636.3:0/helloWorld.xhtml
>> 2014-09-06 05:16:40,672 | DEBUG | qtp195585050-76  | Resource
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Resource-Url
>> from external context: bundle://636.3:0/helloWorld.xhtml
>> 2014-09-06 05:16:40,672 | DEBUG | qtp195585050-76  |
>> DefaultFaceletFactory            | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Creating Facelet used to create View Metadata for:
>> bundle://636.3:0/helloWorld.xhtml
>> 2014-09-06 05:16:40,672 | DEBUG | qtp195585050-76  | Compiler
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Initializing
>> 2014-09-06 05:16:40,680 | DEBUG | qtp195585050-76  | Compiler
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Initialization
>> Successful
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Namespace Pushed
>> : http://www.w3.org/1999/xhtml
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>             | 640 - org.apache.myfaces.core.impl - 2.1.15 | Starting Unit:
>> org.apache.myfaces.view.facelets.compiler.NamespaceUnit@4b9284dc and
>> adding it to parent:
>> org.apache.myfaces.view.facelets.compiler.CompilationUnit@50ae47
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Namespace Pushed
>> f: http://java.sun.com/jsf/core
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>             | 640 - org.apache.myfaces.core.impl - 2.1.15 | Namespace
>> Pushed h: http://java.sun.com/jsf/html
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>             | 640 - org.apache.myfaces.core.impl - 2.1.15 | Namespace
>> Pushed ui: http://java.sun.com/jsf/facelets
>> 2014-09-06 05:16:40,688 | DEBUG | qtp195585050-76  | CompilationManager
>>             | 640 - org.apache.myfaces.core.impl - 2.1.15 | Namespace
>> Pushed p: http://primefaces.org/ui
>> 2014-09-06 05:16:40,690 | DEBUG | qtp195585050-76  | CompilationManager
>>             | 640 - org.apache.myfaces.core.impl - 2.1.15 | Tag Pushed:
>> /viewMetadata/helloWorld.xhtml at line 12 and column 17 <f:view>
>> 2014-09-06 05:16:40,690 | DEBUG | qtp195585050-76  | CompilationManager
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Starting Unit:
>> /viewMetadata/helloWorld.xhtml at line 12 and column 17 <f:view> and adding
>> it to parent:
>> org.apache.myfaces.view.facelets.compiler.NamespaceUnit@4b9284dc
>> 2014-09-06 05:16:40,690 | DEBUG | qtp195585050-76  | CompilationManager
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Finished Unit:
>> /viewMetadata/helloWorld.xhtml at line 12 and column 17 <f:view>
>> 2014-09-06 05:16:40,690 | DEBUG | qtp195585050-76  | CompilationManager
>>           | 640 - org.apache.myfaces.core.impl - 2.1.15 | Finished Unit:
>> org.apache.myfaces.view.facelets.compiler.NamespaceUnit@4b9284dc
>> 2014-09-06 05:16:40,760 | TRACE | qtp195585050-76  |
>> FaceletViewDeclarationLanguage   | 640 - org.apache.myfaces.core.impl -
>> 2.1.15 | Building View: /helloWorld.xhtml
>> 2
>> 
>> ***
>> * MyFaces 2.2.4
>> ***
>> 2014-09-05 19:59:31,889 | TRACE | qtp2017355996-82 |
>> FaceletViewDeclarationLanguage   | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Initializing
>> 2014-09-05 19:59:31,919 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Using ResourceResolver: DefaultResourceResolver
>> 2014-09-05 19:59:31,919 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Using Refresh Period: -1
>> 2014-09-05 19:59:31,921 | TRACE | qtp2017355996-82 |
>> FaceletViewDeclarationLanguage   | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Initialization Successful
>> 2014-09-05 19:59:31,930 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Creating Facelet used to create View Metadata for:
>> bundle://636.1:0/helloWorld.xhtml
>> 2014-09-05 19:59:31,934 | WARN  | qtp2017355996-82 | ServletHandler
>>           | 364 - org.eclipse.jetty.aggregate.jetty-all-server -
>> 8.1.14.v20131031 |
>> javax.servlet.ServletException
>>        at
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)[637:org.apache.myfaces.core.api:2.2.4]
>>        at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)[373:org.ops4j.pax.web.pax-web-runtime:3.1.0]
>>        at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[374:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>>        at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[374:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>>        at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)[374:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>>        at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.Server.handle(Server.java:370)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[364:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>>        at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]
>> Caused by: java.lang.NullPointerException
>>        at
>> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createViewMetadataFacelet(DefaultFaceletFactory.java:410)[638:org.apache.myfaces.core.impl:2.2.4]
>>        at
>> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:57)[638:org.apache.myfaces.core.impl:2.2.4]
>>        at
>> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:131)[638:org.apache.myfaces.core.impl:2.2.4]
>> 
>> 
>> Paul Spencer
>> 
>> 
>> On Sep 5, 2014, at 8:09 PM, Paul Spencer <[email protected]> wrote:
>> 
>>> I enabled TRACE logging to provide more information. Notice the URL
>> starts used to create the facelet.
>>> 
>>> 2014-09-05 19:59:31,889 | TRACE | qtp2017355996-82 |
>> FaceletViewDeclarationLanguage   | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Initializing
>>> 2014-09-05 19:59:31,919 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Using ResourceResolver: DefaultResourceResolver
>>> 2014-09-05 19:59:31,919 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Using Refresh Period: -1
>>> 2014-09-05 19:59:31,921 | TRACE | qtp2017355996-82 |
>> FaceletViewDeclarationLanguage   | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Initialization Successful
>>> 2014-09-05 19:59:31,930 | DEBUG | qtp2017355996-82 |
>> DefaultFaceletFactory            | 638 - org.apache.myfaces.core.impl -
>> 2.2.4 | Creating Facelet used to create View Metadata for:
>> bundle://636.1:0/helloWorld.xhtml
>>> 2
>>> 
>>> 
>>> Paul Spencer
>>> 
>>> On Sep 5, 2014, at 7:46 PM, Paul Spencer <[email protected]> wrote:
>>> 
>>>> I am getting the following exception when browsing to a JSF page when
>> using MyFaces 2.2.4 and Karaf 3.0.1.  No exception is thrown when using
>> MyFaces 2.1.15 and the page displays as expected.  The only difference is
>> which version of myfaces-api and myfaces-impl are installed.
>>>> 
>>>> I suspect something is not in the classpath, but I am not sure what is
>> missing.  Suggestions?
>>>> 
>>>> 
>> <snip>
>>>> 
>>>> I am using the following to as a use case:
>>>> 
>> https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/war-jsf-primefaces
>>>> 
>>>> Paul Spencer
>>> 
>> 
>> 

Reply via email to