You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Cl...@raibau.at on 2011/02/22 09:05:36 UTC

NullPointerException with OSGi Bundle

Hello, 

using the OSGi Bundle of MyFaces (myfaces-bundle-2.0.3.jar), I get first a 
warning:
WARNING: Resource referenced by resourceName jsf.js and libraryName 
javax.faces not found in call to ResourceHandler.createResource. It will 
be silenty ignored.

and then a NullPointerException:
javax.faces.FacesException: java.lang.NullPointerException
        at 
org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
ExceptionHandlerImpl.java:241)
        at 
org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
ExceptionHandlerImpl.java:156)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:258)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
        ...
Caused by: java.lang.NullPointerException
        at 
org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
ResourceUtils.java:204)
        at 
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
HtmlTextRendererBase.java:69)
        at javax.faces.component.UIComponentBase.encodeEnd(
UIComponentBase.java:519)
        at javax.faces.component.UIComponent.encodeAll(
UIComponent.java:626)
        at javax.faces.component.UIComponent.encodeAll(
UIComponent.java:622)
        at javax.faces.component.UIComponent.encodeAll(
UIComponent.java:622)
        at javax.faces.component.UIComponent.encodeAll(
UIComponent.java:622)
        at 
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
FaceletViewDeclarationLanguage.java:1320)
        at org.apache.myfaces.application.ViewHandlerImpl.renderView(
ViewHandlerImpl.java:263)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
RenderResponseExecutor.java:85)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:239)
        ... 23 more

I submitted a bug, but it was closed, as this is the expected behavior. I 
was able to solve the problem by adding 
META-INF.internal-resources.javax.faces 
and 
META-INF.services 
to the exported packages in MANIFEST.MF. but I'd like to know anyway how I 
can avoid the NullPointerException without patching myself the file 
myfaces-bundle-2.0.3.jar.

(The application I used is the first example from the book 
"JavaServerFaces 2.0, The complete reference" from Ed Burns & Chris 
Schalk)

Thanks in advance

Clovis Seragiotto

______________________________________
Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien, Wiedner Hauptstraße 94, Firmenbuchnummer 116309v, Handelsgericht Wien, DVR 0066257, UID ATU15350206

Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. 

This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards.

Re: NullPointerException with OSGi Bundle

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Clovis,

Great to hear that! Thanks for trying.

I will commit the patch on MYFACES-3051 and resolve MYFACES-3044.

Regards,
Jakob

2011/2/23  <Cl...@raibau.at>:
> I replaced my 2.0.3 bundle with the patch (2.0.5-SNAPSHOT-3051) and got no
> NullPointerException. So, assuming that you didn't change the expected
> behavior, myfaces seems to work (at least for me) better today than
> yesterday. Thanks
>
> -- clovis
>
>
>
> ______________________________________
> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien, Wiedner Hauptstraße 94, Firmenbuchnummer 116309v, Handelsgericht Wien, DVR 0066257, UID ATU15350206
>
> Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen.
>
> This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards.
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Re: NullPointerException with OSGi Bundle

Posted by Cl...@raibau.at.
I replaced my 2.0.3 bundle with the patch (2.0.5-SNAPSHOT-3051) and got no 
NullPointerException. So, assuming that you didn't change the expected 
behavior, myfaces seems to work (at least for me) better today than 
yesterday. Thanks

-- clovis



______________________________________
Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien, Wiedner Hauptstraße 94, Firmenbuchnummer 116309v, Handelsgericht Wien, DVR 0066257, UID ATU15350206

Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. 

This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards.

Re: NullPointerException with OSGi Bundle

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Clovis,

I just uploaded a patch to MYFACES-3051 that should solve your
problem. I built the bundle locally and uploaded it to [1].

Could you please try this bundle in your project and check if it
works? Thanks a lot!

Regards,
Jakob

[1] http://people.apache.org/~jakobk/artifacts/myfaces-bundle-2.0.5-SNAPSHOT-3051-patch.jar

