0

I am working on a maven project using wildfly 8.2.0, the CDI isn't working, I always get NullPointerException when using injection. I put the code below in the order it is called. The code start on method deleteEvent:

Edit: I clean the commented codes, now I am getting this exception stack trace:

18:04:13,074 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
18:04:13,604 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
18:04:13,792 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
18:04:17,848 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment brasilmaistiws.war
18:04:17,881 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found brasilmaistiws.war in deployment directory. To trigger deployment create a file called brasilmaistiws.war.dodeploy
18:04:17,896 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
18:04:17,927 INFO  [org.xnio] (MSC service thread 1-3) XNIO version 3.3.0.Final
18:04:17,943 INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.3.0.Final
18:04:18,052 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
18:04:18,021 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
18:04:18,021 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
18:04:18,068 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
18:04:18,037 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
18:04:18,208 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.0.Final starting
18:04:18,302 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
18:04:18,520 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 4 core threads with 32 task threads based on your 2 available processors
18:04:18,598 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017502: Undertow 1.1.0.Final starting
18:04:18,723 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 4.0.6.Final
18:04:18,863 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
18:04:18,942 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
18:04:19,083 INFO  [org.jboss.as.security] (MSC service thread 1-1) JBAS013170: Current PicketBox version=4.0.21.Final
18:04:19,083 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
18:04:19,098 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
18:04:19,098 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
18:04:19,161 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 42.1)
18:04:19,208 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path C:\wildfly-8.2.0.Final/welcome-content
18:04:19,488 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2
18:04:19,847 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010417: Started Driver service with driver-name = mysql
18:04:19,863 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010417: Started Driver service with driver-name = postgresql
18:04:19,956 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017525: Started server default-server.
18:04:19,972 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017531: Host default-host starting
18:04:20,020 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory C:\wildfly-8.2.0.Final\standalone\deployments
18:04:20,020 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "brasilmaistiws.war" (runtime-name: "brasilmaistiws.war")
18:04:20,379 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017519: Undertow HTTP listener default listening on localhost/127.0.0.1:8080
18:04:21,408 INFO  [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
18:04:24,492 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/CursoNeri]
18:04:24,492 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/PortalBrasilMaisTIWeb]
18:04:24,492 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
18:04:24,492 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/CursoNeri2]
18:04:25,179 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry jaxb-api-2.2.12-b140109.1041.jar in /C:/wildfly-8.2.0.Final/standalone/deployments/brasilmaistiws.war/WEB-INF/lib/jaxb-core-2.2.10-b140310.1920.jar  does not point to a valid jar for a Class-Path reference.
18:04:25,179 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry istack-commons-runtime-2.19.jar in /C:/wildfly-8.2.0.Final/standalone/deployments/brasilmaistiws.war/WEB-INF/lib/jaxb-core-2.2.10-b140310.1920.jar  does not point to a valid jar for a Class-Path reference.
18:04:25,179 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry txw2-2.2.10-b140310.1920.jar in /C:/wildfly-8.2.0.Final/standalone/deployments/brasilmaistiws.war/WEB-INF/lib/jaxb-core-2.2.10-b140310.1920.jar  does not point to a valid jar for a Class-Path reference.
18:04:25,195 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry jaxb-core.jar in /C:/wildfly-8.2.0.Final/standalone/deployments/brasilmaistiws.war/WEB-INF/lib/jaxb-impl-2.2.10-b140310.1920.jar  does not point to a valid jar for a Class-Path reference.
18:04:25,522 WARN  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016011: Warning while parsing vfs:/C:/wildfly-8.2.0.Final/standalone/deployments/brasilmaistiws.war/WEB-INF/beans.xml:4 cvc-complex-type.3.2.2: O atributo 'bean-discovery-mode' não pode aparecer no elemento 'beans'.
18:04:25,553 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for PortalBrasilMaisTIWebPersistenceUnit
18:04:25,926 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 50) JBAS011409: Starting Persistence Unit (phase 1 of 2) Service 'brasilmaistiws.war#PortalBrasilMaisTIWebPersistenceUnit'
18:04:25,942 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 50) HHH000204: Processing PersistenceUnitInfo [
    name: PortalBrasilMaisTIWebPersistenceUnit
    ...]
