You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Adam Cornett <ad...@gmail.com> on 2014/12/18 17:04:46 UTC

Error when Faces Servlet declared in web-fragment.xml

When the Faces Servlet is declared in a web-fragment.xml file contained in
a library jar of my WAR, JSF doesn't start up correctly.  However when I
deploy the same code to WildFly 8.2 the same error doesn't occur.
According to the Servlet's JavaDoc (
http://docs.oracle.com/javaee/6/api/javax/faces/webapp/FacesServlet.html)
it can be mapped in web-fragment.xml

Removing the servlet deceleration from the web-fragment.xml, or moving it
to the web.xml also resolves the issue I'm seeing.  However I need to
change the default mapping of the JSF servlet and instead of having the
same code in all of my web.xml files I'd like to have the settings in a
shared library that all of my WARs already include.

I have a minimal example project here:
https://github.com/acornett/jsf-servlet-test

Is there something I'm missing, or have I stumbled upon a bug?

- Adam Cornett

Re: [CDI - OpenWebBeans] explicit no arg constructor

Posted by Mark Struberg <st...@yahoo.de>.
I'm not sure what Weld does, but the spec clearly mandates it

"3.15. Unproxyable bean types

The container uses proxies to provide certain functionality. Certain legal bean types cannot be proxied by the container:
• classes which don’t have a non-private constructor with no parameters,
..
Otherwise, the container automatically detects the problem, and treats it as a deployment problem."


Please let us know how this bean looks like.

txs and LieGrue,
strub





> On Saturday, 20 December 2014, 16:35, "salim.massa@laposte.net" <sa...@laposte.net> wrote:
> > Hello All, 
> 
> im currently trying to run an app based on Vraptor Framework with tomee 2.0. 
> 
> unfortunately im facing an issue with proxyable beans. 
> 
> the issue is that openweb beans need an explicit default constructor and Vraptor 
> CDI objects doesn't implement it. 
> 
> in the other hand the same application is running fine on WildFly with Weld 
> implementation. 
> 
> my question is, should i suggest something to Vraptor guys if the CDI spec 
> doesnt define this aspect or should i get in touch with OWB guys to check with 
> this issue? 
> 
> 
> thanks in advance 
> 
> Salim 
>

Re: [CDI - OpenWebBeans] explicit no arg constructor

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok so it is normal
Le 20 déc. 2014 23:20, <sa...@laposte.net> a écrit :

> Hi Romain,
>
> its an ApplicationScoped.
>
>
> Salim
>
> ----- Mail original -----
>
> De: "Romain Manni-Bucau" <rm...@gmail.com>
> À: users@tomee.apache.org
> Envoyé: Samedi 20 Décembre 2014 16:42:44
> Objet: Re: [CDI - OpenWebBeans] explicit no arg constructor
>
> Hi
>
> Is it scoped or intercepted beans? If so spec is explicit and it is needed
> IIRC
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-20 16:34 GMT+01:00 <sa...@laposte.net>:
> > Hello All,
> >
> > im currently trying to run an app based on Vraptor Framework with tomee
> 2.0.
> >
> > unfortunately im facing an issue with proxyable beans.
> >
> > the issue is that openweb beans need an explicit default constructor and
> Vraptor CDI objects doesn't implement it.
> >
> > in the other hand the same application is running fine on WildFly with
> Weld implementation.
> >
> > my question is, should i suggest something to Vraptor guys if the CDI
> spec doesnt define this aspect or should i get in touch with OWB guys to
> check with this issue?
> >
> >
> > thanks in advance
> >
> > Salim
> >
> >
>
>

Re: [CDI - OpenWebBeans] explicit no arg constructor

Posted by sa...@laposte.net.
Hi Romain, 

its an ApplicationScoped. 


Salim 

----- Mail original -----

De: "Romain Manni-Bucau" <rm...@gmail.com> 
À: users@tomee.apache.org 
Envoyé: Samedi 20 Décembre 2014 16:42:44 
Objet: Re: [CDI - OpenWebBeans] explicit no arg constructor 

