Forums

angle-left Back

RE: Problem with Liferay Faces CDI on JBoss 7.1

Florian Huber, modified 4 Years ago.

Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
Hi Board,

I want to build a portlet useing CDI, liferay-faces-bridge and Icefaces on JBoss 7.1 with Liferay 6.1.2ce-ga3.

So I downloaded the jboss package from liferay.com and followed the instructions on https://www.liferay.com/de/community/wiki/-/wiki/Main/Developing+JSF+Portlets+with+CDI

On deploy i get the following error caused by an classcastexception:

Caused by: java.lang.ClassCastException: org.jboss.weld.manager.BeanManagerImpl cannot be cast to javax.enterprise.inject.spi.BeanManager



13:51:50,017 INFO  [stdout] (MSC service thread 1-4) com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for weblib-search-portlet
13:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
13:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:40)
13:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:195)
...
13:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
13:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
13:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:151)
13:51:50,022 INFO  [stdout] (MSC service thread 1-4)     at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
...
13:51:50,023 INFO  [stdout] (MSC service thread 1-4)     at java.lang.Thread.run(Thread.java:724)
13:51:50,023 INFO  [stdout] (MSC service thread 1-4) Caused by: java.lang.reflect.InvocationTargetException
...
13:51:50,025 INFO  [stdout] (MSC service thread 1-4)     ... 26 more
13:51:50,025 INFO  [stdout] (MSC service thread 1-4) Caused by: java.lang.ClassCastException: org.jboss.weld.manager.BeanManagerImpl cannot be cast to javax.enterprise.inject.spi.BeanManager
13:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:57)
13:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.instantiatingListener(SecurePluginContextListener.java:347)
13:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.instantiatingListeners(SecurePluginContextListener.java:163)
13:51:50,026 INFO  [stdout] (MSC service thread 1-4)     ... 32 more
13:51:50,026 INFO  [stdout] (MSC service thread 1-4) 13:51:50,026 INFO  [MSC service thread 1-4][HookHotDeployListener:584] Registering hook for weblib-search-portlet
13:51:50,029 INFO  [stdout] (MSC service thread 1-4) 13:51:50,029 INFO  [MSC service thread 1-4][HookHotDeployListener:711] Hook for weblib-search-portlet is available for use
13:51:50,030 INFO  [stdout] (MSC service thread 1-4) 13:51:50,029 INFO  [MSC service thread 1-4][PortletHotDeployListener:295] Registering portlets for weblib-search-portlet
13:51:50,056 INFO  [stdout] (MSC service thread 1-4) 13:51:50,055 INFO  [BridgeImpl] Initializing Liferay Faces Bridge 3.1.2-ga3 (Galatia / Jun 1, 2013 AD)
13:51:50,125 INFO  [stdout] (MSC service thread 1-4) 13:51:50,125 INFO  [MSC service thread 1-4][PortletHotDeployListener:454] 1 portlet for weblib-search-portlet is available for use
13:51:50,126 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/weblib-search-portlet]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class com.liferay.cdi.portlet.bridge.CDIContextListener: java.lang.ClassCastException: org.jboss.weld.manager.BeanManagerImpl cannot be cast to javax.enterprise.inject.spi.BeanManager
    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:57) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
[ICEFACES STARTUP]
13:51:50,523 INFO  [javax.enterprise.resource.webcontainer.jsf.lifecycle] (MSC service thread 1-4) JSF1027: [null Die ELResolvers für JSF wurden nicht im JSP-Container registriert.
13:51:50,550 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Error listenerStart
13:51:50,551 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/weblib-search-portlet] startup failed due to previous errors
13:51:50,552 SEVERE [javax.faces] (MSC service thread 1-4) Die Anwendung wurde bei Systemstart nicht einwandfrei initialisiert, Factory konnte nicht gefunden werden: javax.faces.application.ApplicationFactory. Rügriff versucht.
13:51:50,553 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/weblib-search-portlet]] (MSC service thread 1-4) Exception sending context destroyed event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.IllegalStateException: Kein Rügriff für javax.faces.application.ApplicationFactory gefunden.
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at javax.faces.component.UIViewRoot$ViewMap.clear(UIViewRoot.java:1779) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
...


