If someone wants to try this out and see if they can get something working for Paul by tomorrow evening, that'd be fantastic. I'll pick it up tomorrow afternoon otherwise.

The related JIRA is http://issues.apache.org/jira/browse/OPENEJB-360

-David


Begin forwarded message:

Resent-From: <[EMAIL PROTECTED]>
From: David Blevins <[EMAIL PROTECTED]>
Date: August 27, 2007 9:25:18 PM PDT
To: [EMAIL PROTECTED]
Subject: Re: How to confiigure an container managed EntityManger in an embeded server?
Reply-To: [EMAIL PROTECTED]

That looks exactly right. Let me see if I can whip up a quick example with similar settings and see if we can't figure out what might be going. We need the example anyway.

-David

On Aug 27, 2007, at 9:00 PM, Paul Spencer wrote:

David,
See below.

David Blevins wrote:
On Aug 26, 2007, at 6:44 PM, Paul Spencer wrote:
If you're persistence unit was not found when we attempted to resolve the reference (created via the annotation) during the time the bean as loading, we'd throw one of these which should be logged and would fail your app: throw new IllegalArgumentException("Persistence unit " + contextInfo.persistenceUnitName + " for persistence-context-ref " +
                        contextInfo.referenceName + " not found");

I am getting this error, but I believe the datasource is defined.

Below is my configuration.  Is their something missing?

***
* conf/openejb.xml
***
...
<Connector id="Default JDBC Database" >
    JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
    JdbcUrl jdbc:derby:openjpa-database;create=true;
    UserName
    Password
</Connector>
...

***
* ArtifactManagerImpl.java
***
...
@Stateless
public class ArtifactManagerImpl implements ArtifactManager {
        @PersistenceContext(unitName = "myDataSource")
        private EntityManager entityManager;

        public ArtifactManagerImpl() {
        }
...

***
* META-INF/persistence.xml
***
<persistence>
  <persistence-unit name="myDataSource" transaction-type="JTA">
    <provider>
       org.apache.openjpa.persistence.PersistenceProviderImpl
    </provider>
    <jta-data-source>
      java:openejb/Connector/Default JDBC Database
    </jta-data-source>
  </persistence-unit>
</persistence>

-David

Paul Spencer




Reply via email to