geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From axiez <lesai...@gmail.com>
Subject Unable to resolve reference "JtaDataSourceWrapper" in gbean default/a1/1233553508187
Date Mon, 02 Feb 2009 06:08:23 GMT

I have a business interface, remotely accessible stateless session bean,
entity, and a client that will access from a different JVM. I tried to
deploy a1.jar but got error message specified in the subject.
META-INF/persistence.xml has the following entries
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
    <persistence-unit name="manager">
        <jta-data-source>jdbc/h</jta-data-source>
        <class>AccountNtt</class>
    </persistence-unit>
</persistence>
where h is the data source created by me using console, AccountNtt is the
entity class, and manager is the EntityManager reference in stateless
session bean.
Stateless session bean code is:
import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.Remote;
import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@Stateless
@Remote(Account.class)
public class AccountBean implements Account {
    @PersistenceContext
    private EntityManager manager;
    public AccountNtt find(String accountNum) {
        AccountNtt ac =
(AccountNtt)manager.find(AccountNtt.class,accountNum);
        return ac;
    }
    public AccountNtt createAccount(String name, String accountType, String
accountNum) {
        AccountNtt acNtt = new AccountNtt(name, accountType, accountNum);
        manager.persist(acNtt);
        return acNtt;
    }
    public int displayBalance(String accountNum) {
        AccountNtt ac = (AccountNtt) manager.find(AccountNtt.class,
accountNum);
        return ac.balance;
    }
    public List<AccountNtt> balanceGt5000() {
        String ejbql = "SELECT a FROM AccountNtt a WHERE a.balance>5000";
        Query query = manager.createQuery(ejbql);
        List<AccountNtt> result = query.getResultList();
        return result;
    }
    public AccountNtt first0() {
        String ejbql = "SELECT a FROM AccountNtt a WHERE a.balance=0";
        Query query = manager.createQuery(ejbql);
        AccountNtt a = (AccountNtt) query.getSingleResult();
        return a;
    }
    public void clearAllAccounts() {
        String ejbql = "DELETE FROM AccountNtt a";
        Query q = manager.createQuery(ejbql);
        manager.getTransaction().begin();
        q.executeUpdate();
        manager.getTransaction().commit();
    }
}
The error message is:
Error: Unable to distribute a1.jar: Unable to resolve reference
"JtaDataSourceWrapper" in gbean
default/a1/1233553508187/jar?EJBModule=default/a1/1233553508187/jar,J2EEApplication=null,PersistenceUnitModule=ejb.jar,j2eeType=PersistenceUnit,name=manager
to a gbean matching the pattern
[?name=jdbc/h#org.apache.geronimo.naming.ResourceSource] due to: No matches
for referencePatterns:
[?name=jdbc/h#org.apache.geronimo.naming.ResourceSource]
How can I make the data source work?
-- 
View this message in context: http://www.nabble.com/Unable-to-resolve-reference-%22JtaDataSourceWrapper%22-in-gbean-default-a1-1233553508187-tp21784636s134p21784636.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message