Rodrigo_Sasaki 23 de abr. de 2013
Até onde eu sei não é possível no 7.1, acho que será no 7.2.
Veja alguns links falando sobre isso:
https://community.jboss.org/message/776527?_sscc=t
https://community.jboss.org/thread/203257
java, jsf, jboss7.x
lsjunior 23 de abr. de 2013
Não entendi bem o que vc quer.
1 - Se quiser utilizar a lib do seu war e ignorar a do container basta configurar a exclusão do módulo no jboss-deployment-structure.xml.
2 - Se quiser alterar a implementação do JSF usada no seu servidor basta modificar os módulos javax.faces.api e com.sun.jsf-impl.
https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
efcjunior 23 de abr. de 2013
lsjunior:
Não entendi bem o que vc quer.
1 - Se quiser utilizar a lib do seu war e ignorar a do container basta configurar a exclusão do módulo no jboss-deployment-structure.xml.
2 - Se quiser alterar a implementação do JSF usada no seu servidor basta modificar os módulos javax.faces.api e com.sun.jsf-impl.
https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
Amigo é exatamente a primeira opção porque a segunda eu já faço normalmente. Você tem algum tutorial de como faria por meio desse arquivo xml ?
lsjunior 23 de abr. de 2013
Deve ser mais ou menos assim(WEB-INF/jboss-deployment-structure.xml):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<exclusions>
<module name="com.sun.jsf-impl" slot="main" />
<module name="javax.faces.api" slot="main" />
</exclusions>
</deployment>
</jboss-deployment-structure>
efcjunior 24 de abr. de 2013
lsjunior:
Deve ser mais ou menos assim(WEB-INF/jboss-deployment-structure.xml):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<exclusions>
<module name="com.sun.jsf-impl" slot="main" />
<module name="javax.faces.api" slot="main" />
</exclusions>
</deployment>
</jboss-deployment-structure>
adicionando esse arquivo, ocorreu esse erro:
10 : 50 : 46 , 376 SEVERE [ javax . enterprise . resource . webcontainer . jsf . config ] ( MSC service thread 1 - 4 ) Critical error during deployment : : com . sun . faces . config . ConfigurationException : CONFIGURATION FAILED ! Class org . jboss . as . web . deployment . jsf . JandexAnnotationProvider is not an instance of com . sun . faces . spi . AnnotationProvider
at com . sun . faces . config . ConfigManager . initialize ( ConfigManager . java : 376 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
at com . sun . faces . config . ConfigureListener . contextInitialized ( ConfigureListener . java : 216 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
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 _21 ]
at java . util . concurrent . ThreadPoolExecutor $Worker . run ( ThreadPoolExecutor . java : 615 ) [ rt . jar : 1.7 . 0 _21 ]
at java . lang . Thread . run ( Thread . java : 722 ) [ rt . jar : 1.7 . 0 _21 ]
Caused by : javax . faces . FacesException : Class org . jboss . as . web . deployment . jsf . JandexAnnotationProvider is not an instance of com . sun . faces . spi . AnnotationProvider
at com . sun . faces . spi . AnnotationProviderFactory . createAnnotationProvider ( AnnotationProviderFactory . java : 78 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
at com . sun . faces . config . ConfigManager $AnnotationScanTask .( ConfigManager . java : 805 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
at com . sun . faces . config . ConfigManager . initialize ( ConfigManager . java : 349 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
… 9 more
10:50:46,392 ERROR [org.apache.catalina.core.ContainerBase.[<a href= "http://jboss.web" > jboss.web</a> ].[default-host].[/sipti]] (MSC service thread 1-4) 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! Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:276) [jsf-impl-2.1.18.jar:2.1.18]
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_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.18.jar:2.1.18]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.18.jar:2.1.18]
… 8 more
Caused by: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.spi.AnnotationProviderFactory.createAnnotationProvider(AnnotationProviderFactory.java:78) [jsf-impl-2.1.18.jar:2.1.18]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.(ConfigManager.java:805) [jsf-impl-2.1.18.jar:2.1.18]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:349) [jsf-impl-2.1.18.jar:2.1.18]
… 9 more
10 : 50 : 46 , 392 ERROR [ org . apache . catalina . core . StandardContext ] ( MSC service thread 1 - 4 ) Error listenerStart
10 : 50 : 46 , 407 ERROR [ org . apache . catalina . core . StandardContext ] ( MSC service thread 1 - 4 ) Context [/ sipti ] startup failed due to previous errors
10 : 50 : 46 , 407 SEVERE [ javax . faces ] ( MSC service thread 1 - 4 ) O aplicativo não foi iniciado corretamente na inicialização . Não foi possível encontrar Fábrica : javax . faces . application . ApplicationFactory . Attempting to find backup .
10 : 50 : 46 , 407 SEVERE [ javax . enterprise . resource . webcontainer . jsf . config ] ( MSC service thread 1 - 4 ) 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 . 18 . jar : 2.1 ]
at javax . faces . FactoryFinder . getFactory ( FactoryFinder . java : 342 ) [ jsf - api - 2.1 . 18 . jar : 2.1 ]
at com . sun . faces . config . InitFacesContext . getApplication ( InitFacesContext . java : 141 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
at com . sun . faces . config . ConfigureListener . contextDestroyed ( ConfigureListener . java : 314 ) [ jsf - impl - 2.1 . 18 . jar : 2.1 . 18 ]
at org . apache . catalina . core . StandardContext . listenerStop ( StandardContext . java : 3489 ) [ jbossweb - 7.0 . 13 . Final . jar :]
at org . apache . catalina . core . StandardContext . stop ( StandardContext . java : 3999 ) [ jbossweb - 7.0 . 13 . Final . jar :]
at org . apache . catalina . core . StandardContext . start ( StandardContext . java : 3917 ) [ 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 _21 ]
at java . util . concurrent . ThreadPoolExecutor $Worker . run ( ThreadPoolExecutor . java : 615 ) [ rt . jar : 1.7 . 0 _21 ]
at java . lang . Thread . run ( Thread . java : 722 ) [ rt . jar : 1.7 . 0 _21 ]
10:50:46,407 INFO [org.apache.catalina.core.ContainerBase.[jboss.web ].[default-host].[/sipti]] (MSC service thread 1-4) Closing Spring root WebApplicationContext
10:50:46,407 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-4) Closing Root WebApplicationContext: startup date [Wed Apr 24 10:50:41 BRT 2013]; root of context hierarchy
10:50:46,423 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-4) Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@cf448e: defining beans [dataSource,sessionFactory,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.core.session.SessionRegistryImpl#0,org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,contextSource,ldapActiveDirectoryAuthProvider,sessionRegistry,messageSource]; root of factory hierarchy
10:50:46,423 INFO [org.springframework.orm.hibernate3.LocalSessionFactoryBean] (MSC service thread 1-4) Closing Hibernate SessionFactory
10:50:46,423 INFO [org.hibernate.impl.SessionFactoryImpl] (MSC service thread 1-4) closing
10:50:46,454 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.web.deployment.default-host./sipti: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sipti: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
10:50:46,454 INFO [<a href= "http://org.jboss.as" > org.jboss.as</a> ] (MSC service thread 1-3) JBAS015951: Admin console listening on <a href= "http://127.0.0.1:9990" > http://127.0.0.1:9990</a>
10:50:46,454 ERROR [<a href= "http://org.jboss.as" > org.jboss.as</a> ] (MSC service thread 1-3) JBAS015875: JBoss AS 7.1.1.Final “Brontes” started (with errors) in 38890ms - Started 744 of 824 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
10:50:46,673 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment “sipti.war” was rolled back with failure message {“JBAS014671: Failed services” => {“jboss.web.deployment.default-host./sipti” => “org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sipti: JBAS018040: Failed to start context”}}
10:50:46,829 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment sipti.war in 162ms
10:50:46,829 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./sipti: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sipti: JBAS018040: Failed to start context