You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by PaJaSoft <ja...@fonet.cz> on 2009/02/27 11:18:24 UTC
Re: Geronimo 2.1.x, standard MyFaces bundle,
org.apache.myfaces.ERROR_HANDLER in web.xml - classloading problem
Ivan-65 wrote:
>
> Hi, in Geronimo, JFace API related classes is loaded by Jee-spec
> classloader.
> From my view, this should be a defect of MyFace, I guess it load your
> customized exception handler classes using Class.forName, so the
> ClassNotFoundException error occured
> Could you please try to add the dependcy of MyFaces in your
> geronimo-web.xml
> file
> -----
> <dep:environment>
> <dep:moduleId>
> <dep:groupId>default</dep:groupId>
> <dep:artifactId>TestWeb</dep:artifactId>
> <dep:version>1.0</dep:version>
> <dep:type>car</dep:type>
> </dep:moduleId>
> <dep:dependencies>
> <dep:dependency>
> <dep:groupId>org.apache.myfaces.core</dep:groupId>
> <dep:artifactId>myfaces-api</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
> </dep:dependencies>
> <dep:hidden-classes>
> <dep:filter>javax.faces</dep:filter>
> </dep:hidden-classes>
> </dep:environment>
>
> It should have the same effect with copying those myfaces jars into the
> lib
> folder.
>
> Ivan
>
>
Hello Ivan,
without dependency of myfaces-api and impl (or including their jars in
WEB-INF/lib dir) deploying process always fail:
2009-02-27 11:05:49,556 ERROR [[/NPKWebShop-WEB]] Servlet /NPKWebShop-WEB
threw load() exception
java.lang.IllegalStateException: No Factories configured for this
Application. This happens if the faces-initialization does not work at all -
make sure that you properly include all configuration settings necessary for
a basic faces application and that all the necessary libs are included. Also
check the logging output of your web application and your container for any
exceptions!
If you did that and find nothing, the mistake might be due to the fact that
you use some special web-containers which do not support registering
context-listeners via TLD files and a context listener is not setup in your
web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:105)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1064)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
.
.
.
I try this plan as you suggest (and remove myfaces-api and impl jars from
WEB-INF/lib directory):
<dep:environment>
<dep:moduleId>
<dep:groupId>NPKWebShop</dep:groupId>
<dep:artifactId>NPKWebShop-WEB</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>war</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>com.sun</dep:groupId>
<dep:artifactId>facelets</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.myfaces.core</dep:groupId>
<dep:artifactId>myfaces-api</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
<!--
<dep:dependency>
<dep:groupId>org.apache.myfaces.core</dep:groupId>
<dep:artifactId>myfaces-impl</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
-->
</dep:dependencies>
<dep:hidden-classes>
<dep:filter>javax.faces</dep:filter>
<!--
<dep:filter>org.apache.myfaces</dep:filter>
-->
</dep:hidden-classes>
</dep:environment>
(facelets are deployed to repository by me because I'm using it) and I got
the same java.lang.IllegalStateException as on top of my post... so I try to
specify listener in web.xml as suggested, but the results is the same -
IllegalStateException.
Any idea?
Pavel
--
View this message in context: http://www.nabble.com/Geronimo-2.1.x%2C-standard-MyFaces-bundle%2C-org.apache.myfaces.ERROR_HANDLER-in-web.xml---classloading-problem-tp22239524s134p22242981.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Geronimo 2.1.x, standard MyFaces bundle,
org.apache.myfaces.ERROR_HANDLER in web.xml - classloading problem
Posted by PaJaSoft <ja...@fonet.cz>.
Ivan-65 wrote:
>
> The plan file I use
> ...
> <dep:dependencies>
> <dep:dependency>
> <dep:groupId>com.sun</dep:groupId>
> <dep:artifactId>facelets</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
> <dep:dependency>
> <dep:groupId>org.apache.myfaces.core</dep:groupId>
> <dep:artifactId>myfaces-api</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
> <dep:dependency>
> <dep:groupId>org.apache.myfaces.core</dep:groupId>
> <dep:artifactId>myfaces-impl</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
> </dep:dependencies>
>
> <dep:hidden-classes>
> <dep:filter>javax.faces</dep:filter>
> <dep:filter>org.apache.myfaces</dep:filter>
> </dep:hidden-classes>
> ....
>
Hello,
thank you very much, this is the point of my search..:-) Sometime is
darkness under lamp'-).
I thought - if I specify dependency (MyFaces-impl for ex.) and also specify
hidden-classes filter, those classes are not visible in classpath... so If I
have some reference(-s) (in faces-config.xml for ex.) I got the error during
deploying...
Pavel
--
View this message in context: http://www.nabble.com/Geronimo-2.1.x%2C-standard-MyFaces-bundle%2C-org.apache.myfaces.ERROR_HANDLER-in-web.xml---classloading-problem-tp22239524s134p22287322.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Geronimo 2.1.x, standard MyFaces bundle, org.apache.myfaces.ERROR_HANDLER
in web.xml - classloading problem
Posted by Ivan <xh...@gmail.com>.
Hi,
I got the error page below, not sure whether it is what you expected. I
removed those two jsf jars from the lib folder
The plan file I use
...
<dep:dependencies>
<dep:dependency>
<dep:groupId>com.sun</dep:groupId>
<dep:artifactId>facelets</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.myfaces.core</dep:groupId>
<dep:artifactId>myfaces-api</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.myfaces.core</dep:groupId>
<dep:artifactId>myfaces-impl</dep:artifactId>
<dep:type>jar</dep:type>
</dep:dependency>
</dep:dependencies>
<dep:hidden-classes>
<dep:filter>javax.faces</dep:filter>
<dep:filter>org.apache.myfaces</dep:filter>
</dep:hidden-classes>
....
An Error Occurred (Handled by Navigation): javax.faces.FacesException: Error
calling action method of component with id j_id4:NPE_link
Caused by:
java.lang.NullPointerException - /index.xhtml @15,60
action="#{errorBean.NPE}": java.lang.NullPointerException
Referrer error code for administrator:1235747210303
+- Stack Trace<http://localhost:8080/MyFacesERROR_HANDLER/index.xhtml;jsessionid=5086BD2B10EFBE4867435E8DD3B87F24#>
Exception: javax.faces.FacesException: Error calling action method of
component with id j_id4:NPE_link
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at javax.faces.component.UICommand.broadcast(UICommand.java:141)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:369)
at javax.faces.component.UIViewRoot.process(UIViewRoot.java:264)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:153)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:735)
Caused by: javax.faces.el.EvaluationException: javax.el.ELException:
/index.xhtml @15,60 action="#{errorBean.NPE}":
java.lang.NullPointerException
at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:82)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
... 24 more
Caused by: javax.el.ELException: /index.xhtml @15,60
action="#{errorBean.NPE}": java.lang.NullPointerException
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:74)
at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:78)
... 25 more
Caused by: java.lang.NullPointerException
at test.ErrorBean.NPE(ErrorBean.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
... 26 more
+- Component Tree<http://localhost:8080/MyFacesERROR_HANDLER/index.xhtml;jsessionid=5086BD2B10EFBE4867435E8DD3B87F24#>
<UIViewRoot
locale=" renderKitId=" rendered=" transient=" viewId="><HtmlOutputText
escape=" id=" rendered=" transient=" value="/><HtmlForm enctype=" id="
prependId=" rendered=" submitted=" transient="><HtmlCommandLink action="
actionExpression="#{errorBean.NPE}" disabled="#{errorBean.NPE}"
id="#{errorBean.NPE}" immediate="#{errorBean.NPE}"
rendered="#{errorBean.NPE}" transient="#{errorBean.NPE}"><HtmlOutputText
escape=" id=" rendered=" transient=" value="/></HtmlCommandLink></HtmlForm>
</UIViewRoot>
+- Scoped Variables<http://localhost:8080/MyFacesERROR_HANDLER/index.xhtml;jsessionid=5086BD2B10EFBE4867435E8DD3B87F24#>
2009/2/27 PaJaSoft <ja...@fonet.cz>
>
>
> Ivan-65 wrote:
> >
> > Hi, if possible, could you please upload your app, or remove those
> > confidential contents, only a simple app that could reproduce the error
> > you
> > mentioned.
> > Thanks!
> >
>
> Hi Ivan,
>
> the smallest WEB application that I can imagine is
> http://www.fonet.cz/MyFacesERROR_HANDLER.zip there - it's Eclipse
> project.
> If it is better for you direct deployable WAR - it's
> http://www.fonet.cz/MyFacesERROR_HANDLER.war here (each around 1MiB).
> After
> deploying and starting, application will give you one item in menu and when
> you click on "Get NullPointerException", you get custom error page via
> org.apache.myfaces.ERROR_HANDLER setting parameter in web.xml. This
> use-case
> only works for me when I bundle MyFaces JARs with application in
> WEB-INF/lib. (the real application is much more larger EAR with many EJBs
> and other components of course...)
>
> I'm searching possible way to distribute similar application without
> MyFaces
> (I want use server bundled version of MyFaces - only to specify
> dependencies
> in deployment plan as usualy).
>
> Thank you for your time.
>
> Pavel
> --
> View this message in context:
> http://www.nabble.com/Geronimo-2.1.x%2C-standard-MyFaces-bundle%2C-org.apache.myfaces.ERROR_HANDLER-in-web.xml---classloading-problem-tp22239524s134p22247171.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>
--
Ivan
Re: Geronimo 2.1.x, standard MyFaces bundle,
org.apache.myfaces.ERROR_HANDLER in web.xml - classloading problem
Posted by PaJaSoft <ja...@fonet.cz>.
Ivan-65 wrote:
>
> Hi, if possible, could you please upload your app, or remove those
> confidential contents, only a simple app that could reproduce the error
> you
> mentioned.
> Thanks!
>
Hi Ivan,
the smallest WEB application that I can imagine is
http://www.fonet.cz/MyFacesERROR_HANDLER.zip there - it's Eclipse project.
If it is better for you direct deployable WAR - it's
http://www.fonet.cz/MyFacesERROR_HANDLER.war here (each around 1MiB). After
deploying and starting, application will give you one item in menu and when
you click on "Get NullPointerException", you get custom error page via
org.apache.myfaces.ERROR_HANDLER setting parameter in web.xml. This use-case
only works for me when I bundle MyFaces JARs with application in
WEB-INF/lib. (the real application is much more larger EAR with many EJBs
and other components of course...)
I'm searching possible way to distribute similar application without MyFaces
(I want use server bundled version of MyFaces - only to specify dependencies
in deployment plan as usualy).
Thank you for your time.
Pavel
--
View this message in context: http://www.nabble.com/Geronimo-2.1.x%2C-standard-MyFaces-bundle%2C-org.apache.myfaces.ERROR_HANDLER-in-web.xml---classloading-problem-tp22239524s134p22247171.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Geronimo 2.1.x, standard MyFaces bundle, org.apache.myfaces.ERROR_HANDLER
in web.xml - classloading problem
Posted by Ivan <xh...@gmail.com>.
Hi, if possible, could you please upload your app, or remove those
confidential contents, only a simple app that could reproduce the error you
mentioned.
Thanks!
2009/2/27 PaJaSoft <ja...@fonet.cz>
>
>
> Ivan-65 wrote:
> >
> > Hi, in Geronimo, JFace API related classes is loaded by Jee-spec
> > classloader.
> > From my view, this should be a defect of MyFace, I guess it load your
> > customized exception handler classes using Class.forName, so the
> > ClassNotFoundException error occured
> > Could you please try to add the dependcy of MyFaces in your
> > geronimo-web.xml
> > file
> > -----
> > <dep:environment>
> > <dep:moduleId>
> > <dep:groupId>default</dep:groupId>
> > <dep:artifactId>TestWeb</dep:artifactId>
> > <dep:version>1.0</dep:version>
> > <dep:type>car</dep:type>
> > </dep:moduleId>
> > <dep:dependencies>
> > <dep:dependency>
> > <dep:groupId>org.apache.myfaces.core</dep:groupId>
> > <dep:artifactId>myfaces-api</dep:artifactId>
> > <dep:type>jar</dep:type>
> > </dep:dependency>
> > </dep:dependencies>
> > <dep:hidden-classes>
> > <dep:filter>javax.faces</dep:filter>
> > </dep:hidden-classes>
> > </dep:environment>
> >
> > It should have the same effect with copying those myfaces jars into the
> > lib
> > folder.
> >
> > Ivan
> >
> >
>
> Hello Ivan,
>
> without dependency of myfaces-api and impl (or including their jars in
> WEB-INF/lib dir) deploying process always fail:
>
> 2009-02-27 11:05:49,556 ERROR [[/NPKWebShop-WEB]] Servlet /NPKWebShop-WEB
> threw load() exception
> java.lang.IllegalStateException: No Factories configured for this
> Application. This happens if the faces-initialization does not work at all
> -
> make sure that you properly include all configuration settings necessary
> for
> a basic faces application and that all the necessary libs are included.
> Also
> check the logging output of your web application and your container for any
> exceptions!
> If you did that and find nothing, the mistake might be due to the fact that
> you use some special web-containers which do not support registering
> context-listeners via TLD files and a context listener is not setup in your
> web.xml.
> A typical config looks like this;
> <listener>
>
>
> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
> </listener>
>
> at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106)
> at javax.faces.webapp.FacesServlet.init(FacesServlet.java:105)
> at
>
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1064)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
> .
> .
> .
>
>
> I try this plan as you suggest (and remove myfaces-api and impl jars from
> WEB-INF/lib directory):
>
> <dep:environment>
> <dep:moduleId>
> <dep:groupId>NPKWebShop</dep:groupId>
> <dep:artifactId>NPKWebShop-WEB</dep:artifactId>
> <dep:version>1.0</dep:version>
> <dep:type>war</dep:type>
> </dep:moduleId>
> <dep:dependencies>
> <dep:dependency>
> <dep:groupId>com.sun</dep:groupId>
> <dep:artifactId>facelets</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
>
> <dep:dependency>
>
> <dep:groupId>org.apache.myfaces.core</dep:groupId>
> <dep:artifactId>myfaces-api</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
>
> <!--
> <dep:dependency>
>
> <dep:groupId>org.apache.myfaces.core</dep:groupId>
>
> <dep:artifactId>myfaces-impl</dep:artifactId>
> <dep:type>jar</dep:type>
> </dep:dependency>
> -->
> </dep:dependencies>
>
> <dep:hidden-classes>
> <dep:filter>javax.faces</dep:filter>
> <!--
> <dep:filter>org.apache.myfaces</dep:filter>
> -->
> </dep:hidden-classes>
>
> </dep:environment>
>
> (facelets are deployed to repository by me because I'm using it) and I got
> the same java.lang.IllegalStateException as on top of my post... so I try
> to
> specify listener in web.xml as suggested, but the results is the same -
> IllegalStateException.
>
> Any idea?
>
> Pavel
>
> --
> View this message in context:
> http://www.nabble.com/Geronimo-2.1.x%2C-standard-MyFaces-bundle%2C-org.apache.myfaces.ERROR_HANDLER-in-web.xml---classloading-problem-tp22239524s134p22242981.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>
--
Ivan