组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月24日 上午7:04
RE: Problem with Liferay Faces CDI on JBoss 7.1 Juan Gonzalez 2013年9月24日 上午7:00
RE: Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月24日 上午7:10
RE: Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月30日 上午7:32
RE: Problem with Liferay Faces CDI on JBoss 7.1 Vernon Singleton 2013年9月26日 上午5:41
RE: Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月26日 上午6:43
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年9月26日 上午9:30
RE: Problem with Liferay Faces CDI on JBoss 7.1 Juan Gonzalez 2013年9月26日 上午10:30
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年9月27日 上午1:06
RE: Problem with Liferay Faces CDI on JBoss 7.1 Juan Gonzalez 2013年9月27日 上午1:19
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年9月27日 上午1:46
RE: Problem with Liferay Faces CDI on JBoss 7.1 Neil Griffin 2013年9月27日 下午2:00
RE: Problem with Liferay Faces CDI on JBoss 7.1 Neil Griffin 2013年9月27日 下午2:01
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年9月30日 上午3:57
RE: Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月30日 上午7:26
RE: Problem with Liferay Faces CDI on JBoss 7.1 Florian Huber 2013年9月30日 上午7:31
RE: Problem with Liferay Faces CDI on JBoss 7.1 Vernon Singleton 2013年9月30日 上午7:34
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年9月30日 上午8:12
RE: Problem with Liferay Faces CDI on JBoss 7.1 Vernon Singleton 2013年9月30日 下午12:26
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年10月1日 上午1:30
RE: Problem with Liferay Faces CDI on JBoss 7.1 Juan Gonzalez 2013年10月1日 上午3:31
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年10月1日 上午4:26
RE: Problem with Liferay Faces CDI on JBoss 7.1 Vernon Singleton 2013年10月1日 上午5:18
RE: Problem with Liferay Faces CDI on JBoss 7.1 Vernon Singleton 2013年10月1日 上午5:21
RE: Problem with Liferay Faces CDI on JBoss 7.1 Neil Griffin 2013年10月1日 上午8:19
RE: Problem with Liferay Faces CDI on JBoss 7.1 J Viso 2013年10月1日 上午9:29
RE: Problem with Liferay Faces CDI on JBoss 7.1 Neil Griffin 2013年10月1日 上午11:53
Florian Huber
Problem with Liferay Faces CDI on JBoss 7.1
2013年9月24日 上午7:04
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

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:

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


 1
 213: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
 313:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
 413:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:40)
 513:51:50,017 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:195)
 6...
 713:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
 813:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
 913:51:50,021 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:151)
1013:51:50,022 INFO  [stdout] (MSC service thread 1-4)     at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
11...
1213:51:50,023 INFO  [stdout] (MSC service thread 1-4)     at java.lang.Thread.run(Thread.java:724)
1313:51:50,023 INFO  [stdout] (MSC service thread 1-4) Caused by: java.lang.reflect.InvocationTargetException
14...
1513:51:50,025 INFO  [stdout] (MSC service thread 1-4)     ... 26 more
1613: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
1713:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:57)
1813:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.instantiatingListener(SecurePluginContextListener.java:347)
1913:51:50,025 INFO  [stdout] (MSC service thread 1-4)     at com.liferay.portal.kernel.servlet.SecurePluginContextListener.instantiatingListeners(SecurePluginContextListener.java:163)
2013:51:50,026 INFO  [stdout] (MSC service thread 1-4)     ... 32 more
2113: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
2213: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
2313: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
2413: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)
2513: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
2613: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
27    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:57) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
28    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
29    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
30    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
31    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
32    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
33    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
34    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
35    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
36[ICEFACES STARTUP]
3713: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.
3813:51:50,550 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Error listenerStart
3913:51:50,551 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/weblib-search-portlet] startup failed due to previous errors
4013: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.
4113: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.
42    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
43    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
44    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]
45    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]
46...


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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月24日 上午7:00
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2106

加入日期: 2008年10月28日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月24日 上午7:10
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

wohaa that was fast ;)

i just take a look, there is weld-core1.1.5-AS71.Final.jar in the liferay bundle
Florian Huber
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午7:32
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

So after update to 1.1.14.Final I still get this error:

http://nopaste.info/408f29aaf4.html
Vernon Singleton
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月26日 上午5:41
答复

Vernon Singleton

LIFERAY STAFF

等级: Regular Member

帖子: 215

加入日期: 2013年1月14日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月26日 上午6:43
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

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:

 1
 213: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")
 313:33:54,968 INFO  [org.jboss.weld.deployer] (MSC service thread 1-11) JBAS016002: Bearbeite Weld-Deployment jsf2-cdi-portlet.war
 413:33:55,080 INFO  [org.jboss.weld.deployer] (MSC service thread 1-13) JBAS016005: Starte Dienste für CDI-Deployment: jsf2-cdi-portlet.war
 513:33:55,130 INFO  [org.jboss.weld.Version] (MSC service thread 1-13) WELD-000900 1.1.14 (Final)
 613:33:55,158 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starte Weld-Dienst für Deployment jsf2-cdi-portlet.war
 713: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
 813: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
 913:33:55,557 INFO  [org.jboss.web] (ServerService Thread Pool -- 5) JBAS018210: Registrierung von Webkontext: /jsf2-cdi-portlet
1013:33:55,681 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 5) Initializing Spring root WebApplicationContext
1113: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.
1213: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
1313: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.
1413:33:56,112 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: "jsf2-cdi-portlet.war" deployed (runtime-name: "jsf2-cdi-portlet.war")
1513: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()
16    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)]
17    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)]
18    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)]
19    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)]
20    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328) [portlet.jar:]
21    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)]
22    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233) [portlet.jar:]


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

 112: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
 2    at com.liferay.cdi.portlet.bridge.CDIBeanManagerUtil.getManagedBeanReference(CDIBeanManagerUtil.java:34) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
 3    at com.liferay.cdi.portlet.bridge.CDICrossContextFilter.doFilter(CDICrossContextFilter.java:41) [cdi-portlet-bridge-shared-6.2.0.1.jar:]
 4    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207) [portal-service.jar:]
 5    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) [portal-service.jar:]
 6    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:79) [portal-service.jar:]
 7    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 8    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 9    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
10    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
11    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
12    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:602)
13    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:675)
14    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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月26日 上午9:30
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月26日 上午10:30
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2106

加入日期: 2008年10月28日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月27日 上午1:06
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月27日 上午1:19
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2106

加入日期: 2008年10月28日

最近的帖子

Can you send your portlet/pom.xml?

Thanks
J Viso
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月27日 上午1:46
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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.
附件: pom.xml (2.7k)
Neil Griffin
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月27日 下午2:00
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2215

加入日期: 2005年7月26日

最近的帖子

Please try cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar (41.8k) which is attached to this other forum post.
Neil Griffin
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月27日 下午2:01
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2215

加入日期: 2005年7月26日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午3:57
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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
附件: jsf2-cdi-portlet-3.1.3-ga4_MODIF.war (2,933.5k)
Florian Huber
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午7:26
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午7:31
答复

Florian Huber

等级: Junior Member

帖子: 29

加入日期: 2011年3月23日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午7:34
答复

Vernon Singleton

LIFERAY STAFF

等级: Regular Member

帖子: 215

加入日期: 2013年1月14日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 上午8:12
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