Full Log http://pastebin.com/a2XA2Way

My Configs:
pom.xml http://pastebin.com/sJBeqiei
web.xml http://pastebin.com/pZTSBE6e
portlet.xml http://pastebin.com/WmF5aBnM

I have no idea how to solv this classcast exception. It also happens if if try the demo .jar from liferay-faces-bridge-cdi

If anybody had the same problem, please help.

Greetings Florian
Juan Gonzalez, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Liferay Legend Posts: 3073 Join Date: 10/28/08 Recent Posts
Hi Florian,

guess you have to upgrade your Weld libraries in your JBoss.

Please take a look at this Wiki:

https://www.liferay.com/es/community/wiki/-/wiki/Main/Developing+JSF+Portlets+with+CDI
Florian Huber, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
wohaa that was fast ;)

i just take a look, there is weld-core1.1.5-AS71.Final.jar in the liferay bundle
Florian Huber, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
So after update to 1.1.14.Final I still get this error:

http://nopaste.info/408f29aaf4.html
Vernon Singleton, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Expert Posts: 315 Join Date: 1/14/13 Recent Posts
Florian Huber:
So after update to 1.1.10.Final I still get this error:

http://nopaste.info/408f29aaf4.html


You may want to just try the jsf-cdi-portlet demo ...
I just tried it in the liferay-portal-6.1.2 - jboss-7.1.1 and it worked. Then I tried a couple more steps just to see if I could go in the direction you are trying to go ...
1) I added the icefaces dependencies to the pom.xml, and
2) updated the applicants.xhtml file to use a couple of the ace:textEntry components from icefaces instead of the h:inputText tags from the jsf taglibs

And it is deploying and working fine under jboss-7.1.1.

To try the jsf2-cdi-portlet demo for yourself, you can follow these instructions for building Liferay Faces from source. If you use the deploy.sh script in the Liferay Faces parent directory, you can run "deploy.sh jboss" from the demos/bridge/jsf2-cdi-portlet directory. You may need to adjust either the location that the parent pom.xml points to or the location of your jboss instance based on the directory that the deploy.sh script says it is deploying the war to, but it will deploy that portlet to your jboss instance. Or you could use a mvn command such as: mvn -P liferay,mojarra,jboss,redeploy clean install liferay:deploy, either way, the deploy will be trying to use the properties noted in your pom.

An important profile for your case is the "jboss" profile, which will make sure that the correct dependencies are (not) included in the war, since jboss already comes with weld in the global classpath.

Try the jsf-cdi-portlet, and let us know if it is working for you. Then you can add your icefaces namespaces, and go from there ...

Hope that helps,
Vernon Singleton
Florian Huber, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
I completely started from scratch - the downloaded cdi-demo-portlet still isn't deploying. But i sucessfully deployed the demo portlet if I build it from source as you mentioned. emoticon After the deploy I added the Portlet to an empty Page and get the following Exception:


