This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have a simple app that has 3 EJB3.0 Entity beans. I used the 'JSF Pages from Entity Beans wizard' to generate a CRUD page for one of the entity beans. The wizard completes successfully. When I try to deploy to JBoss 4.0.4RC1 I get this error: 07:37:49,447 ERROR [[/OnlineStoreWeb]] StandardWrapper.Throwable java.lang.IllegalStateException: No Factories configured for this Application - typically this is because 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:8 at javax.faces.webapp.FacesServlet.init(FacesServlet.java:8 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:109 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:92 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:388 at org.apache.catalina.core.StandardContext.start(StandardContext.java:414 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:75 at org.apache.catalina.core.ContainerBase.addChild(... If I add the <listener> section that the stack trace says is missing to my web.xml, I still get the same error.
Reassigning to JBoss guru.
Simply do what IllegalStateException suggests you.
It should be resolved as WONTFIX rather than invalid.
It is a matter of JSF implementation in JBoss server. We cannot workaround this at least for the inability to rely on some implementaion details.
The exception says: ...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> The only thing you must do is to add this element into the web.xml. Could you please try it and give us know whether it helps? Thanks.
I added the missing <listener> section and this fixed one issue. However, there were still a number of issues I have found by trial and error, and the generated JSF pages are still not working: 1. the generated persistence.xml had the wrong jndi format for jboss. The jta-data-source element was generated as: <jta-data-source>jndi/store</jta-data-source> but it should have been: <jta-data-source>java:/store</jta-data-source> 2. The generated JSF Controller class had the ENtityManager reference defaulted to: @PersistenceContext(unitName = "ReplaceWithPersistenceUnitName") where is should have matched the generated value in the persistence.xml: @PersistenceContext(unitName = "OnlineStore-ejb") EAR now deploys ok, without error but JSF generated pages are not working, for other reasons: javax.servlet.ServletException: Cannot get value for expression '#{item.items}' javax.faces.webapp.FacesServlet.service(FacesServlet.java:121) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) I don't know enough about JSF, but suspect I can debug this myslef if I learn some more. I think at this point this defect can be closed.
I do not see a big problem fixing this. I will add a listener to web.xml if the listener class is available on cp. This has no impact on sun app server or tomcat and it does not create any dependency on myfaces. Note that if you switch from server to another you will likely have to add/remove jsf library so one more step is hopefully not a big issue.
Checking in src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java; /cvs/web/jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java,v <-- JSFFrameworkProvider.java new revision: 1.3.2.5.2.5; previous revision: 1.3.2.5.2.4 done
Verified