Boa noite, estou com o seguinte erro no meu projeto! E não to conseguindo entender o motivo dele. criei um projeto maven e depois coloquei ele com jsf e adicionei as seguintes dependencias no porn.
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.bercalini</groupId>
<artifactId>escola</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.8.Final</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.13</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.13</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.22</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld.servlet/weld-servlet -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.3.5.Final</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<finalName>escola</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
</project>
Depois no meu web.xml como estou usando o CDI coloquei.
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>
javax.enterprise.inject.spi.BeanManager
</resource-env-ref-type>
</resource-env-ref>
Depois criei o meu beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.2" bean-discovery-mode="all">
<!-- some content -->
</beans>
e dentro da diretorio webapp criei um META-INF com o context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="BeanManager"
auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory"/>
</Context>
E quando subo o meu projéto o erro.
jan 12, 2017 9:11:22 PM org.apache.catalina.core.AprLifecycleListener init
INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_111/bin/server;C:/Program Files/Java/jre1.8.0_111/bin;C:/Program Files/Java/jre1.8.0_111/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4 & MySQL Utilities 1.5.4 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4 & MySQL Utilities 1.5.4 1.5\Doctrine extensions for PHP\;C:\Users\Alison\Desktop\apache-maven-3.3.9\bin;C:\Users\Alison\AppData\Local\Microsoft\WindowsApps;;C:\Users\Alison\eclipse\jee-neon2\eclipse;;.
jan 12, 2017 9:11:22 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:escola' did not find a matching property.
jan 12, 2017 9:11:22 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-bio-8080"]
jan 12, 2017 9:11:22 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-bio-8009"]
jan 12, 2017 9:11:22 PM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 1005 ms
jan 12, 2017 9:11:22 PM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service Catalina
jan 12, 2017 9:11:22 PM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/7.0.47
jan 12, 2017 9:11:26 PM org.jboss.weld.environment.servlet.EnhancedListener onStartup
INFO: WELD-ENV-001008: Initialize Weld using ServletContainerInitializer
jan 12, 2017 9:11:26 PM org.jboss.weld.bootstrap.WeldStartup <clinit>
INFO: WELD-000900: 2.3.5 (Final)
jan 12, 2017 9:11:26 PM org.jboss.weld.environment.servlet.WeldServletLifecycle initialize
INFO: WELD-ENV-000028: Weld initialization skipped - no bean archive found
jan 12, 2017 9:11:27 PM org.jboss.weld.environment.servlet.Listener contextInitialized
INFO: WELD-ENV-001007: Initialize Weld using ServletContextListener
jan 12, 2017 9:11:27 PM org.jboss.weld.environment.servlet.WeldServletLifecycle initialize
INFO: WELD-ENV-000028: Weld initialization skipped - no bean archive found
jan 12, 2017 9:11:27 PM org.apache.catalina.core.StandardContext listenerStart
GRAVE: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE => []
at org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider$RegistrySingleton.get(RegistrySingletonProvider.java:28)
at org.jboss.weld.Container.instance(Container.java:55)
at org.jboss.weld.SimpleCDI.<init>(SimpleCDI.java:77)
at org.jboss.weld.environment.WeldProvider$EnvironmentCDI.<init>(WeldProvider.java:45)
at org.jboss.weld.environment.WeldProvider.getCDI(WeldProvider.java:61)
at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:94)
at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:122)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
jan 12, 2017 9:11:27 PM com.sun.faces.config.ConfigureListener contextInitialized
INFORMAÇÕES: Inicializando Mojarra 2.2.13 ( 20160203-1910 unable to get svn info) para o contexto '/escola'
jan 12, 2017 9:11:27 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFORMAÇÕES: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
jan 12, 2017 9:11:28 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 4.3.0.Final
jan 12, 2017 9:11:29 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFORMAÇÕES: Running on PrimeFaces 5.3
jan 12, 2017 9:11:29 PM org.apache.catalina.core.StandardContext startInternal
GRAVE: Error listenerStart
jan 12, 2017 9:11:29 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFORMAÇÕES: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [210] milliseconds.
jan 12, 2017 9:11:29 PM org.apache.catalina.core.StandardContext startInternal
GRAVE: Context [/escola] startup failed due to previous errors
jan 12, 2017 9:11:29 PM org.apache.catalina.core.StandardContext listenerStop
GRAVE: Exception sending context destroyed event to listener instance of class org.jboss.weld.environment.servlet.Listener
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldInitialListener.contextDestroyed(WeldInitialListener.java:119)
at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextDestroyed(ForwardingServletListener.java:30)
at org.jboss.weld.environment.servlet.Listener.contextDestroyed(Listener.java:127)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
jan 12, 2017 9:11:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory C:\Users\Alison\Desktop\html\apache-tomcat-7.0.70\webapps\docs
jan 12, 2017 9:11:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory C:\Users\Alison\Desktop\html\apache-tomcat-7.0.70\webapps\examples
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.TaglibUriRule body
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
jan 12, 2017 9:11:30 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: ContextListener: contextInitialized()
jan 12, 2017 9:11:30 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: SessionListener: contextInitialized()
jan 12, 2017 9:11:30 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@23142aa6')
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory C:\Users\Alison\Desktop\html\apache-tomcat-7.0.70\webapps\host-manager
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory C:\Users\Alison\Desktop\html\apache-tomcat-7.0.70\webapps\manager
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory C:\Users\Alison\Desktop\html\apache-tomcat-7.0.70\webapps\ROOT
jan 12, 2017 9:11:30 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-bio-8080"]
jan 12, 2017 9:11:30 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-bio-8009"]
jan 12, 2017 9:11:30 PM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 7737 ms