13:33:54,737 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starte Deployment von "jsf2-cdi-portlet.war" (runtime-name: "jsf2-cdi-portlet.war")
13:33:54,968 INFO  [org.jboss.weld.deployer] (MSC service thread 1-11) JBAS016002: Bearbeite Weld-Deployment jsf2-cdi-portlet.war
13:33:55,080 INFO  [org.jboss.weld.deployer] (MSC service thread 1-13) JBAS016005: Starte Dienste für CDI-Deployment: jsf2-cdi-portlet.war
13:33:55,130 INFO  [org.jboss.weld.Version] (MSC service thread 1-13) WELD-000900 1.1.14 (Final)
13:33:55,158 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starte Weld-Dienst für Deployment jsf2-cdi-portlet.war
13:33:55,420 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-6) Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
13:33:55,421 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-6) Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
13:33:55,557 INFO  [org.jboss.web] (ServerService Thread Pool -- 5) JBAS018210: Registrierung von Webkontext: /jsf2-cdi-portlet
13:33:55,681 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 5) Initializing Spring root WebApplicationContext
13:33:55,765 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 5) Mojarra 2.1.26 ( 20130905-1451 https://svn.java.net/svn/mojarra~svn/tags/2.1.26@12478) für Kontext '/jsf2-cdi-portlet' wird initialisiert.
13:33:55,887 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 5) Monitoring jndi:/default-host/jsf2-cdi-portlet/WEB-INF/faces-config.xml for modifications
13:33:55,888 INFO  [javax.enterprise.resource.webcontainer.jsf.lifecycle] (ServerService Thread Pool -- 5) JSF1027: [null Die ELResolvers für JSF wurden nicht im JSP-Container registriert.
13:33:56,112 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: "jsf2-cdi-portlet.war" deployed (runtime-name: "jsf2-cdi-portlet.war")
13:34:01,594 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet].[1 Servlet]] (http-/127.0.0.1:8080-2) JBWEB000236: Servlet.service() for servlet 1 Servlet threw exception: javax.portlet.faces.BridgeException: java.lang.IllegalStateException: Must call associate() before calling activate()
    at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:193) [liferay-faces-bridge-impl-3.1.3-ga4.jar:3.1.3-ga4 (Galatia / Sep 26, 2013 AD)]
    at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:85) [liferay-faces-bridge-impl-3.1.3-ga4.jar:3.1.3-ga4 (Galatia / Sep 26, 2013 AD)]
    at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:112) [liferay-faces-bridge-impl-3.1.3-ga4.jar:3.1.3-ga4 (Galatia / Sep 26, 2013 AD)]
    at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:255) [liferay-faces-bridge-api-3.1.3-ga4.jar:3.1.3-ga4 (Galatia / Sep 26, 2013 AD)]
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328) [portlet.jar:]
    at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:204) [liferay-faces-bridge-api-3.1.3-ga4.jar:3.1.3-ga4 (Galatia / Sep 26, 2013 AD)]
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233) [portlet.jar:]


after JBoss restart and acces the page, I get the following NPE instead:

12:06:56,394 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet].[1 Servlet]] (http-/127.0.0.1:8080-5) JBWEB000236: Servlet.service() for servlet 1 Servlet threw exception: java.lang.NullPointerException
    at com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil.getManagedBeanReference(CDIBeanManagerUtil.java:34) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
    at com.liferay.cdi.portlet.bridge.CDICrossContextFilter.doFilter(CDICrossContextFilter.java:41) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207) [portal-service.jar:]
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) [portal-service.jar:]
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:79) [portal-service.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:602)
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:675)
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:382)


I found out that this Util is prefilled by an Listener. I checked the listeners section in web.xml and web-jboss.xml, but the listeners are correctly in these XMLS.
BTW: The jsf2-demo is working.

Here are the Versions of my Librarys i exchanged in JBoss:
jsf-impl-2.1.26.jar
jsf-api-2.1.26.jar
weld-core-1.1.14.Final.jar

greetings
Florian
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Hi everybody,

I've got the same problem:
http://nopaste.info/4d7aefe84c.html

Using:
* JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)
* liferay-portal-6.1.2-ce-ga3
* Mojarra 2.1.21
* weld-core-1.1.13.Final-redhat-1


Thanks in advance for your help.
Juan Gonzalez, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Liferay Legend Posts: 3073 Join Date: 10/28/08 Recent Posts
Please can you test with weld 1.1.10 or 1.1.11.

I remember some weeks ago I had problems testing with latest weld version.
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Hola Juan,

I've tested it wih the weld-core-1.1.10.Final and I've got the same error:

http://pastebin.com/raw.php?i=Y9i9ZAe3

Thanks for your help.
Juan Gonzalez, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Liferay Legend Posts: 3073 Join Date: 10/28/08 Recent Posts
Can you send your portlet/pom.xml?

Thanks
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
I suppose you mean the pom.xml of the portlet which I'm trying to develop.
So, the attached file, is the pom corresponding to that path:
jsf2-cdi-portlet.war/META-INF/maven/com.liferay.faces.demos/jsf2-cdi-portlet/pom.xml

Thanks.
Neil Griffin, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
Please try cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar (41.8k) which is attached to this other forum post.
Neil Griffin, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
Also, make sure that you don't have cdi-api.jar or any Weld related JARs in the WEB-INF/lib folder of your deployed portlet. Those are provided for you automatically in the classpath when deploying with JBoss AS 7.
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Hi Neil, thanks for your help.

