简体   繁体   中英

Java ee / WildFly - Calling a Bean from Web Module

I'm trying to call a Bean from a Servlet in the EJB module (that I have called 'Core') with the annotation

@EJB
private DoSomethingLocal doSomething;

but I have this result when I try to deploy the EAR

22:44:08,502 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment FeNiX-EAR-1.0-SNAPSHOT.ear
22:44:08,542 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0003: Processing weld deployment FeNiX-WebApp-1.0-SNAPSHOT.war
22:44:08,543 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) WFLYWELD0003: Processing weld deployment FeNiX-Core-1.0-SNAPSHOT.jar
22:44:08,546 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-7) WFLYEJB0473: JNDI bindings for session bean named 'TestBean' in deployment unit 'subdeployment "FeNiX-Core-1.0-SNAPSHOT.jar" of deployment "FeNiX-EAR-1.0-SNAPSHOT.ear"' are as follows:

    java:global/FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/TestBean!fnx_core.entities.TestBean
    java:app/FeNiX-Core-1.0-SNAPSHOT/TestBean!fnx_core.entities.TestBean
    java:module/TestBean!fnx_core.entities.TestBean
    ejb:FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/TestBean!fnx_core.entities.TestBean
    java:global/FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/TestBean
    java:app/FeNiX-Core-1.0-SNAPSHOT/TestBean
    java:module/TestBean

22:44:08,546 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-7) WFLYEJB0473: JNDI bindings for session bean named 'doSomething' in deployment unit 'subdeployment "FeNiX-Core-1.0-SNAPSHOT.jar" of deployment "FeNiX-EAR-1.0-SNAPSHOT.ear"' are as follows:

    java:global/FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/doSomething!fnx_core.entities.DoSomethingLocal
    java:app/FeNiX-Core-1.0-SNAPSHOT/doSomething!fnx_core.entities.DoSomethingLocal
    java:module/doSomething!fnx_core.entities.DoSomethingLocal
    ejb:FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/doSomething!fnx_core.entities.DoSomethingLocal
    java:global/FeNiX-EAR-1.0-SNAPSHOT/FeNiX-Core-1.0-SNAPSHOT/doSomething
    java:app/FeNiX-Core-1.0-SNAPSHOT/doSomething
    java:module/doSomething

22:44:08,603 WARN  [org.jboss.as.ejb3] (MSC service thread 1-3) WFLYEJB0131: EJB fnx_core.entities.doSomething should not have a final or static method (t)
22:44:08,774 INFO  [io.smallrye.metrics] (MSC service thread 1-2) MicroProfile: Metrics activated
22:44:08,971 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 129) WFLYUT0021: Registered web context: '/' for server 'default-server'
22:44:09,396 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "FeNiX-EAR-1.0-SNAPSHOT.ear" with deployment "FeNiX-EAR-1.0-SNAPSHOT.ear"
22:44:09,396 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."FeNiX-WebApp-1.0-SNAPSHOT.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "FeNiX-WebApp-1.0-SNAPSHOT.war"

What should I do to make it works?

The logs say something, the error says shit, so looks like you have a typo I'm your code. So clean and build of all parts of the EAR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM