I was trying to create a hello world with JNoSQL, Mongo and Wildfly Swarm.
The use #Inject of DocumentCollectionManager is working, but it is not working with a Repository.
This is how I'm injecting:
#Inject
private DocumentCollectionManager entityManager; // works
#Inject
#Database(DatabaseType.DOCUMENT)
private UserRepository userRepository; // do not work!
This is how I configured the producer:
#ApplicationScoped
public class MongoProducer {
private static final String DATABASE = "db";
#Inject
#ConfigurationUnit(name = "document", fileName = "jnosql.yaml")
private DocumentCollectionManagerFactory<MongoDBDocumentCollectionManager> entityManager;
#Produces
#Database(DatabaseType.DOCUMENT)
public DocumentCollectionManager getManager() {
return entityManager.get(DATABASE);
}
}
What can I do to automatic inject Repositories in my Wildfly Swarm application?
The throwed error:
2018-05-23 11:30:31,270 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."demo.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."demo.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1978)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type UserRepository with qualifiers #Database
at injection point [BackedAnnotatedField] #Inject #Database private com.example.demo.rest.HelloWorldEndpoint.userRepository
at com.example.demo.rest.HelloWorldEndpoint.userRepository(HelloWorldEndpoint.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:362)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:137)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:158)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:501)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:61)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:59)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
2018-05-23 11:30:31,278 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "demo.war")) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"demo.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type UserRepository with qualifiers #Database
at injection point [BackedAnnotatedField] #Inject #Database private com.example.demo.rest.HelloWorldEndpoint.userRepository
at com.example.demo.rest.HelloWorldEndpoint.userRepository(HelloWorldEndpoint.java:0)
"}}
2018-05-23 11:30:31,279 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "demo.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"demo.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type UserRepository with qualifiers #Database
at injection point [BackedAnnotatedField] #Inject #Database private com.example.demo.rest.HelloWorldEndpoint.userRepository
at com.example.demo.rest.HelloWorldEndpoint.userRepository(HelloWorldEndpoint.java:0)
"}}
how is going?
There're same bugs in your code:
The interface needs to be found by CDI, so I created a bean.xml to enable a full
scan in your code. On the MongoProducer you
don't need the: #Database(DatabaseType.DOCUMENT)
I created a PR:
https://github.com/vepo/wildly-swarm-jnosql/pull/1
Related
I got this exception when starting my WAR file in the Wildfly 24 server under Java 16 after migrating from Wildfly 10 / Java 9.
I dont understand this Exception.
`11:37:44,290 SEVERE [javax.faces] (ServerService Thread Pool -- 89) Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
11:37:44,292 SEVERE [javax.faces] (ServerService Thread Pool -- 89) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
11:37:44,293 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 89) MSC000001: Failed to start service jboss.deployment.unit."myApplication.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."myApplication.war".undertow-deployment: java.lang.RuntimeException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:90)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:831)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:257)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:105)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:87)
... 8 more
Caused by: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at javax.faces.api#3.0.0.SP04//javax.faces.FactoryFinderInstance.notNullFactory(FactoryFinderInstance.java:524)
at javax.faces.api#3.0.0.SP04//javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:207)
at javax.faces.api#3.0.0.SP04//javax.faces.FactoryFinder.getFactory(FactoryFinder.java:279)
at deployment.myApplication.war//org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:168)
at deployment.myApplication.war//org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:230)
at javax.faces.api#3.0.0.SP04//javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1603)
at deployment.myApplication.war//org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:578)
at deployment.myApplication.war//org.apache.myfaces.webapp.AbstractFacesInitializer.initStartupFacesContext(AbstractFacesInitializer.java:547)
at deployment.myApplication.war//org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:100)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
at org.wildfly.extension.undertow#24.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
at io.undertow.servlet#2.2.8.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
... 10 more
11:37:44,299 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed -
address: ([("deployment" => "myApplication.war")]) - failure
description: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit."myApplication.war".undertow-deployment" =>
"java.lang.RuntimeException: java.lang.IllegalStateException: Could
not find backup for factory
javax.faces.application.ApplicationFactory.
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Could not find backup for factory
javax.faces.application.ApplicationFactory.
Caused by: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. "}}`
I would like to verify the code coverage of my integration tests. I have implemented some REST-Services and deployed them on Wildly 9.0.2. Then I configured the coverage in IntelliJ with IDEA Coverage Runner for tracing support. When I now start Wildfly with coverage the deployment of the war fails with the following strack trace:
16:20:53,103 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."myservice-war-1.0.0-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."myservice-war-1.0.0-SNAPSHOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "myservice-war-1.0.0-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: com/intellij/rt/coverage/data/ProjectData
at de.akquinet.ats.myservice.rest.services.MyUpdateService.<clinit>(MyUpdateService.java)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:95)
at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166)
at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:150)
at org.jboss.as.ejb3.component.stateless.StatelessComponentDescription$3.configure(StatelessComponentDescription.java:150)
at org.jboss.as.ee.component.DefaultComponentViewConfigurator.configure(DefaultComponentViewConfigurator.java:67)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)
... 5 more
Caused by: java.lang.ClassNotFoundException: com.intellij.rt.coverage.data.ProjectData from [Module "deployment.myservice-war-1.0.0-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
... 15 more
16:20:53,106 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "myservice-war-1.0.0-SNAPSHOT.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"myservice-war-1.0.0-SNAPSHOT.war\"
Caused by: java.lang.NoClassDefFoundError: com/intellij/rt/coverage/data/ProjectData
Caused by: java.lang.ClassNotFoundException: com.intellij.rt.coverage.data.ProjectData from [Module \"deployment.myservice-war-1.0.0-SNAPSHOT.war:main\" from Service Module Loader]"},
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".batch.environment is missing [jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".beanmanager]",
"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".beanmanager]"
]
}
16:20:53,107 ERROR [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0021: Deploy of deployment "myservice-war-1.0.0-SNAPSHOT.war" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"myservice-war-1.0.0-SNAPSHOT.war\"
Caused by: java.lang.NoClassDefFoundError: com/intellij/rt/coverage/data/ProjectData
Caused by: java.lang.ClassNotFoundException: com.intellij.rt.coverage.data.ProjectData from [Module \"deployment.myservice-war-1.0.0-SNAPSHOT.war:main\" from Service Module Loader]"},
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".batch.environment is missing [jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".beanmanager]",
"jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"myservice-war-1.0.0-SNAPSHOT.war\".beanmanager]"
]
}
I am using IntelliJ IDEA 2016.1.2
Build #IU-145.972, built on May 14, 2016
JRE: 1.8.0_76-release-b162 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
I am fully aware of what a ClassNotFoundException is and usually know what to do then, but here I am stuck...
Can anybody help please?
Currently, it is not posible to use IntelliJ IDEA coverage agent, because org.wildfly.arquillian:wildfly-arquillian-container-embedded:2.0.0.Final doesn't have any property for setting System Packages (jboss.modules.system.pkgs system property).
The only way to use IntelliJ IDEA coverage agent is modifying EmbeddedContainerConfiguration and EmbeddedDeployableContainer classes, and then, you must use these customized classes.
I alredy made a pull request, i hope the new version will be available very soon.
public class EmbeddedContainerConfiguration extends CommonContainerConfiguration {
private String systemPackages = System.getProperty("jboss.modules.system.pkgs");
public String getSystemPackages() {
return systemPackages;
}
public void setSystemPackages(String systemPackages) {
this.systemPackages = systemPackages;
}
public String[] getSystemPackagesArray() {
return (systemPackages == null || systemPackages.isEmpty()) ? null : systemPackages.split(",");
}
}
public final class EmbeddedDeployableContainer extends CommonDeployableContainer<EmbeddedContainerConfiguration> {
#Override
public void setup(final EmbeddedContainerConfiguration config) {
super.setup(config);
if (config.getCleanServerBaseDir() != null) {
SecurityActions.setSystemProperty(EmbeddedStandaloneServerFactory.JBOSS_EMBEDDED_ROOT, config.getCleanServerBaseDir());
}
final String[] cmdArgs = getCommandArgs(config);
server = EmbeddedProcessFactory.createStandaloneServer(config.getJbossHome(), config.getModulePath(), config.getSystemPackagesArray(), cmdArgs);
}
}
I have a problem, when I want to deploy my application on wildfly.
This is my persistence:
<persistence-unit name="jws" transaction-type="JTA">
<class>lv.lavloz.merrill.generator.v1.model.ID</class>
<jta-data-source>java:jboss/datasources/MySQL/JWSDS</jta-data-source>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
</properties>
</persistence-unit>
The connection url for the jndi java:jboss/datasources/MySQL/JWSDS is jdbc:mysql://localhost:3306/db.
And this is the ejb :
#Stateless
public class GeneratorBean {
#PersistenceContext(unitName = "jws")
private EntityManager em;
...
}
When I want to deploy my application to wildfly, I get the error message
java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jws_ear.ear\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jws_ear.ear\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type ParamConverterFactory with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory(ParamConverterFactory)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.<init>(MultivaluedParameterExtractorFactory.java:0)
WELD-001474: Class org.glassfish.jersey.server.internal.inject.ParamConverterFactory is on the classpath, but was ignored because a class it references was not found: org.glassfish.hk2.api.ServiceLocator from [Module \"deployment.jws_ear.ear:main\" from Service Module Loader].
"}}
What to do?
This does not seem to be related to JPA at all.
Your error message referring to org.glassfish.jersey.server.internal indicates that your application has a dependency on Jersey.
Are you trying to port an application from GlassFish to WildFly? If so, you should eliminate all dependencies on Jersey and only use the JAX-RS APIs, or WildFly's JAX-RS implementation RESTEasy.
Jersey is not contained in WildFly.
I got a stupid problem when deploying my Java Application on JBoss. Before I changed my source code using an interface class everything was fine. So here is my problem:
public interface FWInterface {
public FWResult process(FWRequest fwRequest, FWResult fwResult,
Integer commitRows) throws Exception;
}
...
#Stateless
public class FWHandlerSqrMind extends FWHandlerDefault implements FWInterface {
public FWResult process(FWRequest fwRequest, FWResult fwResult, Integer commitRows)
throws Exception {
... some JavaCode here
}
}
This ends up with the following Error at deployment on JBoss 7.1:
10:05:34,838 ERROR [org.jboss.msc.service.fail] (MSC service thread
1-6) MSC00001: Failed to start service
jboss.deployment.unit."mdk-exchange-1.1.0.war".WeldService:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."mdk-exchange-1.1.0.war".WeldService:
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied
dependencies for type [FWHandlerAufTracking] with qualifiers
[#Default] at injection point [[field] #Inject
de.mdkbw.exchange.filewatcher.FWMain.fwhAufTracking] at
org.jboss.as.weld.services.WeldService.start(WeldService.java:83) 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(Unknown Source)
[rt.jar:1.7.0_15] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[rt.jar:1.7.0_15] at java.lang.Thread.run(Unknown Source)
[rt.jar:1.7.0_15] Caused by:
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied
dependencies for type [FWHandlerAufTracking] with qualifiers
[#Default] at injection point [[field] #Inject
de.mdkbw.exchange.filewatcher.FWMain.fwhAufTracking] at
org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
at
org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
at
org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
at
org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
at
org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
at
org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
at
org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83) at
org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
If I remove the implementation everything is ok. Could anybody tell me what the problem is? Am I too stupid?? Thanks in advance!
How do you inject your bean? Like that?
#Inject
private FWHandlerSqrMind handler;
If so could you try to inject it like that:
#Inject
private FWInterface handler;
Do you have META-INF/beans.xml or WEB-INF/beans.xml file in your class path?
Missing beans.xml was the problem in my case (WildFly 8.2.0).
Just placing a simple beans.xml like the following solved this problem:
<?xml version="1.0"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd" />
I am getting below error when deploying rewards-jsf application. Please advise.
07:18:41,768 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [#Default] at injection point [[field] #Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [#Any #Default], Producer Method [UserGroupCallback] with qualifiers [#Any #Default] declared as [[method] #ApplicationScoped #Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]
at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
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$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [#Default] at injection point [[field] #Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [#Any #Default], Producer Method [UserGroupCallback] with qualifiers [#Any #Default] declared as [[method] #ApplicationScoped #Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
The DefaultUserGroupInfoProducer should already be marked as an alternative, and thus would need to be specified in beans.xml to pick it up, is that the case? If so, removing it from beans.xml should disable it.
This is the issue for sure:
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback]:
Injection point where the UserGroupCallBack is required -> #Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback].
1) First possible match:
[[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [#Any #Default],
2) Second Match: Producer Method [UserGroupCallback] with qualifiers [#Any #Default] declared as [[method] #ApplicationScoped #Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]
One of these two must go away in order to work. I guess that RewardsUserGroupCallback is the one intenteded for this application (I don't really know where this application is hosted or the internals of it) so you need to review the code.