Comments (10)
from cdi.
With weld, to be honest, no, but if i'm not wrong, Weld doesn't support EJB.... or i'm wrong?
from cdi.
@FuoriDiTesta I have downloaded your sample.zip project. unziped and run mvn test. It does not compile.
MybatisFactoryProducers.java:[6,29] package org.apache.derby.jdbc does not exist
So there is some problem in your configuration.
from cdi.
@FuoriDiTesta after I have fixed your derby dependecy, I tried:
mvn -P arquillian-jbossas-managed test ...... [No Errors]
mvn -P GlassFish test ................................... [No Errors]
mvn -P tomee-embedded test ........................ [No Errors]
So I will close this now. If you provide new evidence this can be reopened. But I recommend you to move to mybatis-cdi-1.1.0 anyway.
from cdi.
@FuoriDiTesta Ok, your sample zip is not running any test, I just figured it now, your class ArquillianMyBatisSample must be named ArquillianMyBatisSampleTest to be executed in tests.
- I fixed the class name and your reported exception appears.
- I have upgraded to mybatis-cdi-1.1.0 and the problem remains.
This requires further investigation.
from cdi.
@FuoriDiTesta, I am not an Arquillian user. Please provide more info/tests to help us encounter the problem. I suspect the problem is not in mybatis-cdi but in your configuration, but because I do not know Arquillian, I can be wrong. One possible test is to setup a project using tomcat embedded without Arquillian.
from cdi.
I have the same problem with Arquillian. I've traced the problem to how @Mapper is injected.
public static SqlSessionManagerRegistry getRegistry(CreationalContext creationalContext) {
final BeanManager beanManager = getBeanManager();
Iterator<Bean<?>> beans = beanManager.getBeans(SqlSessionManagerRegistry.class).iterator();
return (SqlSessionManagerRegistry) beanManager.getReference(beans.next(), SqlSessionManagerRegistry.class,
creationalContext);
}
SqlSessionManagerRegistry.class is not managed by CDI and the call to beanManager returns an empty iterator.
from cdi.
Injecting SqlSessionFactory seems to work. So a work around to this problem is to call sqlSessionFactory.openSession().getMapper( ) to instantiate your DAO class.
from cdi.
SqlSessionManagerRegistry.class is not managed by CDI and the call to beanManager returns an empty iterator.
SqlSessionManagerRegistry actually IS a managed bean:
from cdi.
Few years later, trying to clean things up so I took the download which was a mess as noted here. I fixed the same issues but got it to work. Arquillian requires 'SqlSessionManagerRegistry.class' added or it will not load it. Once it loads it, it works fine with the test product. To save others work if they stumble on this, I have updated the sample project. It should work with simple 'mvn clean install' or however you like. It is tied to the snapshot of this project now though so I could confirm latest changes I've been doing don't break anything.
I'm going to add a note to readme specifically for arquillian as this was first I have ever used it and the issue was considerably hard to figure out.
from cdi.
Related Issues (20)
- UnsatisfiedResolutionException: Api type [] is not found with the qualifiers... HOT 7
- Consider support JNDI obtain UserTransaction?
- Weld 3.1.7.Final Proxy changes has broken mybatis-cdi support HOT 1
- Create annotation to rollback exception by default HOT 1
- Upgrade to jakarta Namespace HOT 17
- UnsatisfiedResolutionException using aries-cdi 1.1.5 with karaf 4.3.7 HOT 1
- Dependency Dashboard
- Migrate from atomikos to narayana HOT 1
- Site plugin and 'clirr' usage issue with jakarta
- Clirr: Remove profile from maven.config file after no longer needing to compare to javax namespace
- missing @Any qualifier on MybatisBean if user provided qualifier is present
- Transactional (mybatis-cdi: org.mybatis.cdi.Transactional) annotation with rollbackOnly=true not rollbacking transactions inside a Weld / JUnit 5 test
- issue with micro profile standard HOT 1
- Release 1.0.3 HOT 4
- "WELD-001328: Unable to identify the correct BeanManager." occurs HOT 16
- Test issues - 8 of 13 can run concurrently / recent updates do not support oldest support revision of cdi/weld HOT 5
- github is behaving very strange... HOT 1
- mybatis-cdi-1.0.3 crashes in repeated requests HOT 2
- Release mybatis-cdi 1.1.0 HOT 2
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.