Following Florian instructions, I'm still unable to deploy it:

  115: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
  215: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")
  315: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'
  415: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'
  515:07:41,462 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
  615:07:41,606 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
  715:07:41,642 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900 1.1.10 (Final)
  815:07:41,674 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
  915: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
 1015: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
 1115:07:42,083 INFO  [org.jboss.web] (ServerService Thread Pool -- 98) JBAS018210: Register web context: /jsf2-cdi-portlet
 1215: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
 1315:07:42,335 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) Initializing Spring root WebApplicationContext
 1415: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.
 1515: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
 16    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:48) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
 17    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 18    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 19    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]
 20    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]
 21    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]
 22    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 23    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 24    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 25    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 26    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 27    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 28
 2915: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'
 3015: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
 31    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.21.jar:2.1.21]
 32    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.21.jar:2.1.21]
 33    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 34    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 35    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]
 36    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]
 37    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]
 38    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 39    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 40    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 41    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 42    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 43    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 44Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory
 45    at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 46    at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:1018) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 47    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]
 48    at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 49    at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 50    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 51    at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.21.jar:2.1.21]
 52    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.21.jar:2.1.21]
 53    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
 54    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.21.jar:2.1.21]
 55    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
 56    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.21.jar:2.1.21]
 57    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.21.jar:2.1.21]
 58    ... 12 more
 59
 6015: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
 61    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:276) [jsf-impl-2.1.21.jar:2.1.21]
 62    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 63    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 64    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]
 65    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]
 66    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]
 67    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 68    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 69    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 70    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 71    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 72    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 73Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory
 74    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.21.jar:2.1.21]
 75    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.21.jar:2.1.21]
 76    ... 11 more
 77Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory
 78    at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 79    at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:1018) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 80    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]
 81    at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 82    at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 83    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet-1.1.10.Final.jar:20121012-1000]
 84    at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.21.jar:2.1.21]
 85    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.21.jar:2.1.21]
 86    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
 87    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.21.jar:2.1.21]
 88    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.21.jar:2.1.21]
 89    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.21.jar:2.1.21]
 90    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.21.jar:2.1.21]
 91    ... 12 more
 92
 9315:07:42,598 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 98) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
 9415: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.
 9515: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.
 96    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jsf-api-2.1.21.jar:2.1]
 97    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jsf-api-2.1.21.jar:2.1]
 98    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:141) [jsf-impl-2.1.21.jar:2.1.21]
 99    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:314) [jsf-impl-2.1.21.jar:2.1.21]
100    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3427) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
101    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
102    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3839) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
103    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]
104    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]
105    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]
106    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
107    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
108    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
109    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
110    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
111    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
112
11315:07:42,609 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 98) Closing Spring root WebApplicationContext
11415: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
115    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
116    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
117    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
118    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
119    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
120    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
121    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
122Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
123    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
124    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
125    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
126    ... 6 more
127
12815: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:
129{"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
130    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
13115:07:42,863 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
13215: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.
133    at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:76)
134    at org.jboss.weld.Container.instance(Container.java:54)
135    at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:466)
136    at org.jboss.as.weld.WeldBootstrapService.stop(WeldBootstrapService.java:128)
137    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]
138    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]
139    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
140    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
141    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
142
14315: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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年9月30日 下午12:26
答复

Vernon Singleton

LIFERAY STAFF

等级: Regular Member

帖子: 215

加入日期: 2013年1月14日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午1:30
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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:

  108: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
  208: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")
  308:19:14,926 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
  408:19:15,154 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
  508:19:15,222 INFO  [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900 1.1.10 (Final)
  608:19:15,306 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
  708: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
  808: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
  9    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 10    at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:116) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 11    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 12    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:135) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 13    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 14    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 15    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]
 16    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
 17    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
 18    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 19    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 20    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 21Caused by: java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
 22    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_40]
 23    at java.lang.Class.privateGetDeclaredFields(Class.java:2387) [rt.jar:1.7.0_40]
 24    at java.lang.Class.getDeclaredFields(Class.java:1796) [rt.jar:1.7.0_40]
 25    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:105) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 26    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 27    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 28    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 29    at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 30    at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:155) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 31    at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:121) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 32    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 33    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 34    at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:358)
 35    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
 36    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
 37    at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
 38    at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:396)
 39    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 40    ... 11 more
 41Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
 42    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
 43    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
 44    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
 45    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
 46    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
 47    ... 29 more
 48
 4908: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
 5008: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
 5108: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
 5208: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
 5308: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
 5408: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
 5508:19:15,693 INFO  [org.jboss.web] (ServerService Thread Pool -- 88) JBAS018210: Register web context: /jsf2-cdi-portlet
 5608:19:15,966 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 88) Initializing Spring root WebApplicationContext
 5708: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
 58    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:45) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
 59    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 60    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 61    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]
 62    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]
 63    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]
 64    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 65    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 66    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 67    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 68    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 69    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 70Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.spi.BeanManager from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
 71    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
 72    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
 73    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
 74    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
 75    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
 76    ... 12 more
 77
 7808: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'
 7908: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
 8008: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.
 8108:19:16,242 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 88) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
 8208:19:16,256 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 88) Closing Spring root WebApplicationContext
 8308: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
 84    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
 85    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 86    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 87    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 88    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 89    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 90    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 91Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
 92    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
 93    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
 94    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
 95    ... 6 more
 96
 9708: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:
 98{"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
 99    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
10008:19:16,531 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
10108: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
附件

附件: life.png (48.4k)
Juan Gonzalez
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午3:31
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2106

加入日期: 2008年10月28日

最近的帖子

Seems you need javax.enterprise dependency in your pom.xml:

1<dependency>
2            <groupId>javax.enterprise</groupId>
3            <artifactId>cdi-api</artifactId>
4                        <version>1.0-SP4</version>
5        </dependency>
J Viso
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午4:26
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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:

  1<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">
  2
  3    <modelVersion>4.0.0</modelVersion>
  4    <parent>
  5        <groupId>com.liferay.faces.demos</groupId>
  6        <artifactId>liferay-faces-bridge-demos</artifactId>
  7        <version>3.1.3-ga4</version>
  8        <relativePath>../pom.xml</relativePath>
  9    </parent>
 10    <artifactId>jsf2-cdi-portlet</artifactId>
 11    <packaging>war</packaging>
 12    <name>JSF2 CDI Portlet</name>
 13
 14    <profiles>
 15        <profile>
 16            <id>jetty</id>
 17            <dependencies>
 18                <dependency>
 19                    <groupId>org.jboss.weld.servlet</groupId>
 20                    <artifactId>weld-servlet</artifactId>
 21                </dependency>
 22            </dependencies>
 23        </profile>
 24        <profile>
 25            <id>pluto</id>
 26            <dependencies>
 27                <dependency>
 28                    <groupId>com.liferay.faces</groupId>
 29                    <artifactId>liferay-faces-cdi-compat</artifactId>
 30                    <version>${project.version}</version>
 31                </dependency>
 32            </dependencies>
 33        </profile>
 34        <profile>
 35            <id>tomcat</id>
 36            <dependencies>
 37                <dependency>
 38                    <groupId>org.jboss.weld.servlet</groupId>
 39                    <artifactId>weld-servlet</artifactId>
 40                </dependency>
 41            </dependencies>
 42        </profile>
 43    </profiles>
 44
 45    <properties>
 46        <webapp.descriptor>web-${app.server.type}.xml</webapp.descriptor>
 47    </properties>
 48   
 49    <build>
 50        <plugins>
 51                <plugin>
 52                    <groupId>org.apache.maven.plugins</groupId>
 53                    <artifactId>maven-compiler-plugin</artifactId>
 54                    <configuration>
 55                        <source>1.6</source>
 56                        <target>1.6</target>
 57                        <encoding>UTF-8</encoding>
 58                    </configuration>
 59                </plugin>
 60        </plugins>
 61    </build>
 62
 63    <dependencies>
 64        <dependency>
 65            <groupId>commons-fileupload</groupId>
 66            <artifactId>commons-fileupload</artifactId>
 67        </dependency>
 68        <dependency>
 69            <groupId>commons-io</groupId>
 70            <artifactId>commons-io</artifactId>
 71        </dependency>
 72        <dependency>
 73            <groupId>javax.el</groupId>
 74            <artifactId>el-api</artifactId>
 75        </dependency>
 76<!--
 77        <dependency>
 78            <groupId>javax.enterprise</groupId>
 79            <artifactId>cdi-api</artifactId>
 80        </dependency>
 81-->
 82        <dependency>
 83            <groupId>javax.portlet</groupId>
 84            <artifactId>portlet-api</artifactId>
 85        </dependency>
 86        <dependency>
 87            <groupId>org.jboss.seam</groupId>
 88            <artifactId>jboss-el</artifactId>
 89        </dependency>
 90        <dependency>
 91            <groupId>com.liferay.cdi</groupId>
 92            <artifactId>cdi-portlet-bridge-shared</artifactId>
 93        </dependency>
 94        <dependency>
 95            <groupId>com.liferay.faces</groupId>
 96            <artifactId>liferay-faces-bridge-impl</artifactId>
 97            <version>${project.version}</version>
 98        </dependency>
 99        <dependency>
100            <groupId>com.liferay.faces</groupId>
101            <artifactId>liferay-faces-alloy</artifactId>
102            <version>${project.version}</version>
103        </dependency>
104
105<dependency>
106  <groupId>javax.enterprise</groupId>
107  <artifactId>cdi-api</artifactId>
108  <version>1.0-SP4</version>
109</dependency>
110
111    </dependencies>
112
113</project>


But the error, remains

  111: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
  211: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")
  311:19:51,694 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment jsf2-cdi-portlet.war
  411:19:51,865 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: jsf2-cdi-portlet.war
  511:19:51,927 INFO  [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900 1.1.10 (Final)
  611:19:51,959 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment jsf2-cdi-portlet.war
  711: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
  811: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
  9    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 10    at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:116) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 11    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 12    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:135) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 13    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 14    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 15    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]
 16    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
 17    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
 18    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 19    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 20    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 21Caused by: java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
 22    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_40]
 23    at java.lang.Class.privateGetDeclaredFields(Class.java:2387) [rt.jar:1.7.0_40]
 24    at java.lang.Class.getDeclaredFields(Class.java:1796) [rt.jar:1.7.0_40]
 25    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:105) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 26    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 27    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 28    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 29    at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:102) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 30    at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:155) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 31    at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:121) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 32    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 33    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 34    at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:358)
 35    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
 36    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
 37    at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
 38    at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:396)
 39    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
 40    ... 11 more
 41Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
 42    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
 43    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
 44    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
 45    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
 46    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
 47    ... 29 more
 48
 4911: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
 5011: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
 5111: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
 5211: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
 5311: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
 5411: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
 5511:19:52,411 INFO  [org.jboss.web] (ServerService Thread Pool -- 86) JBAS018210: Register web context: /jsf2-cdi-portlet
 5611:19:52,653 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 86) Initializing Spring root WebApplicationContext
 5711: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
 58    at com.liferay.cdi.portlet.bridge.CDIContextListener.contextInitialized(CDIContextListener.java:45) [cdi-portlet-bridge-shared-6.2.0.2-SNAPSHOT.jar:]
 59    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 60    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
 61    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]
 62    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]
 63    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]
 64    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 65    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 66    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 67    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 68    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 69    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 70Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.spi.BeanManager from [Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader]
 71    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
 72    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
 73    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
 74    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
 75    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
 76    ... 12 more
 77
 7811: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'
 7911: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
 8011: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.
 8111:19:52,870 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 86) JBWEB001103: Error detected during context /jsf2-cdi-portlet start, will stop it
 8211:19:52,881 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf2-cdi-portlet]] (ServerService Thread Pool -- 86) Closing Spring root WebApplicationContext
 8311: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
 84    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
 85    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
 86    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
 87    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
 88    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
 89    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
 90    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
 91Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
 92    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
 93    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
 94    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
 95    ... 6 more
 96
 9711: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:
 98{"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
 99    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
10011:19:53,138 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016009: Stopping weld service for deployment jsf2-cdi-portlet.war
10111: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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午5:18
答复

Vernon Singleton

LIFERAY STAFF

等级: Regular Member

帖子: 215

加入日期: 2013年1月14日

最近的帖子

Which Liferay-JBoss bundle are you runnning?
liferay-portal-jboss-6.1.2-ce-ga3-20130816114619181.zip ???

Or ... which one?
Vernon Singleton
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午5:21
答复

Vernon Singleton

LIFERAY STAFF

等级: Regular Member

帖子: 215

加入日期: 2013年1月14日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午8:19
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2215

加入日期: 2005年7月26日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午9:29
答复

J Viso

等级: New Member

帖子: 15

加入日期: 2013年9月26日

最近的帖子

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
RE: Problem with Liferay Faces CDI on JBoss 7.1
2013年10月1日 上午11:53
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2215

加入日期: 2005年7月26日

最近的帖子

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