Re: NPE in DefaultFaceletFactory._createViewMetadataFacelet from MyFaces 2.2.4 and Karaf 3.0.1

2014-09-05 Thread Paul Spencer
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  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?  
> 
> 
> *** 
> * Exception thrown when using MyFaces 2.2.4 
> *** 
> 
> java.lang.NullPointerException 
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createViewMetadataFacelet(DefaultFaceletFactory.java:410)
>  
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:57)
>  
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:131)
>  
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:128)
>  
>at 
> org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getViewMetadataFacelet(FaceletCacheImpl.java:114)
>  
>at 
> org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getViewMetadataFacelet(FaceletCacheImpl.java:51)
>  
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:509)
>  
>at 
> org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:493)
>  
>at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage._getViewMetadataFacelet(FaceletViewDeclarationLanguage.java:2584)
>  
>at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.access$000(FaceletViewDeclarationLanguage.java:147)
>  
>at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage$FaceletViewMetadata.createMetadataView(FaceletViewDeclarationLanguage.java:2738)
>  
>at 
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:243)
>  
>at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196)
>  
>at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143) 
>at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) 
>at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) 
>at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
>  
>at 
> org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)
>  
>at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
>  
>at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499) 
>at 
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)
>  
>at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) 
>at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) 
>at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>  
>at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
>  
>at 
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)
>  
>at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) 
>at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>  
>at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
>  
>at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) 
>at 
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handl

NPE in DefaultFaceletFactory._createViewMetadataFacelet from MyFaces 2.2.4 and Karaf 3.0.1

2014-09-05 Thread Paul Spencer
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?  


*** 
* Exception thrown when using MyFaces 2.2.4 
*** 

java.lang.NullPointerException 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createViewMetadataFacelet(DefaultFaceletFactory.java:410)
 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:57)
 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:131)
 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:128)
 
at 
org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getViewMetadataFacelet(FaceletCacheImpl.java:114)
 
at 
org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getViewMetadataFacelet(FaceletCacheImpl.java:51)
 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:509)
 
at 
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:493)
 
at 
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage._getViewMetadataFacelet(FaceletViewDeclarationLanguage.java:2584)
 
at 
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.access$000(FaceletViewDeclarationLanguage.java:147)
 
at 
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage$FaceletViewMetadata.createMetadataView(FaceletViewDeclarationLanguage.java:2738)
 
at 
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:243)
 
at 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196) 
at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143) 
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) 
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) 
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
 
at 
org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)
 
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
 
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499) 
at 
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)
 
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) 
at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) 
at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
 
at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
 
at 
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)
 
at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) 
at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
 
at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
 
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) 
at 
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)
 


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 


[ANNOUNCE] Enterprise Java Newscast - Episode 21 - August 2014

2014-09-05 Thread Kito Mann
Hello,

I am pleased to announce a new episode of the Enterprise Java Newscast on
JSFCentral.com.

The Enterprise Java Newscast, hosted by Kito D. Mann, Ian Hlavats, and
Daniel Hinojosa, is a monthly podcast that covers the latest headlines in
the world of Enterprise Java development.

In this episode, Kito, Ian, and Daniel change up the format to involve more
discussion.  They discuss the new Java EE JSRs (JSF, JMS, Servlet, CDI,
Java API for JSON Binding, etc.) plus entirely new proposals such as MVC
and Java API for JSON Binding.  Other topices include RichFaces,
PrimeFaces, Apache TomEE, Delta Spike, QUnit, Angular.js. Hibernate OGM,
Spring Boot, JBoss Errai, and more, plus upcoming conferences.

Listen to the Podcast here:
http://content.jsfcentral.com/documents/35702/35731/The+Enterprise+Java+Newscast-Episode+21-Aug+2014.mp3/0c14b16c-b20f-4501-8773-35a0cc7b99ee

If you have feedback on the new format, please let us know.


___

Kito D. Mann | @kito99 | Author, JSF in Action
Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
http://www.JSFCentral.com | @jsfcentral
+1 203-998-0403