2011/2/22 Jakob Korherr <ja...@gmail.com>:
> Hi Leo,
>
> I agree that with you that the proposed fix via the additional export
> packages is quick and dirty.
>
> However, I think MYFACES-3051 could solve this problem anyway, but I'm
> not totally sure. I will provide a patch for it later today, then we
> can test it.
>
> Regards,
> Jakob
>
> 2011/2/22 Leonardo Uribe <lu...@gmail.com>:
>> Hi
>>
>> The problem presented here is related to the custom OSGi setup used. In
>> theory, the default ResourceHandler implementation uses the Thread Context
>> Class Loader (TCCL) to load its resources. That includes everything inside
>> META-INF/resources and for MyFaces everything inside
>> META-INF/internal-resources, but across jar files. OSGi by default does not
>> set the TCCL, but MyFaces expects that, so the problem finally appears.
>>
>> The first consideration is the fix on the manifest proposed is questionable.
>> At start META-INF/resources/javax.faces is not a java package!. Why should
>> MyFaces export that as a package?. That just does not make sense. Even if it
>> works, it is a quick fix that does not solves the main problem.
>>
>> The problem is similar to the one with OSGi and SPI interfaces (scan files
>> through META-INF/services in different jars using a discovery mechanism). To
>> solve this problem in a friendly way, MyFaces has a new interface called
>> org.apache.myfaces.spi.ServiceProviderFinder, so users can implement this
>> interface to help MyFaces to find the files through bundles.
>>
>> Here there are two solutions:
>>
>> 1. Install a TCCL that could scan through bundles the resources.
>> 2. Create a custom ResourceHandler implementation that implement OSGi
>> specific rules.
>>
>> It is possible to apply the hack proposed (add the additional entries on
>> myfaces bundle manifest). I don't see any side effect of doing that, but
>> note it is not a full solution (so in principle it is safe to apply the
>> changes proposed).
>>
>> regards,
>>
>> Leonardo Uribe
>>
>> 2011/2/22 Jakob Korherr <ja...@gmail.com>
>>
>>> Hi Clovis,
>>>
>>> I agree that this issue (MYFACES-3044) should be fixed and not closed
>>> as invalid. Thus I just reopened it.
>>>
>>> However, before I commit your proposed solution, are there any
>>> objections? Leonardo?
>>>
>>> Regards,
>>> Jakob
>>>
>>> 2011/2/22 Mark Struberg <st...@yahoo.de>:
>>> > Hi Clovis!
>>> >
>>> > Please note that there is a new myfaces-2.0.4 out since last week. Afaik
>>> this got a bit love in regards to the OSGi part.
>>> >
>>> > If you like to submit patches, then please open a Jira and provide a svn
>>> diff against the latest trunk from
>>> >
>>> > svn co https://svn.apache.org/repos/asf/myfaces/current20 myfaces-trunk
>>> >
>>> > current20 contains all svn references you need to build the latest
>>> MyFaces2 version.
>>> >
>>> > LieGrue,
>>> > strub
>>> >
>>> > --- On Tue, 2/22/11, Clovis.SERAGIOTTO@raibau.at <
>>> Clovis.SERAGIOTTO@raibau.at> wrote:
>>> >
>>> >> From: Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at>
>>> >> Subject: NullPointerException with OSGi Bundle
>>> >> To: users@myfaces.apache.org
>>> >> Date: Tuesday, February 22, 2011, 8:05 AM
>>> >> Hello,
>>> >>
>>> >> using the OSGi Bundle of MyFaces
>>> >> (myfaces-bundle-2.0.3.jar), I get first a
>>> >> warning:
>>> >> WARNING: Resource referenced by resourceName jsf.js and
>>> >> libraryName
>>> >> javax.faces not found in call to
>>> >> ResourceHandler.createResource. It will
>>> >> be silenty ignored.
>>> >>
>>> >> and then a NullPointerException:
>>> >> javax.faces.FacesException: java.lang.NullPointerException
>>> >>         at
>>> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
>>> >> ExceptionHandlerImpl.java:241)
>>> >>         at
>>> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
>>> >> ExceptionHandlerImpl.java:156)
>>> >>         at
>>> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>>> >> LifecycleImpl.java:258)
>>> >>         at
>>> >> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
>>> >>         ...
>>> >> Caused by: java.lang.NullPointerException
>>> >>         at
>>> >>
>>> org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
>>> >> ResourceUtils.java:204)
>>> >>         at
>>> >>
>>> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
>>> >> HtmlTextRendererBase.java:69)
>>> >>         at
>>> >> javax.faces.component.UIComponentBase.encodeEnd(
>>> >> UIComponentBase.java:519)
>>> >>         at
>>> >> javax.faces.component.UIComponent.encodeAll(
>>> >> UIComponent.java:626)
>>> >>         at
>>> >> javax.faces.component.UIComponent.encodeAll(
>>> >> UIComponent.java:622)
>>> >>         at
>>> >> javax.faces.component.UIComponent.encodeAll(
>>> >> UIComponent.java:622)
>>> >>         at
>>> >> javax.faces.component.UIComponent.encodeAll(
>>> >> UIComponent.java:622)
>>> >>         at
>>> >>
>>> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
>>> >> FaceletViewDeclarationLanguage.java:1320)
>>> >>         at
>>> >> org.apache.myfaces.application.ViewHandlerImpl.renderView(
>>> >> ViewHandlerImpl.java:263)
>>> >>         at
>>> >> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
>>> >> RenderResponseExecutor.java:85)
>>> >>         at
>>> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>>> >> LifecycleImpl.java:239)
>>> >>         ... 23 more
>>> >>
>>> >> I submitted a bug, but it was closed, as this is the
>>> >> expected behavior. I
>>> >> was able to solve the problem by adding
>>> >> META-INF.internal-resources.javax.faces
>>> >> and
>>> >> META-INF.services
>>> >> to the exported packages in MANIFEST.MF. but I'd like to
>>> >> know anyway how I
>>> >> can avoid the NullPointerException without patching myself
>>> >> the file
>>> >> myfaces-bundle-2.0.3.jar.
>>> >>
>>> >> (The application I used is the first example from the book
>>> >>
>>> >> "JavaServerFaces 2.0, The complete reference" from Ed Burns
>>> >> & Chris
>>> >> Schalk)
>>> >>
>>> >> Thanks in advance
>>> >>
>>> >> Clovis Seragiotto
>>> >>
>>> >> ______________________________________
>>> >> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien,
>>> >> Wiedner Hauptstraße 94, Firmenbuchnummer 116309v,
>>> >> Handelsgericht Wien, DVR 0066257, UID ATU15350206
>>> >>
>>> >> Diese E-Mail kann vertrauliche und geschuetzte
>>> >> Informationen enthalten. Wenn diese E-Mail nicht für Sie
>>> >> bestimmt ist, bitten wir Sie, uns unverzueglich zu
>>> >> informieren und sie zu loeschen.
>>> >>
>>> >> This e-mail message may contain information, which is
>>> >> confidential and protected. If you are not the intended
>>> >> recipient of this message, we ask you to inform us
>>> >> immediately and delete the message afterwards.
>>> >>
>>> >
>>> >
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Jakob Korherr
>>>
>>> blog: http://www.jakobk.com
>>> twitter: http://twitter.com/jakobkorherr
>>> work: http://www.irian.at
>>>
>>
>
>
>
> --
> Jakob Korherr
>
> blog: http://www.jakobk.com
> twitter: http://twitter.com/jakobkorherr
> work: http://www.irian.at
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Re: NullPointerException with OSGi Bundle

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Leo,

