Skip to content

Instantly share code, notes, and snippets.

@fbricon
Created November 18, 2013 16:59
Show Gist options
  • Save fbricon/7531310 to your computer and use it in GitHub Desktop.
Save fbricon/7531310 to your computer and use it in GitHub Desktop.
WildFly/Weld fail to inject Groovy EJBs
package foo.bar;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
public class CheckInjection {
//Checking injection works with weld-se 2.1.0
public static void main(String[] args) {
Weld weld = new Weld();
WeldContainer container = weld.initialize();
StartupBean bean = container.instance().select(StartupBean.class).get();
weld.shutdown();
}
}
package foo.bar;
import javax.ejb.Stateless;
import javax.inject.Named;
@Stateless
class GroovyThing {
def String hi() {
"hello world"
}
}
package foo.bar;
import javax.annotation.PostConstruct;
import javax.ejb.Startup;
import javax.inject.Inject;
@Startup
public class StartupBean {
@Inject
GroovyThing groovyThing;
@PostConstruct
private void postConstruct() {
System.out.println(groovyThing.hi());
}
}
16:42:08,030 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment groovy-injection.war
16:42:08,202 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.0.1.Final
16:42:08,557 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named GroovyThing in deployment unit deployment "groovy-injection.war" are as follows:
java:global/groovy-injection/GroovyThing!groovy.lang.GroovyObject
java:app/groovy-injection/GroovyThing!groovy.lang.GroovyObject
java:module/GroovyThing!groovy.lang.GroovyObject
java:global/groovy-injection/GroovyThing
java:app/groovy-injection/GroovyThing
java:module/GroovyThing
16:42:09,439 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: groovy-injection.war
16:42:09,568 INFO [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.1.0 (CR1)
16:42:09,631 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment groovy-injection.war
16:42:11,760 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."groovy-injection.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."groovy-injection.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1900) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type GroovyThing with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject foo.bar.StartupBean.groovyThing
at foo.bar.StartupBean.groovyThing(StartupBean.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:361)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:282)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:133)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:507)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
... 3 more
16:42:11,768 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "groovy-injection.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"groovy-injection.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"groovy-injection.war\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type GroovyThing with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject foo.bar.StartupBean.groovyThing
at foo.bar.StartupBean.groovyThing(StartupBean.java:0)
"}}
16:42:11,840 INFO [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "groovy-injection.war" (runtime-name : "groovy-injection.war")
16:42:11,843 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."groovy-injection.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."groovy-injection.war".WeldStartService: Failed to start service
16:42:12,078 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016009: Stopping weld service for deployment groovy-injection.war
16:42:12,127 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment groovy-injection.war (runtime-name: groovy-injection.war) in 55ms
16:42:12,170 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
16:42:12,170 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
16:42:12,171 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Beta1 "WildFly" started in 26228ms - Started 180 of 217 services (62 services are lazy, passive or on-demand)
16:42:12,337 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "groovy-injection.war" (runtime-name: "groovy-injection.war")
16:42:12,343 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.deployment.unit."groovy-injection.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator, service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".WeldInstantiator, service jboss.undertow.deployment.default-host./groovy-injection, JBAS014799: ... and 7 more ]
service jboss.deployment.unit."groovy-injection.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator, service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".WeldInstantiator, service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.WeldInstantiator, JBAS014799: ... and 5 more ]
service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START]
service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.VIEW."groovy.lang.GroovyObject".LOCAL (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START]
service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START]
service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.ejb.non-functional-timerservice (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START]
service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".START]
service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection]
service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".START]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldInitialListener".START]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".CREATE (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".START]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService, service jboss.undertow.deployment.default-host./groovy-injection, service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".START]
service jboss.deployment.unit."groovy-injection.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService]
service jboss.deployment.unit."groovy-injection.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START, service jboss.deployment.unit."groovy-injection.war".component."org.jboss.weld.servlet.WeldTerminalListener".START, service jboss.deployment.unit."groovy-injection.war".component."com.sun.faces.config.ConfigureListener".START, service jboss.deployment.unit."groovy-injection.war".component."javax.faces.webapp.FacetTag".START, JBAS014799: ... and 4 more ]
service jboss.deployment.unit."groovy-injection.war".moduleDeploymentRuntimeInformation (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".component.GroovyThing.START]
service jboss.undertow.deployment.default-host./groovy-injection (missing) dependents: [service jboss.deployment.unit."groovy-injection.war".deploymentCompleteService]
service jboss.undertow.deployment.default-host./groovy-injection.UndertowDeploymentInfoService (missing) dependents: [service jboss.undertow.deployment.default-host./groovy-injection]
JBAS014777: Services which failed to start: service jboss.deployment.unit."groovy-injection.war".WeldStartService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment