|
Re: Confused: JPA Tools >generate tables from entities [message #435135 is a reply to message #435133] |
Tue, 13 January 2009 19:07 |
Neil Hauge Messages: 475 Registered: July 2009 |
Senior Member |
|
|
Hi,
I think the root of the problem here is that you are working with an
EclipseLink platform and EclipseLink properties, but actually using
TopLink Essentials in Glassfish. The second error message about not
finding a provider is because you have specified an EclipseLink provider
but TopLink Essentials is the provider you are using as it is the default
in Glassfish.
If you intend to use EclipseLink, you can use this in GlassFish instead of
the default provider (Essentials). EclipseLink will be the default
provider in GlassFish in the future (for Java EE 6 / JPA 2.0), so this
would probably be the best direction to go.
If you need help with using EclipseLink in Glassfish, the EclispeLink
newsgroup would be a good place to get help.
Let me know if you need more info on this.
Neil
Wolfgang wrote:
> Hi, the Dali "JPA tools>generate tables..." is not working for me. Perhaps
> I am just missing a small thing:
> in a new Eclipse (3.4.1) JPA-project I created one TestEntity and a
> connection to an Oracle database. After I completed the TestEntity's
> mapping I had error messages regarding the missing table and its two
> missing attributes. So I tried to generate the table but this failed with
> Internal Exception: java.sql.SQLException: [Microsoft][ODBC Driver
> Manager] Data source name not found and no default driver specified
> so I added properties to the persistence.xml which created a different
> error message.
> I defined the project for a glassfish server which is shut down since I
> prefer to create my tables directly with the database connection.
> The database connection itself is ok because I can generate an entity from
> a table with the JPA-tools entry in the context menu.
> When I try to generate a table from the entity I see
> a) an error message in the console:
> Exception in thread "main" javax.persistence.PersistenceException: No
> Persistence provider for EntityManager named JPATestVF: The following
> providers:
> oracle.toplink.essentials.PersistenceProvider
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
> Returned null to createEntityManagerFactory.
> at
>
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:154)
> at org.eclipse.jpt.eclipselink.core.ddlgen.Main.execute(Main.ja va:77)
> at org.eclipse.jpt.eclipselink.core.ddlgen.Main.main(Main.java: 65)
> b) a status dialogue about a connection and refresh but the dialogue is
> closed immediately, no more log entries created, still no table.
> Just in case it adds value the persistence.xml is listed below, some
> values replaced with <generics>
> regards
> Wolfgang
> <?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="JPATestVF">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
> <exclude-unlisted-classes>true</exclude-unlisted-classes>
> <properties>
> <property name="eclipselink.target-database" value="Oracle"/>
> <property name="eclipselink.jdbc.driver"
> value="oracle.jdbc.OracleDriver"/>
> <property name="eclipselink.jdbc.platform"
> value=" org.eclipse.persistence.platform.database.oracle.OraclePlatf orm "/>
> <property name="eclipselink.jdbc.url"
> value="jdbc:oracle:thin:@<theserverip>:1521:<thesid>"/>
> <property name="eclipselink.jdbc.user" value="<myuser>"/>
> <property name="eclipselink.jdbc.password" value="<mypassword>"/>
> <property name="eclipselink.logging.level" value="ALL"/>
> <property name="eclipselink.logging.timestamp" value="true"/>
> <property name="eclipselink.logging.exceptions" value="true"/>
> <property name="eclipselink.logging.session" value="true"/>
> <property name="eclipselink.ddl-generation" value="create-tables"/>
> <property name="eclipselink.ddl-generation.output-mode"
> value="database"/>
> </properties>
> </persistence-unit>
> </persistence>
|
|
|
|
Re: Confused: JPA Tools >generate tables from entities [message #613725 is a reply to message #435133] |
Tue, 13 January 2009 19:07 |
Neil Hauge Messages: 475 Registered: July 2009 |
Senior Member |
|
|
Hi,
I think the root of the problem here is that you are working with an
EclipseLink platform and EclipseLink properties, but actually using
TopLink Essentials in Glassfish. The second error message about not
finding a provider is because you have specified an EclipseLink provider
but TopLink Essentials is the provider you are using as it is the default
in Glassfish.
If you intend to use EclipseLink, you can use this in GlassFish instead of
the default provider (Essentials). EclipseLink will be the default
provider in GlassFish in the future (for Java EE 6 / JPA 2.0), so this
would probably be the best direction to go.
If you need help with using EclipseLink in Glassfish, the EclispeLink
newsgroup would be a good place to get help.
Let me know if you need more info on this.
Neil
Wolfgang wrote:
> Hi, the Dali "JPA tools>generate tables..." is not working for me. Perhaps
> I am just missing a small thing:
> in a new Eclipse (3.4.1) JPA-project I created one TestEntity and a
> connection to an Oracle database. After I completed the TestEntity's
> mapping I had error messages regarding the missing table and its two
> missing attributes. So I tried to generate the table but this failed with
> Internal Exception: java.sql.SQLException: [Microsoft][ODBC Driver
> Manager] Data source name not found and no default driver specified
> so I added properties to the persistence.xml which created a different
> error message.
> I defined the project for a glassfish server which is shut down since I
> prefer to create my tables directly with the database connection.
> The database connection itself is ok because I can generate an entity from
> a table with the JPA-tools entry in the context menu.
> When I try to generate a table from the entity I see
> a) an error message in the console:
> Exception in thread "main" javax.persistence.PersistenceException: No
> Persistence provider for EntityManager named JPATestVF: The following
> providers:
> oracle.toplink.essentials.PersistenceProvider
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
> Returned null to createEntityManagerFactory.
> at
>
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:154)
> at org.eclipse.jpt.eclipselink.core.ddlgen.Main.execute(Main.ja va:77)
> at org.eclipse.jpt.eclipselink.core.ddlgen.Main.main(Main.java: 65)
> b) a status dialogue about a connection and refresh but the dialogue is
> closed immediately, no more log entries created, still no table.
> Just in case it adds value the persistence.xml is listed below, some
> values replaced with <generics>
> regards
> Wolfgang
> <?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="JPATestVF">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
> <exclude-unlisted-classes>true</exclude-unlisted-classes>
> <properties>
> <property name="eclipselink.target-database" value="Oracle"/>
> <property name="eclipselink.jdbc.driver"
> value="oracle.jdbc.OracleDriver"/>
> <property name="eclipselink.jdbc.platform"
> value=" org.eclipse.persistence.platform.database.oracle.OraclePlatf orm "/>
> <property name="eclipselink.jdbc.url"
> value="jdbc:oracle:thin:@<theserverip>:1521:<thesid>"/>
> <property name="eclipselink.jdbc.user" value="<myuser>"/>
> <property name="eclipselink.jdbc.password" value="<mypassword>"/>
> <property name="eclipselink.logging.level" value="ALL"/>
> <property name="eclipselink.logging.timestamp" value="true"/>
> <property name="eclipselink.logging.exceptions" value="true"/>
> <property name="eclipselink.logging.session" value="true"/>
> <property name="eclipselink.ddl-generation" value="create-tables"/>
> <property name="eclipselink.ddl-generation.output-mode"
> value="database"/>
> </properties>
> </persistence-unit>
> </persistence>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03722 seconds