I agree that with you that the proposed fix via the additional export
packages is quick and dirty.

However, I think MYFACES-3051 could solve this problem anyway, but I'm
not totally sure. I will provide a patch for it later today, then we
can test it.

Regards,
Jakob

2011/2/22 Leonardo Uribe <lu...@gmail.com>:
> Hi
>
> The problem presented here is related to the custom OSGi setup used. In
> theory, the default ResourceHandler implementation uses the Thread Context
> Class Loader (TCCL) to load its resources. That includes everything inside
> META-INF/resources and for MyFaces everything inside
> META-INF/internal-resources, but across jar files. OSGi by default does not
> set the TCCL, but MyFaces expects that, so the problem finally appears.
>
> The first consideration is the fix on the manifest proposed is questionable.
> At start META-INF/resources/javax.faces is not a java package!. Why should
> MyFaces export that as a package?. That just does not make sense. Even if it
> works, it is a quick fix that does not solves the main problem.
>
> The problem is similar to the one with OSGi and SPI interfaces (scan files
> through META-INF/services in different jars using a discovery mechanism). To
> solve this problem in a friendly way, MyFaces has a new interface called
> org.apache.myfaces.spi.ServiceProviderFinder, so users can implement this
> interface to help MyFaces to find the files through bundles.
>
> Here there are two solutions:
>
> 1. Install a TCCL that could scan through bundles the resources.
> 2. Create a custom ResourceHandler implementation that implement OSGi
> specific rules.
>
> It is possible to apply the hack proposed (add the additional entries on
> myfaces bundle manifest). I don't see any side effect of doing that, but
> note it is not a full solution (so in principle it is safe to apply the
> changes proposed).
>
> regards,
>
> Leonardo Uribe
>
> 2011/2/22 Jakob Korherr <ja...@gmail.com>
>
>> Hi Clovis,
>>
>> I agree that this issue (MYFACES-3044) should be fixed and not closed
>> as invalid. Thus I just reopened it.
>>
>> However, before I commit your proposed solution, are there any
>> objections? Leonardo?
>>
>> Regards,
>> Jakob
>>
>> 2011/2/22 Mark Struberg <st...@yahoo.de>:
>> > Hi Clovis!
>> >
>> > Please note that there is a new myfaces-2.0.4 out since last week. Afaik
>> this got a bit love in regards to the OSGi part.
>> >
>> > If you like to submit patches, then please open a Jira and provide a svn
>> diff against the latest trunk from
>> >
>> > svn co https://svn.apache.org/repos/asf/myfaces/current20 myfaces-trunk
>> >
>> > current20 contains all svn references you need to build the latest
>> MyFaces2 version.
>> >
>> > LieGrue,
>> > strub
>> >
>> > --- On Tue, 2/22/11, Clovis.SERAGIOTTO@raibau.at <
>> Clovis.SERAGIOTTO@raibau.at> wrote:
>> >
>> >> From: Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at>
>> >> Subject: NullPointerException with OSGi Bundle
>> >> To: users@myfaces.apache.org
>> >> Date: Tuesday, February 22, 2011, 8:05 AM
>> >> Hello,
>> >>
>> >> using the OSGi Bundle of MyFaces
>> >> (myfaces-bundle-2.0.3.jar), I get first a
>> >> warning:
>> >> WARNING: Resource referenced by resourceName jsf.js and
>> >> libraryName
>> >> javax.faces not found in call to
>> >> ResourceHandler.createResource. It will
>> >> be silenty ignored.
>> >>
>> >> and then a NullPointerException:
>> >> javax.faces.FacesException: java.lang.NullPointerException
>> >>         at
>> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
>> >> ExceptionHandlerImpl.java:241)
>> >>         at
>> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
>> >> ExceptionHandlerImpl.java:156)
>> >>         at
>> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>> >> LifecycleImpl.java:258)
>> >>         at
>> >> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
>> >>         ...
>> >> Caused by: java.lang.NullPointerException
>> >>         at
>> >>
>> org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
>> >> ResourceUtils.java:204)
>> >>         at
>> >>
>> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
>> >> HtmlTextRendererBase.java:69)
>> >>         at
>> >> javax.faces.component.UIComponentBase.encodeEnd(
>> >> UIComponentBase.java:519)
>> >>         at
>> >> javax.faces.component.UIComponent.encodeAll(
>> >> UIComponent.java:626)
>> >>         at
>> >> javax.faces.component.UIComponent.encodeAll(
>> >> UIComponent.java:622)
>> >>         at
>> >> javax.faces.component.UIComponent.encodeAll(
>> >> UIComponent.java:622)
>> >>         at
>> >> javax.faces.component.UIComponent.encodeAll(
>> >> UIComponent.java:622)
>> >>         at
>> >>
>> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
>> >> FaceletViewDeclarationLanguage.java:1320)
>> >>         at
>> >> org.apache.myfaces.application.ViewHandlerImpl.renderView(
>> >> ViewHandlerImpl.java:263)
>> >>         at
>> >> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
>> >> RenderResponseExecutor.java:85)
>> >>         at
>> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>> >> LifecycleImpl.java:239)
>> >>         ... 23 more
>> >>
>> >> I submitted a bug, but it was closed, as this is the
>> >> expected behavior. I
>> >> was able to solve the problem by adding
>> >> META-INF.internal-resources.javax.faces
>> >> and
>> >> META-INF.services
>> >> to the exported packages in MANIFEST.MF. but I'd like to
>> >> know anyway how I
>> >> can avoid the NullPointerException without patching myself
>> >> the file
>> >> myfaces-bundle-2.0.3.jar.
>> >>
>> >> (The application I used is the first example from the book
>> >>
>> >> "JavaServerFaces 2.0, The complete reference" from Ed Burns
>> >> & Chris
>> >> Schalk)
>> >>
>> >> Thanks in advance
>> >>
>> >> Clovis Seragiotto
>> >>
>> >> ______________________________________
>> >> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien,
>> >> Wiedner Hauptstraße 94, Firmenbuchnummer 116309v,
>> >> Handelsgericht Wien, DVR 0066257, UID ATU15350206
>> >>
>> >> Diese E-Mail kann vertrauliche und geschuetzte
>> >> Informationen enthalten. Wenn diese E-Mail nicht für Sie
>> >> bestimmt ist, bitten wir Sie, uns unverzueglich zu
>> >> informieren und sie zu loeschen.
>> >>
>> >> This e-mail message may contain information, which is
>> >> confidential and protected. If you are not the intended
>> >> recipient of this message, we ask you to inform us
>> >> immediately and delete the message afterwards.
>> >>
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> Jakob Korherr
>>
>> blog: http://www.jakobk.com
>> twitter: http://twitter.com/jakobkorherr
>> work: http://www.irian.at
>>
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Re: NullPointerException with OSGi Bundle

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

