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.

Bug 74383 - JSF from Entity Beans - does not deploy to JBoss
Summary: JSF from Entity Beans - does not deploy to JBoss
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: JBoss (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-04 15:42 UTC by khooke
Modified: 2006-05-24 11:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description khooke 2006-04-04 15:42:05 UTC
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.
Comment 1 Sherold Dev 2006-04-05 16:19:38 UTC
Reassigning to JBoss guru.
Comment 2 Libor Kotouc 2006-04-05 16:37:38 UTC
Simply do what IllegalStateException suggests you.
Comment 3 Libor Kotouc 2006-04-05 16:41:09 UTC
It should be resolved as WONTFIX rather than invalid.
Comment 4 Libor Kotouc 2006-04-05 16:45:36 UTC
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.
Comment 5 Libor Kotouc 2006-04-07 16:50:54 UTC
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.
Comment 6 khooke 2006-04-08 07:50:08 UTC
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.
Comment 7 Pavel Buzek 2006-04-27 19:16:15 UTC
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.
Comment 8 Pavel Buzek 2006-04-28 00:28:51 UTC
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
Comment 9 Michal Mocnak 2006-05-24 11:59:05 UTC
Verified