Hi 

Is it scoped or intercepted beans? If so spec is explicit and it is needed IIRC 


Romain Manni-Bucau 
@rmannibucau 
http://www.tomitribe.com 
http://rmannibucau.wordpress.com 
https://github.com/rmannibucau 


2014-12-20 16:34 GMT+01:00 <sa...@laposte.net>: 
> Hello All, 
> 
> im currently trying to run an app based on Vraptor Framework with tomee 2.0. 
> 
> unfortunately im facing an issue with proxyable beans. 
> 
> the issue is that openweb beans need an explicit default constructor and Vraptor CDI objects doesn't implement it. 
> 
> in the other hand the same application is running fine on WildFly with Weld implementation. 
> 
> my question is, should i suggest something to Vraptor guys if the CDI spec doesnt define this aspect or should i get in touch with OWB guys to check with this issue? 
> 
> 
> thanks in advance 
> 
> Salim 
> 
> 


Re: [CDI - OpenWebBeans] explicit no arg constructor

Posted by Daniel Cunha <da...@gmail.com>.
Romain,

Exactly!

Salim,
if you want inject your dependencies in constructor, yes, you need to
implement default constructor as well. :)

On Sat, Dec 20, 2014 at 3:42 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi
>
> Is it scoped or intercepted beans? If so spec is explicit and it is needed
> IIRC
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-20 16:34 GMT+01:00  <sa...@laposte.net>:
> > Hello All,
> >
> > im currently trying to run an app based on Vraptor Framework with tomee
> 2.0.
> >
> > unfortunately im facing an issue with proxyable beans.
> >
> > the issue is that openweb beans need an explicit default constructor and
> Vraptor CDI objects doesn't implement it.
> >
> > in the other hand the same application is running fine on WildFly with
> Weld implementation.
> >
> > my question is, should i suggest something to Vraptor guys if the CDI
> spec doesnt define this aspect or should i get in touch with OWB guys to
> check with this issue?
> >
> >
> > thanks in advance
> >
> > Salim
> >
> >
>



-- 
Daniel Cunha (soro)

Re: [CDI - OpenWebBeans] explicit no arg constructor

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Is it scoped or intercepted beans? If so spec is explicit and it is needed IIRC


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-20 16:34 GMT+01:00  <sa...@laposte.net>:
> Hello All,
>
> im currently trying to run an app based on Vraptor Framework with tomee 2.0.
>
> unfortunately im facing an issue with proxyable beans.
>
> the issue is that openweb beans need an explicit default constructor and Vraptor CDI objects doesn't implement it.
>
> in the other hand the same application is running fine on WildFly with Weld implementation.
>
> my question is, should i suggest something to Vraptor guys if the CDI spec doesnt define this aspect or should i get in touch with OWB guys to check with this issue?
>
>
> thanks in advance
>
> Salim
>
>

[CDI - OpenWebBeans] explicit no arg constructor

Posted by sa...@laposte.net.
Hello All, 

im currently trying to run an app based on Vraptor Framework with tomee 2.0. 

unfortunately im facing an issue with proxyable beans. 

the issue is that openweb beans need an explicit default constructor and Vraptor CDI objects doesn't implement it. 

in the other hand the same application is running fine on WildFly with Weld implementation. 

my question is, should i suggest something to Vraptor guys if the CDI spec doesnt define this aspect or should i get in touch with OWB guys to check with this issue? 


thanks in advance 

Salim 



Re: Error when Faces Servlet declared in web-fragment.xml

Posted by Adam Cornett <ad...@gmail.com>.
Thanks Romain.  I'll give your initial work-around a try.

On Thu, Dec 18, 2014 at 11:53 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
>
> PS: https://issues.apache.org/jira/browse/TOMEE-1481
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-18 17:29 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> > I guess it is because mapping is not found (not yet sure why)
> >
> > you can surely add org.apache.myfaces.INITIALIZE_ALWAYS_STANDALONE =
> > true init parameter
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau
> > http://www.tomitribe.com
> > http://rmannibucau.wordpress.com
> > https://github.com/rmannibucau
> >
> >
> > 2014-12-18 17:04 GMT+01:00 Adam Cornett <ad...@gmail.com>:
> >> When the Faces Servlet is declared in a web-fragment.xml file contained
> in
> >> a library jar of my WAR, JSF doesn't start up correctly.  However when I
> >> deploy the same code to WildFly 8.2 the same error doesn't occur.
> >> According to the Servlet's JavaDoc (
> >>
> http://docs.oracle.com/javaee/6/api/javax/faces/webapp/FacesServlet.html)
> >> it can be mapped in web-fragment.xml
> >>
> >> Removing the servlet deceleration from the web-fragment.xml, or moving
> it
> >> to the web.xml also resolves the issue I'm seeing.  However I need to
> >> change the default mapping of the JSF servlet and instead of having the
> >> same code in all of my web.xml files I'd like to have the settings in a
> >> shared library that all of my WARs already include.
> >>
> >> I have a minimal example project here:
> >> https://github.com/acornett/jsf-servlet-test
> >>
> >> Is there something I'm missing, or have I stumbled upon a bug?
> >>
> >> - Adam Cornett
>


-- 
Adam Cornett
adam.cornett@gmail.com
(678) 296-1150

Re: Error when Faces Servlet declared in web-fragment.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
PS: https://issues.apache.org/jira/browse/TOMEE-1481


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-18 17:29 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> I guess it is because mapping is not found (not yet sure why)
>
> you can surely add org.apache.myfaces.INITIALIZE_ALWAYS_STANDALONE =
> true init parameter
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-18 17:04 GMT+01:00 Adam Cornett <ad...@gmail.com>:
>> When the Faces Servlet is declared in a web-fragment.xml file contained in
>> a library jar of my WAR, JSF doesn't start up correctly.  However when I
>> deploy the same code to WildFly 8.2 the same error doesn't occur.
>> According to the Servlet's JavaDoc (
>> http://docs.oracle.com/javaee/6/api/javax/faces/webapp/FacesServlet.html)
>> it can be mapped in web-fragment.xml
>>
>> Removing the servlet deceleration from the web-fragment.xml, or moving it
>> to the web.xml also resolves the issue I'm seeing.  However I need to
>> change the default mapping of the JSF servlet and instead of having the
>> same code in all of my web.xml files I'd like to have the settings in a
>> shared library that all of my WARs already include.
>>
>> I have a minimal example project here:
>> https://github.com/acornett/jsf-servlet-test
>>
>> Is there something I'm missing, or have I stumbled upon a bug?
>>
>> - Adam Cornett

Re: Error when Faces Servlet declared in web-fragment.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I guess it is because mapping is not found (not yet sure why)

you can surely add org.apache.myfaces.INITIALIZE_ALWAYS_STANDALONE =
true init parameter


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-18 17:04 GMT+01:00 Adam Cornett <ad...@gmail.com>:
> When the Faces Servlet is declared in a web-fragment.xml file contained in
> a library jar of my WAR, JSF doesn't start up correctly.  However when I
> deploy the same code to WildFly 8.2 the same error doesn't occur.
> According to the Servlet's JavaDoc (
> http://docs.oracle.com/javaee/6/api/javax/faces/webapp/FacesServlet.html)
> it can be mapped in web-fragment.xml
>
> Removing the servlet deceleration from the web-fragment.xml, or moving it
> to the web.xml also resolves the issue I'm seeing.  However I need to
> change the default mapping of the JSF servlet and instead of having the
> same code in all of my web.xml files I'd like to have the settings in a
> shared library that all of my WARs already include.
>
> I have a minimal example project here:
> https://github.com/acornett/jsf-servlet-test
>
> Is there something I'm missing, or have I stumbled upon a bug?
>
> - Adam Cornett