18:04:26,051 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 50) HHH000412: Hibernate Core {4.3.7.Final}
18:04:26,051 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 50) HHH000206: hibernate.properties not found
18:04:26,051 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 50) HHH000021: Bytecode provider name : javassist
18:04:26,269 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."brasilmaistiws.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."brasilmaistiws.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "brasilmaistiws.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class org.apache.cxf.transport.servlet.CXFServlet with ClassLoader ModuleClassLoader for Module "deployment.brasilmaistiws.war:main" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:107)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:92)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    ... 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/web/context/support/XmlWebApplicationContext;
    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.8.0_40]
    at java.lang.Class.privateGetDeclaredFields(Class.java:2583) [rt.jar:1.8.0_40]
    at java.lang.Class.getDeclaredFields(Class.java:1916) [rt.jar:1.8.0_40]
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    ... 10 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.support.XmlWebApplicationContext from [Module "deployment.brasilmaistiws.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
    ... 15 more

18:04:26,285 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "brasilmaistiws.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"brasilmaistiws.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"brasilmaistiws.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"brasilmaistiws.war\"
    Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class org.apache.cxf.transport.servlet.CXFServlet with ClassLoader ModuleClassLoader for Module \"deployment.brasilmaistiws.war:main\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/web/context/support/XmlWebApplicationContext;
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.support.XmlWebApplicationContext from [Module \"deployment.brasilmaistiws.war:main\" from Service Module Loader]"}}
18:04:26,441 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "brasilmaistiws.war" (runtime-name : "brasilmaistiws.war")
18:04:26,441 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."brasilmaistiws.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."brasilmaistiws.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "brasilmaistiws.war"

18:04:26,706 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 12) JBAS011410: Stopping Persistence Unit (phase 1 of 2) Service 'brasilmaistiws.war#PortalBrasilMaisTIWebPersistenceUnit'
18:04:27,004 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment brasilmaistiws.war (runtime-name: brasilmaistiws.war) in 294ms
18:04:27,004 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
18:04:27,004 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
18:04:27,004 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 14429ms - Started 201 of 251 services (82 services are lazy, passive or on-demand)
18:04:27,206 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "brasilmaistiws.war" (runtime-name: "brasilmaistiws.war")
18:04:27,206 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."brasilmaistiws.war".POST_MODULE

18:04:31,512 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found brasilmaistiws.war in deployment directory. To trigger deployment create a file called brasilmaistiws.war.dodeploy

BrasilMaisTIWSImpl.java:

public class BrasilMaisTIWSImpl implements BrasilMaisTIPortType {

private EventoServiceImplem eventoServiceImplem;

public BrasilMaisTIWSImpl() {
    init();
}

public void init() {
    System.out.println("init() do brasilmaistiws");

    eventoServiceImplem = new EventoServiceImplem();
}

@Override
public DeleteEventResponse deleteEvent(DeleteEventRequest parameters) {
    System.out.println("Server BrasilMaisTI - Solicitado a remoção do evento: " + parameters.getId());
    DeleteEventResponse deleteEventResponse = new DeleteEventResponse();

    EventoModel eventoModel = new EventoModel();
    eventoModel.setCodigo(parameters.getId().intValue());
    eventoServiceImplem.excluir(eventoModel);

    deleteEventResponse.setResult(true);

    return deleteEventResponse;
}}

Here i got NullPointerException in eventoDaoInterface variable. I also tried @Inject. If i instantiate the eventoDaoInterface in the constructor I got NullPointerException in entityManager variable in EventoDaoImplem.java class.

EventoServiceImplem.java:

public class EventoServiceImplem implements EventoServiceInterface {

@EJB
private EventoDaoImplem eventoDaoInterface;

@Override
public void excluir(EventoModel eventoModel) {
    eventoDaoInterface.excluir(eventoModel);
}}

