Skip to main content

Re: "Unknown abstract schema type" while accessing PU

  • From: Marina Vatkina <Marina.Vatkina@...>
  • To: dev@...
  • Subject: Re: "Unknown abstract schema type" while accessing PU
  • Date: Mon, 27 Aug 2007 21:02:18 -0700
  • Mailing-list: contact dev-help@...; run by ezmlm

Jagadish Prasath Ramu wrote:
On Mon, 2007-08-27 at 19:40 -0700, Marina Vatkina wrote:

A webapp in GlassFish can use EMF injection/lookup, which will make it a "real" Java EE app, will allow to use UserTransaction or will make sure that your <non-jta-data-source>jdbc/sample is actually a non-tx datasource (otherwise you'd be better off using jdbc/sample__nontx name to get non-transactional connections that the JPA provider can safely call commit on).

Please set "non-transactional-connections" attribute of the
corresponding jdbc-connection pool to "true", instead of doing lookup as
"jdbc/sample__nontx"

Yes, but that will affect all applications that use this resource, which might be an unexpected result.

thanks,
-marina


Thanks,
-Jagadish

Regards,
-marina

Arun Gupta wrote:

Even though this application is deployed on GlassFish as a webapp, what is required to make this a Java EE app ?

-Arun

Marina Vatkina wrote:


I think that when you use Persistence.createEntityManagerFactory(), you must list your entities in the persistence.xml as it's considered to be a Java SE environment.

thanks,
-marina

Arun Gupta wrote:


In NB 5.5.1, I created a Persistence Unit for a pre-configured jdbc/sample database. Then I created an Entity Class from this PU to generate a dynamic page. The page content looks like:

-- cut here --
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jmaki-jpa4PU");
    EntityManager em = emf.createEntityManager();

List<Customer> list = em.createQuery("select c from Customer c").getResultList();
-- cut here --

The persistence.xml looks like:

-- cut here --
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";>
<persistence-unit name="jmaki-jpa4PU" transaction-type="RESOURCE_LOCAL">
    <non-jta-data-source>jdbc/sample</non-jta-data-source>
    <properties/>
  </persistence-unit>
</persistence>
-- cut here --

And here is the error that I'm getting while accessing this page:

-- cut here --
Exception [TOPLINK-8034] (Oracle TopLink Essentials - 2.0 (Build b58-rc1 (08/04/2007))): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Error compiling the query [select c from Customer c]. Unknown abstract schema type [Customer].
-- cut here --

Most of the stuff is generated for me (database, persistence.xml, PU, entity class) and I'm still seeing this error. I verified the table contains appropriate data.

What can cause this ?

Thanks,
-Arun


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...





"Unknown abstract schema type" while accessing PU

Arun Gupta 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Marina Vatkina 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Arun Gupta 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Marina Vatkina 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Jagadish Prasath Ramu 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Marina Vatkina 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Arun Gupta 08/28/2007

Re: "Unknown abstract schema type" while accessing PU

Sahoo 08/28/2007
 
 
Close
loading
Please Confirm
Close