The problem presented here is related to the custom OSGi setup used. In
theory, the default ResourceHandler implementation uses the Thread Context
Class Loader (TCCL) to load its resources. That includes everything inside
META-INF/resources and for MyFaces everything inside
META-INF/internal-resources, but across jar files. OSGi by default does not
set the TCCL, but MyFaces expects that, so the problem finally appears.

The first consideration is the fix on the manifest proposed is questionable.
At start META-INF/resources/javax.faces is not a java package!. Why should
MyFaces export that as a package?. That just does not make sense. Even if it
works, it is a quick fix that does not solves the main problem.

The problem is similar to the one with OSGi and SPI interfaces (scan files
through META-INF/services in different jars using a discovery mechanism). To
solve this problem in a friendly way, MyFaces has a new interface called
org.apache.myfaces.spi.ServiceProviderFinder, so users can implement this
interface to help MyFaces to find the files through bundles.

Here there are two solutions:

1. Install a TCCL that could scan through bundles the resources.
2. Create a custom ResourceHandler implementation that implement OSGi
specific rules.

It is possible to apply the hack proposed (add the additional entries on
myfaces bundle manifest). I don't see any side effect of doing that, but
note it is not a full solution (so in principle it is safe to apply the
changes proposed).

regards,

Leonardo Uribe