EventoDaoImplem.java:

@Named @RequestScoped public class EventoDaoImplem implements EventoDaoInterface {  

@Inject
private EntityManager entityManager;

@Override
public void excluir(EventoModel eventoModel) {      
     EventoModel eventoModelMerge = entityManager.merge(eventoModel);
     entityManager.remove(eventoModelMerge);
}}    

EntityManagerProducer.java:

@ApplicationScoped public class EntityManagerProducer implements Serializable {

private static final long serialVersionUID = 1L;
private static EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("PortalBrasilMaisTIWebPersistenceUnit");

@Produces 
@RequestScoped
public EntityManager createEntityManager() {
    System.out.println("Solicitou criação");
    return emf.createEntityManager();
}

public void close(@Disposes EntityManager em) {
    if (em.isOpen()) {
        em.close();
    }
}

public EntityManagerFactory getEmf() {
    return emf;
}

public void setEmf(EntityManagerFactory emf) {
    this.emf = emf;
}}

pom.xml:

<dependencies>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <!-- Jetty is needed if you're are not using the CXFServlet -->
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http-jetty</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-ws-security</artifactId>
        <version>3.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>3.0.2</version>
    </dependency>

    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>

    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.2.8.Final</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.27</version>
    </dependency>

    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>javax.transaction-api</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>javax.ejb</groupId>
        <artifactId>javax.ejb-api</artifactId>
        <version>3.2</version>
    </dependency>


</dependencies>

persistence.xml:

<persistence-unit name="PortalBrasilMaisTIWebPersistenceUnit">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/PortalBrasilMaisTIWeb</jta-data-source>
    <class>br.com.portal.model.model.EventoModel</class>
    <class>br.com.portal.model.model.GrupoModel</class>
    <properties>            
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.hbm2ddl.auto" value="update" />
    </properties>
</persistence-unit>
M. A. S.
  • 1
  • 1
  • Why do you have this? `//@Inject private EventoServiceImplem eventoServiceImplem;` – chrylis -cautiouslyoptimistic- Oct 25 '17 at 02:52
  • Uncomment `@Inject`s, run and provide the exception stack trace, please. – pirho Oct 25 '17 at 03:23
  • @chrylis Those I put on my testings but none works, I tought that it would not be compiled so I commented, but the error change now that I remove that. – M. A. S. Oct 25 '17 at 20:43
  • @pirho I edit my post with that. – M. A. S. Oct 25 '17 at 20:44
  • See [this Q&A](https://stackoverflow.com/questions/19896870/why-is-my-spring-autowired-field-null), which is written about the Spring container but applies here (CDI is a copy of Spring). – chrylis -cautiouslyoptimistic- Oct 25 '17 at 21:02
  • You should continue your researc with this root cause: `java.lang.ClassNotFoundException: org.springframework.web.context.support.XmlWebApplicationContext`. SO contian quite many questions related. – pirho Oct 25 '17 at 21:29
  • @pirho The question that is more like my problem is this one https://stackoverflow.com/questions/15105559/cxf-2-7-3-give-error-with-spring-3-2-1-release-possible-conflict-with-libraries but none suggestion worked. I also tried to remove and add Maven Dependencies. – M. A. S. Oct 26 '17 at 00:00
  • By using "new EventoServiceImplem()" you leave CDI control. Injection will not work on anything you instantiated via new or its derivates. Look at the accepted answer in https://stackoverflow.com/questions/46761010/cdi-produce-method-ignored – mtj Oct 26 '17 at 06:22
  • @mtj Thanks for your reply, I saw that before and already tried add `@Inject` and `@EJB` like this `@Inject private EventoServiceImplem eventoServiceImplem;` and remove the line `eventoServiceImplem = new EventoServiceImplem();`, now I tried again and I always get NullPointerExeception in eventoServiceImplem. – M. A. S. Oct 26 '17 at 20:35

0 Answers0