tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Spencer <paulspen...@mindspring.com>
Subject Re: How to confiigure an container managed EntityManger in an embeded server?
Date Tue, 28 Aug 2007 04:00:40 GMT
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

Mime
View raw message