2011/2/22 Jakob Korherr <ja...@gmail.com>

> Hi Clovis,
>
> I agree that this issue (MYFACES-3044) should be fixed and not closed
> as invalid. Thus I just reopened it.
>
> However, before I commit your proposed solution, are there any
> objections? Leonardo?
>
> Regards,
> Jakob
>
> 2011/2/22 Mark Struberg <st...@yahoo.de>:
> > Hi Clovis!
> >
> > Please note that there is a new myfaces-2.0.4 out since last week. Afaik
> this got a bit love in regards to the OSGi part.
> >
> > If you like to submit patches, then please open a Jira and provide a svn
> diff against the latest trunk from
> >
> > svn co https://svn.apache.org/repos/asf/myfaces/current20 myfaces-trunk
> >
> > current20 contains all svn references you need to build the latest
> MyFaces2 version.
> >
> > LieGrue,
> > strub
> >
> > --- On Tue, 2/22/11, Clovis.SERAGIOTTO@raibau.at <
> Clovis.SERAGIOTTO@raibau.at> wrote:
> >
> >> From: Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at>
> >> Subject: NullPointerException with OSGi Bundle
> >> To: users@myfaces.apache.org
> >> Date: Tuesday, February 22, 2011, 8:05 AM
> >> Hello,
> >>
> >> using the OSGi Bundle of MyFaces
> >> (myfaces-bundle-2.0.3.jar), I get first a
> >> warning:
> >> WARNING: Resource referenced by resourceName jsf.js and
> >> libraryName
> >> javax.faces not found in call to
> >> ResourceHandler.createResource. It will
> >> be silenty ignored.
> >>
> >> and then a NullPointerException:
> >> javax.faces.FacesException: java.lang.NullPointerException
> >>         at
> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
> >> ExceptionHandlerImpl.java:241)
> >>         at
> >> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
> >> ExceptionHandlerImpl.java:156)
> >>         at
> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
> >> LifecycleImpl.java:258)
> >>         at
> >> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
> >>         ...
> >> Caused by: java.lang.NullPointerException
> >>         at
> >>
> org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
> >> ResourceUtils.java:204)
> >>         at
> >>
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
> >> HtmlTextRendererBase.java:69)
> >>         at
> >> javax.faces.component.UIComponentBase.encodeEnd(
> >> UIComponentBase.java:519)
> >>         at
> >> javax.faces.component.UIComponent.encodeAll(
> >> UIComponent.java:626)
> >>         at
> >> javax.faces.component.UIComponent.encodeAll(
> >> UIComponent.java:622)
> >>         at
> >> javax.faces.component.UIComponent.encodeAll(
> >> UIComponent.java:622)
> >>         at
> >> javax.faces.component.UIComponent.encodeAll(
> >> UIComponent.java:622)
> >>         at
> >>
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
> >> FaceletViewDeclarationLanguage.java:1320)
> >>         at
> >> org.apache.myfaces.application.ViewHandlerImpl.renderView(
> >> ViewHandlerImpl.java:263)
> >>         at
> >> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
> >> RenderResponseExecutor.java:85)
> >>         at
> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(
> >> LifecycleImpl.java:239)
> >>         ... 23 more
> >>
> >> I submitted a bug, but it was closed, as this is the
> >> expected behavior. I
> >> was able to solve the problem by adding
> >> META-INF.internal-resources.javax.faces
> >> and
> >> META-INF.services
> >> to the exported packages in MANIFEST.MF. but I'd like to
> >> know anyway how I
> >> can avoid the NullPointerException without patching myself
> >> the file
> >> myfaces-bundle-2.0.3.jar.
> >>
> >> (The application I used is the first example from the book
> >>
> >> "JavaServerFaces 2.0, The complete reference" from Ed Burns
> >> & Chris
> >> Schalk)
> >>
> >> Thanks in advance
> >>
> >> Clovis Seragiotto
> >>
> >> ______________________________________
> >> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien,
> >> Wiedner Hauptstraße 94, Firmenbuchnummer 116309v,
> >> Handelsgericht Wien, DVR 0066257, UID ATU15350206
> >>
> >> Diese E-Mail kann vertrauliche und geschuetzte
> >> Informationen enthalten. Wenn diese E-Mail nicht für Sie
> >> bestimmt ist, bitten wir Sie, uns unverzueglich zu
> >> informieren und sie zu loeschen.
> >>
> >> This e-mail message may contain information, which is
> >> confidential and protected. If you are not the intended
> >> recipient of this message, we ask you to inform us
> >> immediately and delete the message afterwards.
> >>
> >
> >
> >
> >
>
>
>
> --
> Jakob Korherr
>
> blog: http://www.jakobk.com
> twitter: http://twitter.com/jakobkorherr
> work: http://www.irian.at
>

