Comments (13)
also:
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type WeldListener with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject @ApplicationScoped private org.jglue.cdiunit.ContextController.listener
at org.jglue.cdiunit.ContextController.listener(ContextController.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
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)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
from cdi-unit.
Is this outside of a unit test?
Please put your CDI-Unit dependency in test scope:
<groupId>org.jglue.cdi-unit</groupId>
<artifactId>cdi-unit</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
Also in HEAD the CDI-Unit dependency does not participate in bean discovery outside of a unit test.
from cdi-unit.
I chanage like this
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>2.1.2.Final</version>
</dependency>
<dependency>
<groupId>org.jglue.cdi-unit</groupId>
<artifactId>cdi-unit</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
when i do the test
@RunWith(CdiRunner.class)
public class CategoryManagerTest2 {
@Inject
Manager<Category> manager;
@Test
public void test(){
Category data = new Category();
data.name = "xx";
manager.create(data);
}
}
i will always get the failue Trace
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Manager<Category> with qualifiers @Default
at injection point [UnbackedAnnotatedField] @Inject cn.tt100.rms.impl.persistence.CategoryManagerTest2.manager
at cn.tt100.rms.impl.persistence.CategoryManagerTest2.manager(CategoryManagerTest2.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
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)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
I can not inject any Bean
from cdi-unit.
The strange thing is that your call stack doesn't have junit in it. Are you running this outside a test e.g. by starting weld manually?
from cdi-unit.
For that matter your call stack doesn't have CDI-Unit in it either....
from cdi-unit.
No,I do not starting weld manually,I only running the @test,and if I do like this,it will be ok
CategoryManager manager;
@BeforeClass
public static void setUpClass(){
weld = new Weld();
weldContainer = weld.initialize();
System.out.println("weld init");
}
@AfterClass
public static void teardownClass() {
weld.shutdown();
System.out.println("weld teardown");
}
@Override
@Before
public void init() {
manager = weldContainer.instance().select(CategoryManager.class).get();
}
@Override
@Test()
public void test() {
Category data1 = new Category();
data1.name = "xx";
manager.create(data1);
}
from cdi-unit.
OK. Given your least stack trace I am guessing that Category is an interface or abstract class.
You will need to tell the container about the implementing class using one of the discovery annotations.
http://jglue.org/cdi-unit-user-guide/#controllingEnvironment
from cdi-unit.
In addition to,when i do running @test,the weld not starting Seemingly!
17:09:23.709 [main] DEBUG org.jboss.weld.Bootstrap - WELD-000100: Weld initialized. Validating beans
17:09:23.716 [weld-worker-3] WARN org.jboss.weld.Validator - WELD-001440: Scope type @javax.enterprise.context.ApplicationScoped() used on injection point [BackedAnnotatedField] @Inject @ApplicationScoped private org.jglue.cdiunit.ContextController.listener
yea,CategoryManager is a class implements interface Manager.I try like this
@RunWith(CdiRunner.class)
@AdditionalClasses(Manager.class)
public class CategoryManagerTest2 {
@Inject
CategoryManager manager;
@Test
public void test(){
Category data = new Category();
data.name = "xx";
manager.create(data);
}
}
from cdi-unit.
17:09:23.716 [weld-worker-3] WARN org.jboss.weld.Validator - WELD-001440: Scope type @javax.enterprise.context.ApplicationScoped() used on injection point [BackedAnnotatedField] @Inject @ApplicationScoped private org.jglue.cdiunit.ContextController.listener
This is a warning, I've corrected the code but you can ignore it. Weld should still be starting fine.
from cdi-unit.
Weld not starting after the warning,i did not kown why...
from cdi-unit.
Is there a stack trace?
from cdi-unit.
On 15/07/14 10:42, 蒋建洋 wrote:
no!when weld running to this warning,there will be nothing after.
—
Reply to this email directly or view it on GitHub
#58 (comment).Is your test passing? CDI-Unit shuts down weld after each test.
Attached is what I can piece together from your test. It seems to work
for me
from cdi-unit.
It really work!Ok!The cdi-unit work normally,there are some other problems about the EntityManager...so thank you.
from cdi-unit.
Related Issues (20)
- WELD-001408: Unsatisfied dependencies for type EntityManager with qualifiers @Named HOT 4
- Cannot inject ContextController HOT 3
- Discover implementation of fields with interface type
- Error message for public rule field should be more helpful
- InRequestScope mentions nonexistent DummyHttpServletRequest
- Move to new group ID: io.github.cdi-unit HOT 1
- Investigate the capabilities of Travis CI to automate the release HOT 1
- Recent builds are failing on TravisCI
- cdi-unit fails to build with JDK 14 HOT 1
- Maven is complaining about malformed projects
- Repository gardening
- Unable to run cdiunit on Zulu JDK 11 HOT 4
- CdiRunner does not unbind the BeanManager in finally HOT 1
- Migrate from TravisCI to GitHub Actions
- Setup release workflow with GitHub Actions HOT 10
- NoClassDefFoundError with JDK 11 HOT 4
- Version for Jakarta EE HOT 27
- Case sensitivity in URL comparison HOT 3
- Question: PowerMock Support?
- Release HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdi-unit.