I've deleted cdi-portlet-bridge-shared-6.2.0.1.jar and added cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar.
Also deleted jsf-api-2.1.21.jar, weld-servlet-1.1.10.Final.jar.

So, now the portlet has:

cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar
commons-io-1.3.2.jar
jsf-impl-2.1.21.jar
liferay-faces-bridge-api-3.1.3-ga4.jar
liferay-faces-util-3.1.3-ga4.jar
commons-fileupload-1.2.2.jar
jboss-el-2.0.0.GA.jar
liferay-faces-alloy-3.1.3-ga4.jar
liferay-faces-bridge-impl-3.1.3-ga4.jar


But I still get a similar error:

http://pastebin.com/LxhFew6m
Florian Huber, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
I got it working!

I downgraded weld to 1.1.10 (Final) and added your cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar to the jsf2-cdi-portlet-3.1.3-ga4.war.
The jsf2-cdi-portlet-3.1.3-ga4.war is compiled from the source with mvn clean install -P jboss
Florian Huber, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Junior Member Posts: 29 Join Date: 3/23/11 Recent Posts
It seems the error is just caused by the weld version > 1.1.10. I just tried the demo portlet (jsf2-cdi-portlet-3.1.3-ga4.war) without the SNAPSHOT bridge and it worked also like charm ;)
Vernon Singleton, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Expert Posts: 315 Join Date: 1/14/13 Recent Posts
Glad to hear that you got it working.
Hang in there with CDI, you are breaking newer ground with Liferay, JSF and CDI.

Good job, sticking with it and working with us.
Welcome to the Liferay Faces community!

- Vernon Singleton
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Following Florian instructions, I'm still unable to deploy it:

15:07:41,026 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found jsf2-cdi-portlet.war in deployment directory. To trigger deployment create a file called jsf2-cdi-portlet.war.dodeploy
15:07:41,031 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "jsf2-cdi-portlet.war" (runtime-name: "jsf2-cdi-portlet.war")
15:07:41,278 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
15:07:41,279 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
15:07:41,462 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
15:07:41,606 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
15:07:41,642 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900 1.1.10 (Final)
15:07:41,674 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
15:07:41,950 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-6) Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
15:07:41,950 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-6) Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
15:07:42,083 INFO  [org.jboss.web] (ServerService Thread Pool -- 98) JBAS018210: Register web context: /jsf2-cdi-portlet
15:07:42,091 INFO  [org.apache.catalina.core] (ServerService Thread Pool -- 98) JBWEB001093: The listener com.sun.faces.config.ConfigureListener is already configured for this context, the duplicate definition has been ignored
15:07:42,335 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) Initializing Spring root WebApplicationContext
15:07:42,356 INFO  [org.jboss.weld.Bootstrap] (ServerService Thread Pool -- 98) WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
15:07:42,480 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) JBWEB000287: Exception sending context initialized event to listener instance of class com.liferay.cdi.portlet.bridge.CDIContextListener: java.lang.ClassCastException: org.jboss.weld.manager.BeanManagerImpl cannot be cast to javax.enterprise.inject.spi.BeanManager
    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:48) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

15:07:42,483 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 98) Initializing Mojarra 2.1.21 ( 20130409-1421 https://svn.java.net/svn/mojarra~svn/tags/2.1.21@11854) for context '/jsf2-cdi-portlet'
15:07:42,594 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 98) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.21.jar:2.1.21]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory
    at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:1018) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.as.weld.webtier.jsf.WeldApplication.getExpressionFactory(WeldApplication.java:91) [jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.21.jar:2.1.21]
    ... 12 more

15:07:42,596 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) JBWEB000287: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:276) [jsf-impl-2.1.21.jar:2.1.21]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.21.jar:2.1.21]
    ... 11 more
Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory
    at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:1018) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.as.weld.webtier.jsf.WeldApplication.getExpressionFactory(WeldApplication.java:91) [jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet-1.1.10.Final.jar:20121012-1000]
    at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.21.jar:2.1.21]
    ... 12 more

15:07:42,598 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 98) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
15:07:42,599 SEVERE [javax.faces] (ServerService Thread Pool -- 98) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
15:07:42,599 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 98) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jsf-api-2.1.21.jar:2.1]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jsf-api-2.1.21.jar:2.1]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:141) [jsf-impl-2.1.21.jar:2.1.21]
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:314) [jsf-impl-2.1.21.jar:2.1.21]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3427) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3839) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

15:07:42,609 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) Closing Spring root WebApplicationContext
15:07:42,622 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 98) MSC000001: Failed to start service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
    ... 6 more

15:07:42,837 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "jsf2-cdi-portlet.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./jsf2-cdi-portlet" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
15:07:42,863 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
15:07:42,867 WARN  [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000004: Failure during stop of service jboss.deployment.unit."jsf2-cdi-portlet.war".WeldBootstrapService: java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
    at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:76)
    at org.jboss.weld.Container.instance(Container.java:54)
    at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:466)
    at org.jboss.as.weld.WeldBootstrapService.stop(WeldBootstrapService.java:128)
    at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]

15:07:42,892 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment jsf2-cdi-portlet.war (runtime-name: jsf2-cdi-portlet.war) in 54ms


Thanks.

PD: I have a response to Neil's post, but it's marked as spam waiting to be approved by an administrator.
Vernon Singleton, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Expert Posts: 315 Join Date: 1/14/13 Recent Posts
So, now the portlet has:
...
jsf-impl-2.1.21.jar
...


Hi J Viso,

You may need to follow these instructions here:
https://www.liferay.com/community/wiki/-/wiki/Main/Upgrading+Mojarra+in+JBoss+AS

If the jsf-impl is in your war, that could be the problem.
Try following the instructions to upgrade mojarra in the Jboss global classpath in the link above, and if anything, remove the jsf-impl and jsf-api from the portlet war for JBoss.

If you upgrade mojarra (jsf-impl and jsf-api) in the JBoss global classpath, but leave mojarra also in the war, it might work ok, but it's probably better to just have mojarra in the global classpath for JBoss.

Hope that helps,
Vernon Singleton
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Hi Vernon, thanks for your help.

I've deleted jsf-impl-2.1.21.jar and now the portlet war has:

cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar
commons-fileupload-1.2.2.jar
commons-io-1.3.2.jar
jboss-el-2.0.0.GA.jar
liferay-faces-bridge-api-3.1.3-ga4.jar
liferay-faces-util-3.1.3-ga4.jar
liferay-faces-alloy-3.1.3-ga4.jar
liferay-faces-bridge-impl-3.1.3-ga4.jar


I already had Mojarra upgraded, but I checked again and it's upgraded. As you can see in the attached picture.

This is the error message when trying to deploy:

08:19:14,494 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found jsf2-cdi-portlet.war in deployment directory. To trigger deployment create a file called jsf2-cdi-portlet.war.dodeploy
08:19:14,498 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "jsf2-cdi-portlet.war" (runtime-name: "jsf2-cdi-portlet.war")
08:19:14,926 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
08:19:15,154 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
08:19:15,222 INFO  [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900 1.1.10 (Final)
08:19:15,306 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
08:19:15,512 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) WELD-000119 Not generating any bean definitions from com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil because of underlying class loading error
08:19:15,513 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil
    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:116) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:135) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:63) [jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_40]
    at java.lang.Class.privateGetDeclaredFields(Class.java:2387) [rt.jar:1.7.0_40]
    at java.lang.Class.getDeclaredFields(Class.java:1796) [rt.jar:1.7.0_40]
    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:105) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:155) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:121) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:358)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
    at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:396)
    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    ... 11 more
Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
    ... 29 more

08:19:15,565 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.interceptor.AroundInvoke' not found, interception based on it is not enabled
08:19:15,566 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.interceptor.AroundTimeout' not found, interception based on it is not enabled
08:19:15,566 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.annotation.PostConstruct' not found, interception based on it is not enabled
08:19:15,566 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.annotation.PreDestroy' not found, interception based on it is not enabled
08:19:15,566 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
08:19:15,566 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-2) Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
08:19:15,693 INFO  [org.jboss.web] (ServerService Thread Pool -- 88) JBAS018210: Register web context: /jsf2-cdi-portlet
08:19:15,966 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 88) Initializing Spring root WebApplicationContext
08:19:16,054 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 88) JBWEB000287: Exception sending context initialized event to listener instance of class com.liferay.cdi.portlet.bridge.CDIContextListener: java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/BeanManager
    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:45) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.spi.BeanManager from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
    ... 12 more

