Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Error creating Eclipselink sessions

The EclipseLink native API sessions.xml file references the native
project.xml file.  You seem to be trying to use a JPA orm.xml, which is not
valid.  If you are using JPA, then use persistence.xml not sessions.xml, and
Persistence, not SessionManager.

The EclipseLink Mapping Workbench can be used to define a native project.xml
file.



gsilverman wrote:
> 
> I get the following error trying to create a session using:
> 
> SessionManager sessionManager = SessionManager.getManager();
> Session session = sessionManager.getSession("Dylt_ServerSession");
> 
> Exception [EclipseLink-9005] (Eclipse Persistence Services - 1.0 (Build
> 1.0 - 20080707)):
> org.eclipse.persistence.exceptions.SessionLoaderException
> Exception Description: An exception was thrown while loading the
> project-xml file
> [D:/workspace_dylt/dylt-main/dylt-data/src/main/resources/META-INF/orm-messages.xml].
> Internal Exception: Exception [EclipseLink-25008] (Eclipse Persistence
> Services - 1.0 (Build 1.0 - 20080707)):
> org.eclipse.persistence.exceptions.XMLMarshalException
> Exception Description: A descriptor with default root element
> {http://www.eclipse.org/eclipselink/xsds/persistence/orm}entity-mappings
> was not found in the project
> 
> My sessions.xml file is as follows:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <sessions version="1.0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>    <session xsi:type="server-session">
>       <name>Dylt_ServerSession</name>
>       <server-platform xsi:type="jboss-platform"/>
>       <event-listener-classes/>
>       <!-- <profiler>toplink</profiler>-->
>       <logging xsi:type="eclipselink-log"/>
>       <primary-project
> xsi:type="xml">D:/workspace_dylt/dylt-main/dylt-data/src/main/resources/META-INF/orm-messages.xml</primary-project>
>       <additional-project
> xsi:type="xml">D:/workspace_dylt/dylt-main/dylt-data/src/main/resources/META-INF/orm-allcode.xml</additional-project>
>       <additional-project
> xsi:type="xml">D:/workspace_dylt/dylt-main/dylt-data/src/main/resources/META-INF/orm-zip.xml</additional-project>
>       <login xsi:type="database-login">
>         
> <platform-class>org.eclipse.persistence.platform.database.SybasePlatform</platform-class>
>          <user-name>Gsilverman</user-name>
>          <password>BB742416276274A46959A54867978929</password>
>          <external-connection-pooling>true</external-connection-pooling>
>         
> <external-transaction-controller>true</external-transaction-controller>
>          <sequencing>
>             <default-sequence xsi:type="table-sequence">
>                <name>Default</name>
>             </default-sequence>
>          </sequencing>
>          <driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>
>         
> <connection-url>jdbc:sybase:Tds:athena:6000/dylt2000</connection-url>
>          <struct-converters/>
>       </login>
>       <connection-pools>
>          <read-connection-pool>
>             <name>ReadConnectionPool</name>
>             <exclusive>false</exclusive>
>          </read-connection-pool>
>          <write-connection-pool>
>             <name>default</name>
>          </write-connection-pool>
>       </connection-pools>
>       <connection-policy/>
>    </session>
> </sessions>
> 
> The project-xml file, orm-messages.xml" starts with:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings
> 
> xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
> xsd/eclipselink_orm_1_0.xsd"
> 	xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm";
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0">
> 
> Clearly, this does have an "entity-mappings" root element, so what is the
> exception complaining about?
> 
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Error-creating-Eclipselink-sessions-tp19765410p19779735.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top