Re: NullPointerException with OSGi Bundle

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Clovis,

I agree that this issue (MYFACES-3044) should be fixed and not closed
as invalid. Thus I just reopened it.

However, before I commit your proposed solution, are there any
objections? Leonardo?

Regards,
Jakob

2011/2/22 Mark Struberg <st...@yahoo.de>:
> Hi Clovis!
>
> Please note that there is a new myfaces-2.0.4 out since last week. Afaik this got a bit love in regards to the OSGi part.
>
> If you like to submit patches, then please open a Jira and provide a svn diff against the latest trunk from
>
> svn co https://svn.apache.org/repos/asf/myfaces/current20 myfaces-trunk
>
> current20 contains all svn references you need to build the latest MyFaces2 version.
>
> LieGrue,
> strub
>
> --- On Tue, 2/22/11, Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at> wrote:
>
>> From: Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at>
>> Subject: NullPointerException with OSGi Bundle
>> To: users@myfaces.apache.org
>> Date: Tuesday, February 22, 2011, 8:05 AM
>> Hello,
>>
>> using the OSGi Bundle of MyFaces
>> (myfaces-bundle-2.0.3.jar), I get first a
>> warning:
>> WARNING: Resource referenced by resourceName jsf.js and
>> libraryName
>> javax.faces not found in call to
>> ResourceHandler.createResource. It will
>> be silenty ignored.
>>
>> and then a NullPointerException:
>> javax.faces.FacesException: java.lang.NullPointerException
>>         at
>> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
>> ExceptionHandlerImpl.java:241)
>>         at
>> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
>> ExceptionHandlerImpl.java:156)
>>         at
>> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>> LifecycleImpl.java:258)
>>         at
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
>>         ...
>> Caused by: java.lang.NullPointerException
>>         at
>> org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
>> ResourceUtils.java:204)
>>         at
>> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
>> HtmlTextRendererBase.java:69)
>>         at
>> javax.faces.component.UIComponentBase.encodeEnd(
>> UIComponentBase.java:519)
>>         at
>> javax.faces.component.UIComponent.encodeAll(
>> UIComponent.java:626)
>>         at
>> javax.faces.component.UIComponent.encodeAll(
>> UIComponent.java:622)
>>         at
>> javax.faces.component.UIComponent.encodeAll(
>> UIComponent.java:622)
>>         at
>> javax.faces.component.UIComponent.encodeAll(
>> UIComponent.java:622)
>>         at
>> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
>> FaceletViewDeclarationLanguage.java:1320)
>>         at
>> org.apache.myfaces.application.ViewHandlerImpl.renderView(
>> ViewHandlerImpl.java:263)
>>         at
>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
>> RenderResponseExecutor.java:85)
>>         at
>> org.apache.myfaces.lifecycle.LifecycleImpl.render(
>> LifecycleImpl.java:239)
>>         ... 23 more
>>
>> I submitted a bug, but it was closed, as this is the
>> expected behavior. I
>> was able to solve the problem by adding
>> META-INF.internal-resources.javax.faces
>> and
>> META-INF.services
>> to the exported packages in MANIFEST.MF. but I'd like to
>> know anyway how I
>> can avoid the NullPointerException without patching myself
>> the file
>> myfaces-bundle-2.0.3.jar.
>>
>> (The application I used is the first example from the book
>>
>> "JavaServerFaces 2.0, The complete reference" from Ed Burns
>> & Chris
>> Schalk)
>>
>> Thanks in advance
>>
>> Clovis Seragiotto
>>
>> ______________________________________
>> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien,
>> Wiedner Hauptstraße 94, Firmenbuchnummer 116309v,
>> Handelsgericht Wien, DVR 0066257, UID ATU15350206
>>
>> Diese E-Mail kann vertrauliche und geschuetzte
>> Informationen enthalten. Wenn diese E-Mail nicht für Sie
>> bestimmt ist, bitten wir Sie, uns unverzueglich zu
>> informieren und sie zu loeschen.
>>
>> This e-mail message may contain information, which is
>> confidential and protected. If you are not the intended
>> recipient of this message, we ask you to inform us
>> immediately and delete the message afterwards.
>>
>
>
>
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Re: NullPointerException with OSGi Bundle

Posted by Mark Struberg <st...@yahoo.de>.
Hi Clovis!

Please note that there is a new myfaces-2.0.4 out since last week. Afaik this got a bit love in regards to the OSGi part.

If you like to submit patches, then please open a Jira and provide a svn diff against the latest trunk from 

svn co https://svn.apache.org/repos/asf/myfaces/current20 myfaces-trunk

current20 contains all svn references you need to build the latest MyFaces2 version.

LieGrue,
strub

--- On Tue, 2/22/11, Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at> wrote:

> From: Clovis.SERAGIOTTO@raibau.at <Cl...@raibau.at>
> Subject: NullPointerException with OSGi Bundle
> To: users@myfaces.apache.org
> Date: Tuesday, February 22, 2011, 8:05 AM
> Hello, 
> 
> using the OSGi Bundle of MyFaces
> (myfaces-bundle-2.0.3.jar), I get first a 
> warning:
> WARNING: Resource referenced by resourceName jsf.js and
> libraryName 
> javax.faces not found in call to
> ResourceHandler.createResource. It will 
> be silenty ignored.
> 
> and then a NullPointerException:
> javax.faces.FacesException: java.lang.NullPointerException
>         at 
> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(
> ExceptionHandlerImpl.java:241)
>         at 
> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(
> ExceptionHandlerImpl.java:156)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(
> LifecycleImpl.java:258)
>         at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
>         ...
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
> ResourceUtils.java:204)
>         at 
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(
> HtmlTextRendererBase.java:69)
>         at
> javax.faces.component.UIComponentBase.encodeEnd(
> UIComponentBase.java:519)
>         at
> javax.faces.component.UIComponent.encodeAll(
> UIComponent.java:626)
>         at
> javax.faces.component.UIComponent.encodeAll(
> UIComponent.java:622)
>         at
> javax.faces.component.UIComponent.encodeAll(
> UIComponent.java:622)
>         at
> javax.faces.component.UIComponent.encodeAll(
> UIComponent.java:622)
>         at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
> FaceletViewDeclarationLanguage.java:1320)
>         at
> org.apache.myfaces.application.ViewHandlerImpl.renderView(
> ViewHandlerImpl.java:263)
>         at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
> RenderResponseExecutor.java:85)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(
> LifecycleImpl.java:239)
>         ... 23 more
> 
> I submitted a bug, but it was closed, as this is the
> expected behavior. I 
> was able to solve the problem by adding 
> META-INF.internal-resources.javax.faces 
> and 
> META-INF.services 
> to the exported packages in MANIFEST.MF. but I'd like to
> know anyway how I 
> can avoid the NullPointerException without patching myself
> the file 
> myfaces-bundle-2.0.3.jar.
> 
> (The application I used is the first example from the book
> 
> "JavaServerFaces 2.0, The complete reference" from Ed Burns
> & Chris 
> Schalk)
> 
> Thanks in advance
> 
> Clovis Seragiotto
> 
> ______________________________________
> Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien,
> Wiedner Hauptstraße 94, Firmenbuchnummer 116309v,
> Handelsgericht Wien, DVR 0066257, UID ATU15350206
> 
> Diese E-Mail kann vertrauliche und geschuetzte
> Informationen enthalten. Wenn diese E-Mail nicht für Sie
> bestimmt ist, bitten wir Sie, uns unverzueglich zu
> informieren und sie zu loeschen. 
> 
> This e-mail message may contain information, which is
> confidential and protected. If you are not the intended
> recipient of this message, we ask you to inform us
> immediately and delete the message afterwards.
>