08:19:16,058 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 88) Initializing Mojarra 2.1.21 ( 20130409-1421 https://svn.java.net/svn/mojarra~svn/tags/2.1.21@11854) for context '/jsf2-cdi-portlet'
08:19:16,238 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 88) Monitoring jndi:/default-host/jsf2-cdi-portlet/WEB-INF/faces-config.xml for modifications
08:19:16,240 INFO  [javax.enterprise.resource.webcontainer.jsf.lifecycle] (ServerService Thread Pool -- 88) JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
08:19:16,242 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 88) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
08:19:16,256 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 88) Closing Spring root WebApplicationContext
08:19:16,276 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 88) MSC000001: Failed to start service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
    ... 6 more

08:19:16,517 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "jsf2-cdi-portlet.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./jsf2-cdi-portlet" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
08:19:16,531 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
08:19:16,559 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment jsf2-cdi-portlet.war (runtime-name: jsf2-cdi-portlet.war) in 69ms
Juan Gonzalez, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

Liferay Legend Posts: 3073 Join Date: 10/28/08 Recent Posts
Seems you need javax.enterprise dependency in your pom.xml:

<dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
                        <version>1.0-SP4</version>
        </dependency>
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
Hola Juan, gracias.

I edited the pom file META-INF/maven/com.liferay.faces.demos/jsf2-cdi-portlet/pom.xml

And I added the dependency as follows:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.liferay.faces.demos</groupId>
        <artifactId>liferay-faces-bridge-demos</artifactId>
        <version>3.1.3-ga4</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>jsf2-cdi-portlet</artifactId>
    <packaging>war</packaging>
    <name>JSF2 CDI Portlet</name>

    <profiles>
        <profile>
            <id>jetty</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld.servlet</groupId>
                    <artifactId>weld-servlet</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>pluto</id>
            <dependencies>
                <dependency>
                    <groupId>com.liferay.faces</groupId>
                    <artifactId>liferay-faces-cdi-compat</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>tomcat</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld.servlet</groupId>
                    <artifactId>weld-servlet</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <properties>
        <webapp.descriptor>web-${app.server.type}.xml</webapp.descriptor>
    </properties>
   
    <build>
        <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
        </dependency>
<!--
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
        </dependency>
-->
        <dependency>
            <groupId>javax.portlet</groupId>
            <artifactId>portlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-el</artifactId>
        </dependency>
        <dependency>
            <groupId>com.liferay.cdi</groupId>
            <artifactId>cdi-portlet-bridge-shared</artifactId>
        </dependency>
        <dependency>
            <groupId>com.liferay.faces</groupId>
            <artifactId>liferay-faces-bridge-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.liferay.faces</groupId>
            <artifactId>liferay-faces-alloy</artifactId>
            <version>${project.version}</version>
        </dependency>

<dependency>
  <groupId>javax.enterprise</groupId>
  <artifactId>cdi-api</artifactId>
  <version>1.0-SP4</version>
</dependency>

    </dependencies>

</project>


But the error, remains

11:19:51,385 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found jsf2-cdi-portlet.war in deployment directory. To trigger deployment create a file called jsf2-cdi-portlet.war.dodeploy
11:19:51,390 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "jsf2-cdi-portlet.war" (runtime-name: "jsf2-cdi-portlet.war")
11:19:51,694 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
11:19:51,865 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
11:19:51,927 INFO  [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900 1.1.10 (Final)
11:19:51,959 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
11:19:52,141 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-8) WELD-000119 Not generating any bean definitions from com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil because of underlying class loading error
11:19:52,142 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-8) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil
    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:116) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:135) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:63) [jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_40]
    at java.lang.Class.privateGetDeclaredFields(Class.java:2387) [rt.jar:1.7.0_40]
    at java.lang.Class.getDeclaredFields(Class.java:1796) [rt.jar:1.7.0_40]
    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:105) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:155) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:121) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:358)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
    at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
    at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:396)
    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    ... 11 more
Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
    ... 29 more

11:19:52,231 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.interceptor.AroundInvoke' not found, interception based on it is not enabled
11:19:52,233 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.interceptor.AroundTimeout' not found, interception based on it is not enabled
11:19:52,233 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.annotation.PostConstruct' not found, interception based on it is not enabled
11:19:52,233 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.annotation.PreDestroy' not found, interception based on it is not enabled
11:19:52,233 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
11:19:52,233 WARN  [org.jboss.weld.interceptor.util.InterceptionTypeRegistry] (MSC service thread 1-8) Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
11:19:52,411 INFO  [org.jboss.web] (ServerService Thread Pool -- 86) JBAS018210: Register web context: /jsf2-cdi-portlet
11:19:52,653 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 86) Initializing Spring root WebApplicationContext
11:19:52,737 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 86) JBWEB000287: Exception sending context initialized event to listener instance of class com.liferay.cdi.portlet.bridge.CDIContextListener: java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/BeanManager
    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:45) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.spi.BeanManager from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
    ... 12 more

11:19:52,742 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 86) Initializing Mojarra 2.1.21 ( 20130409-1421 https://svn.java.net/svn/mojarra~svn/tags/2.1.21@11854) for context '/jsf2-cdi-portlet'
11:19:52,867 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 86) Monitoring jndi:/default-host/jsf2-cdi-portlet/WEB-INF/faces-config.xml for modifications
11:19:52,868 INFO  [javax.enterprise.resource.webcontainer.jsf.lifecycle] (ServerService Thread Pool -- 86) JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
11:19:52,870 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 86) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
11:19:52,881 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 86) Closing Spring root WebApplicationContext
11:19:52,893 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 86) MSC000001: Failed to start service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
    ... 6 more

11:19:53,113 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "jsf2-cdi-portlet.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./jsf2-cdi-portlet" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./jsf2-cdi-portlet: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
11:19:53,138 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
11:19:53,175 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment jsf2-cdi-portlet.war (runtime-name: jsf2-cdi-portlet.war) in 63ms
Vernon Singleton, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Expert Posts: 315 Join Date: 1/14/13 Recent Posts
Which Liferay-JBoss bundle are you runnning?
liferay-portal-jboss-6.1.2-ce-ga3-20130816114619181.zip ???

Or ... which one?
Vernon Singleton, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Expert Posts: 315 Join Date: 1/14/13 Recent Posts
J Viso:
* JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)
* liferay-portal-6.1.2-ce-ga3


Oh I see you are running JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) ... maybe there is some issue with that version of JBoss ...
How did you go about installing Liferay on that version of JBoss?
Neil Griffin, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
The ClassNotFoundException indicates that the CDI API is not being added to the classpath at runtime. You might be missing the src/main/webapp/WEB-INF/jboss-deployment-structure.xml descriptor.

For CDI 1.0, it is necessary to have a src/main/webapp/WEB-INF/beans.xml file in order for a Java EE application server (like JBoss AS) to activate the CDI implementation (in this case, JBoss Weld).
J Viso, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

New Member Posts: 15 Join Date: 9/26/13 Recent Posts
IT WORKS! Finally!
Thanks a lot Neil you made my day!

I was preparing the explanation for Vernon about how I installed Liferay+JBoss when I saw your message.
The WAR already had the beans.xml, but not jboss-deployment-structure.xml, so I added, and finally deployed correctly.

I didn't know, about this file. Sorry if it's detailed in the documentation but I didn't see any mention about it.
If it's explained in the documentation, I'll appreciate the link.

Thanks again to everybody.
Neil Griffin, modified 4 Years ago.

RE: Problem with Liferay Faces CDI on JBoss 7.1

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
So glad to hear that it is working for you. It turns out that we had an omission in our Developing JSF Portlets with CDI wiki article. We just added a section titled CDI Configuration that discusses the need for WEB-INF/beans.xml and WEB-INF/jboss-deployment-structure.xml -- very sorry about that omission. Thanks for helping us to make the documentation better! emoticon