Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Hildeberto Mendonça
Votes: 1
Watchers: 1

If you were logged in you would be able to see more operations.

Not possible to deploy a JavaEE 6 App on Glassfish 4 because it could not find backup for factory javax.faces.context.FacesContextFactory

Created: 28/May/13 03:41 PM   Updated: 05/Jul/13 12:18 PM   Resolved: 05/Jul/13 12:18 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


Windows 7, JDK 1.7, Glassfish 4.0_b89

Tags: deployment gf_4_exclude jsf2_2
Participants: Ed Burns, Hildeberto Mendonça, Manfred Riem and rogerk

 Description  « Hide

While trying to deploy a JavaEE 6 application on Glassfish 4, I've got the following exception that breaks the deployment process:

SEVERE:   Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
SEVERE:   L'application n'a pas été initialisée correctement au démarrage. Impossible de localiser la Fabrique : javax.faces.context.FacesContextFactory. Attempting to find backup.
SEVERE:   WebModule[]StandardWrapper.Throwable
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
	at javax.faces.FactoryFinder$FactoryManager.getFactory(
	at javax.faces.FactoryFinder.getFactory(
	at javax.faces.webapp.FacesServlet.init(
	at org.apache.catalina.core.StandardWrapper.initServlet(
	at org.apache.catalina.core.StandardWrapper.load(
	at org.apache.catalina.core.StandardContext.loadOnStartup(
	at org.apache.catalina.core.StandardContext.start(
	at com.sun.enterprise.web.WebModule.start(
	at org.apache.catalina.core.ContainerBase.addChildInternal(
	at org.apache.catalina.core.ContainerBase.addChild(
	at org.apache.catalina.core.StandardHost.addChild(
	at com.sun.enterprise.web.WebContainer.loadWebModule(
	at com.sun.enterprise.web.WebContainer.loadWebModule(
	at com.sun.enterprise.web.WebApplication.start(
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
	at org.glassfish.deployment.admin.DeployCommand.execute(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$
	at Method)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(
	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(
	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(
	at org.glassfish.grizzly.http.server.HttpHandler.runService(
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(
	at org.glassfish.grizzly.ProcessorExecutor.execute(
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$

To solve the problem I had to add the following Maven dependency in the web module:


After that, the deployment worked normally, but in normal circumstances it is supposed to work without it.

The entire source code of the project is available here:
Our issue related to the problem is: Here you can see what we have changed to solve the problem.

Manfred Riem added a comment - 28/May/13 07:05 PM

I am unable to deploy the application because of the stacktrace below (using JavaDB).

Can you reproduce this with an example without all of these external dependencies?


java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: liquibase.exception.MigrationFailedException: Migration failed for change set org/cejug/yougi/db/changelog/mysql-create.sql::1::htmfilho:
Reason: liquibase.exception.DatabaseException: Error executing SQL drop table if exists event_venue: Syntax error: Encountered "exists" at line 1, column 15.:
Caused By: Error executing SQL drop table if exists event_venue: Syntax error: Encountered "exists" at line 1, column 15.:
Caused By: Syntax error: Encountered "exists" at line 1, column 15.:
Caused By: Syntax error: Encountered "exists" at line 1, column 15.
at com.sun.enterprise.web.WebApplication.start(

Manfred Riem added a comment - 28/May/13 07:19 PM

Also please remove as a JavaEE container should not try to bootstrap the JSF runtime manually.


Hildeberto Mendonça added a comment - 29/May/13 09:08 AM

This app doesn't use JavaDB. It uses MySQL instead. All scripts target MySQL and it would take time to adapt them to JavaDB. However, we have created an issue to handle that: While we don't close this issue, chapter 7 of the documentation explains how to deploy the application locally:


This problem actually occurs when I try to deploy the application using Netbeans 7.3 on Windows 7, thus we are talking about the development environment. I tried the same thing on a Mac OS X Mountain Lion and it works fine without adding the JSF dependency. That's very strange because I'm using Glassfish zip distribution, which is exactly the same for both platforms. I've downloaded Glassfish from the following link:

I removed the listener and nothing changed on the Windows platform. Thanks for the tip by the way!

Manfred Riem added a comment - 29/May/13 06:57 PM

Can you please remove the dependency on the database. If it is a JSF issue you should be able to reproduce this without any database.

Hildeberto Mendonça added a comment - 29/May/13 07:20 PM

It's a bit difficult to remove the dependency on the database from a database application Is it ok for you if I make it deployable using Glassfish's JavaDB?

rogerk added a comment - 29/May/13 08:02 PM

That would help.

Ed Burns added a comment - 29/May/13 08:14 PM

Can you try putting the Mojarra 2.2.0 final locally bundled in your app?

Hildeberto Mendonça added a comment - 29/May/13 08:34 PM

Hi Ed, as I told in the description of this issue, by adding the following Maven dependency in the web module:


the deployment worked normally and the application worked smoothly. Thanks for the great backward compatibility, by the way! The problem happens when I try to fully rely on the application server to provide this dependency (as it has been working so far).

Hi Rogerk,

I will work on that and make it use JavaDB as soon as possible. Thanks for considering that!

Hildeberto Mendonça added a comment - 05/Jul/13 08:37 AM - edited

This issue was initially produced on Glassfish 4.0_b89. I just installed the latest version of Glassfish 4 (available at, trying to reproduce the error once again and the problem didn't happen anymore in the same environment. So, I personally consider the problem solved. It was fixed somewhere between b89 and the latest version.

Thanks for your attention!

rogerk added a comment - 05/Jul/13 12:18 PM

Thanks for verifying.