* Listen to the Enterprise Java Newscast: *http://w
ww.enterprisejavanews.com
*
* JSFCentral Interviews Podcast:
http://www.jsfcentral.com/resources/jsfcentralpodcasts/
* Sign up for the JSFCentral Newsletter: http://oi.vresp.com/?fid=ac048d0e17


Re: Decide what to rerender on server side?

2014-09-05 Thread Karl Kildén
Thanks guys! <3


On 5 September 2014 12:51, Howard W. Smith, Jr. 
wrote:

> http://showcase.omnifaces.org/utils/Ajax
>
> click the AjaxBean tab in the Source code panel on the showcase page (see
> below)
>
>
> import org.omnifaces.util.Ajax;
> @ManagedBean@RequestScopedpublic class AjaxBean {
>
> public void update() {
> Ajax.update("form:timestamp");
> }
>
> public void callback() {
> Ajax.oncomplete("alert('Hi, I am the oncomplete callback
> script!')");
> }
>
> public void argument() {
> Ajax.data("foo", "bar");
> Ajax.data("first", "one", "second", "two");
> Map data = new HashMap<>();
> data.put("bool", true);
> data.put("number", 1.2F);
> data.put("date", new Date());
> data.put("array", new Integer[] { 1, 2, 3, 4, 5 });
> data.put("list", Arrays.asList("one", "two", "three"));
> data.put("beans", Arrays.asList(new ExampleEntity(1L, "one"),
> new ExampleEntity(2L, "two")));
> Ajax.data(data);
> Ajax.oncomplete("showData()");
> }
>
> public void updateRow(UIData table, int index) {
> Ajax.updateRow(table, index);
> }
>
> public void updateColumn(UIData table, int index) {
> Ajax.updateColumn(table, index);
> }
> }
>
>
> On Sep 5, 2014 2:35 AM, "Karl Kildén"  wrote:
>
> > Hi Howard,
> >
> > Well they use custom ajax so not sure it would be very easy to understand
> > but eventually I will look at it yes :-) Still interested in hearing some
> > pro input from myfaces guys first
> >
> > Can you link me the feature in omnifaces? I cannot find it. Regarding
> > primefaces I don't want to be to dependent on frameworks as hinted in my
> > first email.
> >
> >
> > On 5 September 2014 00:33, Howard W. Smith, Jr. 
> > wrote:
> >
> > > Karl, you could look at PrimeFaces requestContext implementation
> (source
> > > code).
> > >
> > > also, you can maybe ask for something like this to be added as a
> feature
> > > request in MYFACES JIRA.
> > >
> > > Is there any reason why you prefer not to use PrimeFaces requestContext
> > or
> > > the similar feature that is available in OmniFaces library?
> > >
> > >
> > >
> > > On Thu, Sep 4, 2014 at 4:30 PM, Karl Kildén 
> > wrote:
> > >
> > > > Primefaces offers several ways to do client side stuff from the
> server.
> > > For
> > > > examples see here:
> > > > http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml
> > > >
> > > > While I use primefaces I prefer to keep my hands out of the cookie
> jar
> > > with
> > > > stuff like this. I mean a datepicker can be replaced with a js widget
> > in
> > > 20
> > > > minutes if you use a composite component that wraps primefaces date
> > > picker.
> > > > However this stuff would be painful to replace.
> > > >
> > > > So my question is, could this be done in some way with JSF or
> > > myfaces-impl?
> > > >
> > > > cheers
> > > >
> > >
> >
>


Re: Decide what to rerender on server side?

2014-09-05 Thread Howard W. Smith, Jr.
http://showcase.omnifaces.org/utils/Ajax

click the AjaxBean tab in the Source code panel on the showcase page (see
below)


import org.omnifaces.util.Ajax;
@ManagedBean@RequestScopedpublic class AjaxBean {

public void update() {
Ajax.update("form:timestamp");
}

public void callback() {
Ajax.oncomplete("alert('Hi, I am the oncomplete callback script!')");
}

public void argument() {
Ajax.data("foo", "bar");
Ajax.data("first", "one", "second", "two");
Map data = new HashMap<>();
data.put("bool", true);
data.put("number", 1.2F);
data.put("date", new Date());
data.put("array", new Integer[] { 1, 2, 3, 4, 5 });
data.put("list", Arrays.asList("one", "two", "three"));
data.put("beans", Arrays.asList(new ExampleEntity(1L, "one"),
new ExampleEntity(2L, "two")));
Ajax.data(data);
Ajax.oncomplete("showData()");
}

public void updateRow(UIData table, int index) {
Ajax.updateRow(table, index);
}

public void updateColumn(UIData table, int index) {
Ajax.updateColumn(table, index);
}
}


On Sep 5, 2014 2:35 AM, "Karl Kildén"  wrote:

> Hi Howard,
>
> Well they use custom ajax so not sure it would be very easy to understand
> but eventually I will look at it yes :-) Still interested in hearing some
> pro input from myfaces guys first
>
> Can you link me the feature in omnifaces? I cannot find it. Regarding
> primefaces I don't want to be to dependent on frameworks as hinted in my
> first email.
>
>
> On 5 September 2014 00:33, Howard W. Smith, Jr. 
> wrote:
>
> > Karl, you could look at PrimeFaces requestContext implementation (source
> > code).
> >
> > also, you can maybe ask for something like this to be added as a feature
> > request in MYFACES JIRA.
> >
> > Is there any reason why you prefer not to use PrimeFaces requestContext
> or
> > the similar feature that is available in OmniFaces library?
> >
> >
> >
> > On Thu, Sep 4, 2014 at 4:30 PM, Karl Kildén 
> wrote:
> >
> > > Primefaces offers several ways to do client side stuff from the server.
> > For
> > > examples see here:
> > > http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml
> > >
> > > While I use primefaces I prefer to keep my hands out of the cookie jar
> > with
> > > stuff like this. I mean a datepicker can be replaced with a js widget
> in
> > 20
> > > minutes if you use a composite component that wraps primefaces date
> > picker.
> > > However this stuff would be painful to replace.
> > >
> > > So my question is, could this be done in some way with JSF or
> > myfaces-impl?
> > >
> > > cheers
> > >
> >
>


Re: Decide what to rerender on server side?

2014-09-05 Thread Thomas Andraschko
FacesContext.getCurrentInstance
().getPartialViewContext
().getRenderIds
().add
("myPanel");



2014-09-05 8:34 GMT+02:00 Karl Kildén :

> Hi Howard,
>
> Well they use custom ajax so not sure it would be very easy to understand
> but eventually I will look at it yes :-) Still interested in hearing some
> pro input from myfaces guys first
>
> Can you link me the feature in omnifaces? I cannot find it. Regarding
> primefaces I don't want to be to dependent on frameworks as hinted in my
> first email.
>
>
> On 5 September 2014 00:33, Howard W. Smith, Jr. 
> wrote:
>
> > Karl, you could look at PrimeFaces requestContext implementation (source
> > code).
> >
> > also, you can maybe ask for something like this to be added as a feature
> > request in MYFACES JIRA.
> >
> > Is there any reason why you prefer not to use PrimeFaces requestContext
> or
> > the similar feature that is available in OmniFaces library?
> >
> >
> >
> > On Thu, Sep 4, 2014 at 4:30 PM, Karl Kildén 
> wrote:
> >
> > > Primefaces offers several ways to do client side stuff from the server.
> > For
> > > examples see here:
> > > http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml
> > >
> > > While I use primefaces I prefer to keep my hands out of the cookie jar
> > with
> > > stuff like this. I mean a datepicker can be replaced with a js widget
> in
> > 20
> > > minutes if you use a composite component that wraps primefaces date
> > picker.
> > > However this stuff would be painful to replace.
> > >
> > > So my question is, could this be done in some way with JSF or
> > myfaces-impl?
> > >
> > > cheers
> > >
> >
>