jboss-embedded with testNG injection problem
alex_ro_bv May 27, 2010 9:20 AMHi guys,I'm developing an application with seam 2.2.1.CR1, jboss-embedded beta3.SP4, testNG and maven 2.0.2.
After adding the necessary jar files, and all the bootstrap configuration files, jboss embedded starts, but I'm facing an injection problem. It always says: @In attribute requires non-null value. I don't use ejb, just seam components and also I don't use hibernate, just custom jdbc implementations.
My components.properties is the following:
jndiPattern=#{ejbName}/local debug=true seamBootstrapsPu=true seamEmfRef=#{entityManagerFactory} puJndiName=#{null}
components.xml:
<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.com/products/seam/components" xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence" xmlns:security="http://jboss.com/products/seam/security" xmlns:transaction="http://jboss.com/products/seam/transaction" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd"> <core:init jndi-pattern="@jndiPattern@" debug="true"/> <core:manager conversation-timeout="120000" concurrent-request-timeout="500" conversation-id-parameter="cid"/> <transaction:ejb-transaction/> <security:identity authenticate-method="#{authenticator.authenticate}"/> </components>
bootstrap/META-INF/ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar 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://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0"> <interceptors> <interceptor> <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> </interceptor> </interceptors> <assembly-descriptor> <interceptor-binding> <ejb-name>*</ejb-name> <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> </interceptor-binding> </assembly-descriptor> </ejb-jar>
and the code that fails :
@Name("userHome") @Scope(ScopeType.SESSION) public class UserHomeImpl extends AbstractEntityHome<User> implements UserHome,Serializable { private static final long serialVersionUID = -6114303258863985024L; @In(create=true) private UserDao dao;
where userDao:
@Name("userDao") public class UserDaoImpl extends AbstractJdbcDaoImpl<User> implements UserDao {
The exception that always is raised :@In attribute requires non-null value: userHome.dao
Can you please help me on this injection issue?
Thanks.