You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by danielw <da...@gmail.com> on 2012/07/28 14:56:58 UTC

Running TomEE plus jsf Examples Fails

Hi,
After extracting TomEE-plus (apache-tomee-1.0.0-plus.zip) and building the
jsf example (on examples-4.0.0-src.zip\webapps\jsf), I came across the
following error on catalina.*.log with the following message:

SEVERE: An error occured while initializing MyFaces: Class
org.apache.openejb.jsf.CustomApplicationFactory is no
javax.faces.application.ApplicationFactory
java.lang.IllegalArgumentException: Class
org.apache.openejb.jsf.CustomApplicationFactory is no
javax.faces.application.ApplicationFactory
    at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:128)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:107)
    at
org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:598)
    at
org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:276)
    at
org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:131)
    at
org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:64)
    at
org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:83)
    at
org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:58)
    at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
    at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
    at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:962)
    at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1603)
    at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

*Am I the only one who gets this error? Is there a solution or a
workaround?*

Already tried to use nightly build (version 78) and got 
org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Exception sending context initialized event to listener instance of
class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.VerifyError: (class:
org/apache/webbeans/jsf/OwbApplicationFactory, method: setApplication
signature: (Ljavax/faces/application/Application;)V) Bad type in
putfield/putstatic

Thanks!






--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm, not sure i get what you expect as jar...

they are all in tomee so you can download tomee zip and get lib directory.
If you speak about repo:
https://repository.apache.org/content/groups/snapshots/org/apache/openejb/(you
can pick up new jars here i think)

for the release i hope next month or at the beginning of september.

- Romain


2012/7/30 onyii5119 <on...@gmail.com>

> Romain, how can I get hold of the relevant jars?  Could you please zip them
> up for me. When should expect a new release that fixes the injection issue?
> I am currently not using Maven for my build.
>
> Thanks,
> Jonathan Ekwempu
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656592.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Running TomEE plus jsf Examples Fails

Posted by onyii5119 <on...@gmail.com>.
Romain, how can I get hold of the relevant jars?  Could you please zip them
up for me. When should expect a new release that fixes the injection issue?
I am currently not using Maven for my build.

Thanks,
Jonathan Ekwempu



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656592.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Not sure i didnt write it ;)
Le 31 juil. 2012 07:17, "danielw" <da...@gmail.com> a écrit :

> Thanks Romain!
>
> This JSF example is based on NetBeans's auto-generated JSF feature, right?
> I'll try to migrate my project from Glassfish to TomEE and see what happens
> :)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656600.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Running TomEE plus jsf Examples Fails

Posted by danielw <da...@gmail.com>.
Thanks Romain!

This JSF example is based on NetBeans's auto-generated JSF feature, right?
I'll try to migrate my project from Glassfish to TomEE and see what happens
:)



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656600.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by onyii5119 <on...@gmail.com>.
Thanks Romain. I have taken a quick look at the code and saw that it uses
servlets, jsps and web services. Based on the configuration you supplied I
am going to write a pure JSF 2.0 web application (.xhtml, Managed Bean,
Service layer, MySql) to test it out. Your example is a good start for me. I
will post my feed back when I am done.

Thanks again.

Jonathan Ekwempu




--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656591.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by Romain Manni-Bucau <rm...@gmail.com>.
jsf sample is pretty old (jsf1),

maybe have a look to
https://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/moviefun/

but it is not an hello world...i think we need more jsf samples ;)

- Romain


2012/7/30 onyii5119 <on...@gmail.com>

> Thanks Romain for the feed back. I thought as much that something must be
> wrong. Have you taken a look at the configuration issues? A concrete
> example
> (for JSF 2.0) would be very helpful.
>
> Thanks,
> Jonathan Ekwempu
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656589.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Running TomEE plus jsf Examples Fails

Posted by onyii5119 <on...@gmail.com>.
Thanks Romain for the feed back. I thought as much that something must be
wrong. Have you taken a look at the configuration issues? A concrete example
(for JSF 2.0) would be very helpful.

Thanks,
Jonathan Ekwempu



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656589.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

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

2 notes about jsf and tomee:
1- 1.0.0 had a awful bug about ejb injections in managedbean (fixed on
trunk)
2- on trunk we were able to provide mojarra in webapps so you should be
able to do the same

- Romain


2012/7/28 onyii5119 <on...@gmail.com>

> JSF 2 runs fine in Tomcat. I am only testing it out in TomEE in order to
> take
> advantage of what java ee 6 offers. Currently, I use spring to inject
> services into beans. I was thinking of dropping Spring Framework for a
> complete java ee solution running in a light container like TomEE.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656567.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Running TomEE plus jsf Examples Fails

Posted by onyii5119 <on...@gmail.com>.
JSF 2 runs fine in Tomcat. I am only testing it out in TomEE in order to take
advantage of what java ee 6 offers. Currently, I use spring to inject
services into beans. I was thinking of dropping Spring Framework for a
complete java ee solution running in a light container like TomEE.



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656567.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by danielw <da...@gmail.com>.
Thank you for your answer. 

>From your experience it sounds like there is no way to run a JSF 2.0 on
Tomcat, right?



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656566.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running TomEE plus jsf Examples Fails

Posted by onyii5119 <on...@gmail.com>.
Thanks for coming up with TomEE. 

I read about TomEE, watched the video, got excited but felt disappointed
working with it and JSF 2.0, Hibernate, MySql and Primefaces. It has been
frustrating for me working with TomEE and JSF. Configuration

Initially, I thought you could drop a JSF war in TomEE without issues but
that is not true. TomEE jars conflicts with jars in a jsf web application.
TomEE expects all your jars to be in TomEE lib directory - which is awful
and not a good design. Some configurations that are usually done in a web
application, TomEE expects them to be done in tomee.xml. This will not scale
if you have multiple applications deployed in TomEE. I noticed too that it
is not easy to swap out MyFaces jars and use javax.myfaces jar. Also, any
attempt to use javaee-api jar is a no no.

I may be wrong in some of my assumptions and findings but a good way to go
is for someone in the TomEE team to come up with a pure JSF 2.0 example that
shows how:
1. To annotate the Managed bean
2. Create a service that fetches data from a MySQl database with a defined
Entity bean
3. Show how to inject the service in a Managed bean
4. Show a .xhtml file that uses the Managed bean (use Primefaces as the add
on component)
5.And Finally (very important) show the persistent.xml and what entries are
required in web.xml and tomee.xml.

Which jar files should be in the web lib directory and which one should be
in TomEE lib directory?

Don't point me to the examples, I have seen all of them. They are helpful
but they did not solve the issues I raised.

A really simple functional and complete JSF 2.0 example will help a great
deal. 

Thanks.




--
View this message in context: http://openejb.979440.n4.nabble.com/Running-TomEE-plus-jsf-Examples-Fails-tp4656561p4656564.html
Sent from the OpenEJB User mailing list archive at Nabble.com.