Throwing an error when nesting forms #181

cocorossello opened this Issue Nov 14, 2015 · 5 comments


None yet

3 participants


Nesting forms is illegal in both html or JSF. The problem is that the behaviour is unpredictable and is rather hard to see that an ajax error is produced by this mistake. I think it would be good if omnifaces could throw an error when nesting forms (or throw an error in development and log an error in production, or at least log an error).

Due to our inexperience with JSF we started with a form in the template and we are now migrating it but from time to time sometimes someone nests 2 forms and we realize a few days later...


I'm also facing this issue sometimes with our template! Let me know if you guys release a new version with this feature.


BalusC commented Nov 26, 2015


@BalusC BalusC added a commit that closed this issue Jul 16, 2016
@BalusC BalusC Fix #181: add NestedFormsChecker to OmniViewHandler
(took the opportunity to parameterize Components#invoke())
@BalusC BalusC closed this in c7909c1 Jul 16, 2016
BalusC commented Jul 16, 2016

I added one which automatically runs during development stage.

It's available in today's latest 2.5-SNAPSHOT.


Sorry for the delay, couldn't test it. Application does not boot on tomee 7.0.1 since 2.5-SNAPSHOT (it does boot with 2.4).

This is a trace of an empty webapp only with omnifaces 2.5-SNAPSHOT jar:

Caused by: java.lang.IllegalStateException: CDI BeanManager instance is not available in this environment.
at org.omnifaces.ApplicationInitializer.checkCDIImplAvailable( ~[na:na]
at org.omnifaces.ApplicationInitializer.checkCDI11Available( ~[na:na]
at org.omnifaces.ApplicationInitializer.onStartup( ~[na:na]
at org.apache.catalina.core.StandardContext.startInternal( ~[catalina.jar:8.5.3]
at org.apache.catalina.util.LifecycleBase.start( ~[catalina.jar:8.5.3]
... 10 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke( ~[na:1.8.0_102]
at org.omnifaces.ApplicationInitializer.checkCDIImplAvailable( ~[na:na]
... 14 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.apache.webbeans.container.OwbCDI.getBeanManager( ~[openwebbeans-impl-1.6.3.jar:1.6.3]

I'll try to see what is wrong here, since minimum requirements should be met with tomee 7.0.1

BalusC commented Aug 1, 2016

Might be related to #281. The showcase app deploys fine for me on both 7.0.1 Plus and Plume though.

How does the beans.xml of your test webapp look like? The showcase app has just an empty one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment