Oracle Toplink Jaxb mapping

Hi,
i try to use the developer Preview 3(10.1.3.0)workbench
and it work fine with simple java class (two xml files generation).
But with java servlet who use the same classes nothing
work i got some exception :
05/03/01 08:24:33 exceptionProvider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: java.lang.NoSuchMethodError: oracle.toplink.publicinterface.Session oracle.toplink.tools.sessionmanagement.SessionManager.getSession(oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader, java.lang.String, java.lang.ClassLoader, boolean, boolean)
I have also a strange message in the log window in jdev 9052 :
Cutting log (size: 101767, max: 100000)Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Cutting log (size: 101866, max: 100000)Error cleaning up log: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISeekableStream.seek]
Thank you for your help.

The version of TopLink on your application server class path may be an older version of TopLink that does not contain the method mentioned in the stack trace.
If you are using OC4J the toplink.jar can be found in the following location:
<OC4J_HOME>\toplink\jlib\toplink.jar
The 10.1.3 DP3 version of OC4J can be found on OTN in the following location:
http://www.oracle.com/technology/software/products/ias/preview.html

Similar Messages

  • Mapping Database using Oracle Toplink 10.1.3.3.0

    Hi everybody, I'd like to use Oracle TopLink to do mapping my database and here is the database's script
    1F.sql
    ==========
    @@case1F.typ
    @@case1F.tab
    @@case1F.con
    1F.typ
    ==========
    CREATE TYPE TCUSTOMER
    CREATE TYPE TMEMORY
    CREATE TYPE TPHONE
    CREATE TYPE TNAME
    CREATE TYPE TMOTHERBOARD
    CREATE TYPE TADDRESS
    PROMPT Creating Object Type 'TNAME'
    CREATE OR REPLACE TYPE TNAME AS OBJECT
    (FIRST VARCHAR2(240)
    ,LAST VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TMOTHERBOARD'
    CREATE OR REPLACE TYPE TMOTHERBOARD AS OBJECT
    (KODE VARCHAR2(240)
    ,SERIES VARCHAR2(240)
    ,MERK VARCHAR2(240)
    ,VGA VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TMEMORY'
    CREATE OR REPLACE TYPE TMEMORY AS OBJECT
    (KODE VARCHAR2(240)
    ,MERK VARCHAR2(240)
    ,TIPE VARCHAR2(240)
    ,UKURAN VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TADDRESS'
    CREATE OR REPLACE TYPE TADDRESS AS OBJECT
    (STREET VARCHAR2(240)
    ,CITY VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TPHONE'
    CREATE OR REPLACE TYPE TPHONE AS OBJECT
    (CODE VARCHAR2(240)
    ,DIGIT VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TCUSTOMER'
    CREATE OR REPLACE TYPE TCUSTOMER AS OBJECT
    (USERNAME VARCHAR2(240)
    ,NAME TNAME
    ,ADDRESS TADDRESS
    ,PHONE TPHONE
    ,TYPE NUMERIC(1)
    ,EMAIL VARCHAR2(240)
    SHOW ERROR
    1F.tab
    ==========
    PROMPT Creating Table 'DTRANSAKSI'
    CREATE TABLE DTRANSAKSI
    (CPU_KODBERG VARCHAR2(6) NOT NULL
    ,HTI_NONOTA VARCHAR2(4) NOT NULL
    ,JMLBRG NUMERIC
    PROMPT Creating Table 'CPU'
    CREATE TABLE CPU
    (KODBERG VARCHAR2(6) NOT NULL
    ,NAMA VARCHAR2(240)
    ,MEMORY REF TMEMORY
    ,MOTHERBOARD REF TMOTHERBOARD
    ,HARGA NUMERIC
    ,KET CLOB
    ,VERSI VARCHAR2(240)
    PROMPT Creating Table 'HTRANSAKSI'
    CREATE TABLE HTRANSAKSI
    (NONOTA VARCHAR2(4) NOT NULL
    ,USERNAME REF TCUSTOMER
    ,TGLTRANS DATE
    ,VERSI VARCHAR2(240)
    ,CONSTRAINT HTI_PK PRIMARY KEY
    (NONOTA)
    ORGANIZATION INDEX
    PROMPT Creating Table 'MEMORY'
    CREATE TABLE MEMORY OF TMEMORY
    (KODE NOT NULL
    PROMPT Creating Table 'MOTHERBOARD'
    CREATE TABLE MOTHERBOARD OF TMOTHERBOARD
    (KODE NOT NULL
    PROMPT Creating Table 'CUSTOMER'
    CREATE TABLE CUSTOMER OF TCUSTOMER
    ALTER TABLE CPU
    ADD (SCOPE FOR (MEMORY) IS MEMORY)
    ALTER TABLE CPU
    ADD (SCOPE FOR (MOTHERBOARD) IS MOTHERBOARD)
    ALTER TABLE HTRANSAKSI
    ADD (SCOPE FOR (USERNAME) IS CUSTOMER)
    1F.conn
    ===================
    PROMPT Creating Primary Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI
    ADD (CONSTRAINT DTI_PK PRIMARY KEY
    (HTI_NONOTA
    ,CPU_KODBERG))
    PROMPT Creating Primary Key on 'CPU'
    ALTER TABLE CPU
    ADD (CONSTRAINT CPU_PK PRIMARY KEY
    (KODBERG))
    PROMPT Creating Foreign Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI ADD (CONSTRAINT
    DTI_HTI_FK FOREIGN KEY
    (HTI_NONOTA) REFERENCES HTRANSAKSI
    (NONOTA))
    PROMPT Creating Foreign Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI ADD (CONSTRAINT
    DTI_CPU_FK FOREIGN KEY
    (CPU_KODBERG) REFERENCES CPU
    (KODBERG))
    I found an error in ORACLE TOPLINK while adding table CUSTOMER, MOTHERBOARD and MEMORY from database to workbench. Any idea how to solve that error?
    And other questions:
    1. Does Toplink support inheritance and aggregation object table modelling? If it doesn't, what should I do?
    2. Is there any example or tutorial using Toplink Foundation Library?
    Thanks a lot.

    What error do you get in the MW?
    TopLink does support object-relational data-types, but the Mapping Workbench does not have support for object-relational data-types, so you may need to define your mappings through the TopLink Descriptor and Mapping Java code API. There is a section on object-relational data-type mappings in the TopLink User Guide.
    -- James : http://www.eclipselink.org

  • OracleAS TopLink 10g (10.0.3) Developer Preview 2 - NOW AVAILABLE

    Earlier this week we upgraded the 10.0.3 Developer Preview. The full set of functionality is documented in the release notes available on the preview landing page(http://otn.oracle.com/products/ias/toplink/preview/index.html).
    The functionality added in this refresh of the preview includes:
    - OC4J CMP Support
    - CTS 1.4 compliance
    -Support for hot/re-deployment of TopLink enabled CMP applications
    - Bean Pessimistic Locking - Have any of your beans locked on the database as you access them in a TX
    - Read-only entity beans are now supported
    - Enhanced integration with OracleAS for DMS capturing of performance statistics
    - Object-XML mapping enhanced:
    - Document Preservation - keep your un-mapped XML from being lost in the translation
    - JAXB Compiler - Generate an object model from schema with TopLink MW project
    - EIS/JCA mapping enhanced. Access your non-relational data source through OracleAQ or MQ Series
    - Object-Relational Enhancements
    - Value return from write - Use triggers to assign and return your PK or other calculated values on INSERT or UPDATE
    - Isolated Session Cache - Use TopLink to map your VPD/OLS managed tables
    - Conversion support for oracle.sql.TIMESTAMP & TIMSTAMPTZ
    - Generic history support - With versioning columns you can perform queries for past points in time using the HistoricalSession
    - Stored Function Support - Invoke your favourite stored function in the Oracle DB
    - Configurable query timeout support
    - Enhanced and re-organized examples. See examples link from preview landing page
    Additionally we have also added several new how-to docs that can also be accessed from the preview link above.
    If you encounter any issues with the preview please post them to this forum.
    Cheers,
    Doug Clarke
    Principal Product Manager
    OracleAS TopLink

    Sorry about the link above. Try:
    http://otn.oracle.com/products/ias/toplink/preview/index.html
    Doug

  • Exception [TOPLINK-46] (OracleAS TopLink - 10g (9.0.4) (Build 031126))

    Hi,
    I am using TopLink for simple Department-Employee relation, i have my project xml configured, But i am facing the problem with following exception
    Descriptor Exceptions:
    Exception [TOPLINK-46] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.DescriptorException
    Exception Description: There should be one non-read-only mapping defined for the primary key field [emp.empno].
    Descriptor: Descriptor(com.oracle.mssql.emp.toplink.EmpTopLinkBean --> [DatabaseTable(emp)])
    Runtime Exceptions:
    What could be the reason?
    Thanks
    Madhu

    My best guess would be that you have a 1:1 mapping from Employee to Department. This mapping represents part of the primary key.
    Make sure that your 1:1 mapping is not configured as read-only. Another issue is that you may have set the relationship as target foreign key. This has the same effect as read-only and is not applicable in the 1:1 returning from a 1:M.
    Doug

  • How can i using datasource in toplink's map file

    In the TopLink map :
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
    <toplink:user-name>test</toplink:user-name> <toplink:password>C23487CFA591952D44310804F3D591CB</toplink:password>
    <toplink:sequencing>
    <toplink:default-sequence xsi:type="toplink:native-sequence">
    <toplink:preallocation-size>1</toplink:preallocation-size>
    </toplink:default-sequence>
    </toplink:sequencing>
    <toplink:driver-class>oracle.jdbc.driver.OracleDriver</toplink:driver-class>
    <toplink:connection-url>jdbc:oracle:thin:@192.168.0.1:1521:testdb</toplink:connection-url>
    <toplink:bind-all-parameters>true</toplink:bind-all-parameters>
    </toplink:login>
    How can i modify it using datasource?

    The login information stored in the map file is good for direct connection and design time login information.
    For your runtime login information I would use the sessions configuration (sessions.xml). It provides complete deployment configuration:
       <session>
          <name>my-session</name>
          <!-- This references the ORM map XML file -->
          <project-xml>META-INF/employee-basic.xml</project-xml>
          <session-type>
             <server-session/>
          </session-type>
          <login>
             <datasource>jdbc/TopLinkDS</datasource>
             <uses-external-connection-pool>true</uses-external-connection-pool>
             <uses-external-transaction-controller>true</uses-external-transaction-controller>
          </login>
          <external-transaction-controller-class>oracle.toplink.essentials.transaction.oc4j.Oc4jTransactionController</external-transaction-controller-class>
          <enable-logging>true</enable-logging>
          <logging-options>
             <log-exceptions>true</log-exceptions>
             <print-thread>false</print-thread>
             <print-date>false</print-date>
          </logging-options>
       </session>Doug

  • Help with: oracle.toplink.essentials.exceptions.ValidationException

    hi guys,
    I really need ur help with this.
    I have a remote session bean that retrieves a list of books from the database using entity class and I call the session bean from a web service. The problem is that when i display the books in a jsp directly from the session bean everything works ok but the problem comes when I call the session bean via the web service than it throws this:
    Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
    at oracle.toplink.essentials.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:887)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:233)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)
    at oracle.toplink.essentials.indirection.IndirectList$1.<init>(IndirectList.java:425)
    at oracle.toplink.essentials.indirection.IndirectList.iterator(IndirectList.java:424)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:278)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:265)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:129)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:277)
    at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:100)
    at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:141)
    at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:315)
    at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
    at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
    ... 29 more
    This happens when I test the web service using netbeans 6.5.
    here's my code:
    session bean:
    ArrayList bookList = null;
    public ArrayList retrieveBooks()
    try
    List list = em.createNamedQuery("Book.findAll").getResultList();
    bookList = new ArrayList(list);
    catch (Exception e)
    e.getCause();
    return bookList;
    web service:
    @WebMethod(operationName = "retrieveBooks")
    public Book[] retrieveBooks()
    ArrayList list = ejbUB.retrieveBooks();
    int size = list.size();
    Book[] bookList = new Book[size];
    Iterator it = list.iterator();
    int i = 0;
    while (it.hasNext())
    Book book = (Book) it.next();
    bookList[i] = book;
    i++;
    return bookList;
    Please help guys, it's very urgent

    Yes i have a relationship but i didnt want it to be directly. Maybe this is a design problem but in my case I dont expect any criminals to be involved in lawsuit. My tables are like that:
    CREATE TABLE IF NOT EXISTS Criminal(
         criminal_id INTEGER NOT NULL AUTO_INCREMENT,
         gender varchar(1),
         name varchar(25) NOT NULL,
         last_address varchar(100),
         birth_date date,
         hair_color varchar(10),
         eye_color varchar(10),
         weight INTEGER,
         height INTEGER,
         PRIMARY KEY (criminal_id)
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Lawsuit(
         lawsuit_id INTEGER NOT NULL AUTO_INCREMENT,
         courtName varchar(25),
         PRIMARY KEY (lawsuit_id),
         FOREIGN KEY (courtName) REFERENCES Court_of_Law(courtName) ON DELETE NO ACTION
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Rstands_trial(
         criminal_id INTEGER,
         lawsuit_id INTEGER,
         PRIMARY KEY (criminal_id, lawsuit_id),
         FOREIGN KEY (criminal_id) REFERENCES Criminal(criminal_id) ON DELETE NO ACTION,
         FOREIGN KEY (lawsuit_id) REFERENCES Lawsuit(lawsuit_id) ON DELETE CASCADE
    ENGINE=INNODB;So I couldnt get it.

  • ConversionException in Toplink TIMESTAMP mapping

    We have a column mapped in Toplink as java.sql.Timestamp. In order to make this work they've added a few lines to the toplink Oracle.xml file defining the timestamp type.
    Inside JDeveloper this runs fine, however when run under Ant I get the following:
    EXCEPTION [TOPLINK-3001] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.ConversionException
    EXCEPTION DESCRIPTION: The object [oracle.sql.TIMESTAMP@258], of class [class oracle.sql.TIMESTAMP], could not be converted to [class java.sql.Timestamp].
    I've downloaded the newest JDBC drivers but the problem persists.
    Anyone have some advice?

    EXAMPLE CONVERSION MANAGER SOLUTION:
    package example;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import oracle.sql.*;
    import oracle.toplink.exceptions.ConversionException;
    import oracle.toplink.internal.helper.ConversionManager;
    * Example conversion manager that will add the ability to convert Oracle9i DB's
    * TIMESTAMP values into java.sql.Timestamp. This is required for TopLink
    * 9.0.3 and 9.0.4.
    * To use this class you must register the conversion manager prior to loading
    * your project.
    * <code>
    * ConversionManager.setDefaultManager(new MyConversionManager());
    * </code>
    public class MyConversionManager extends ConversionManager {
    private static final Class TIMESTAMP_TYPE = TIMESTAMP.class;
         protected Timestamp convertObjectToTimestamp(Object original) {
    if (original.getClass() == TIMESTAMP_TYPE) {
    try {
    return ((TIMESTAMP) original).timestampValue();
    } catch (SQLException se) {
    throw ConversionException.couldNotBeConverted(original, Timestamp.class, se);
    // NOTE: Similar check and comparisons could be done for TIMESTAMPTZ and TIMESTAMPLTZ
    return super.convertObjectToTimestamp(original);
    }

  • Oracle TopLink 10g Introductory Tutorial: No Table Reference available

    Hi,
    I'm trying to work through the Oracle TopLink 10g Introductory Tutorial (http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_tutorial/index.htm).
    At the point 'Map the Java Classes: Create One-to-One Mappings' (http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_tutorial/index.htm) I'm not able to select a table reference because there is no one available.
    As result i get the following message after generating 'Mapping Status Report':
    TopLink Map 'tut01Map' -> One of the packages is incomplete.
    Package example.model -> One of the descriptors in this package is incomplete.
    Descriptor Employee -> Some mappings are incomplete.
    Mapping address -> No table reference is selected.
    Mapping address -> Table reference is invalid because of the target table chosen.
    Mapping version -> Mapping references write lock field stored in cache, but is not read-only.
    Mapping phoneNumbers -> No table reference is selected.
    Mapping phoneNumbers -> Table reference is invalid because of the target table chosen.
    Descriptor PhoneNumber -> Some mappings are incomplete.
    Descriptor PhoneNumber -> The following primary key fields are unmapped: EMP_ID
    Descriptor PhoneNumber -> The following primary key fields have no writable mappings: EMP_ID
    Mapping owner -> No table reference is selected.
    Mapping owner -> Table reference is invalid because of the target table chosen.
    End TopLink Map 'tut01Map'
    Did I make a mistake or is there a wrong configuration? Please help.
    I'm using:
    JDeveloper 10.1.3.2.0
    MySQL 5.0.33 with Connector/J 5.0.5
    Windows XP
    Thanks, TGau
    Message was edited by:
    TGau
    Update

    Yes I did. But my database storage engine is set to MyISAM which don't support foreign keys. So this 'error' results from database configuration (Info: InnoDB do support foreign keys).
    I'm wondering why the queries didn't throw any errors. So the foreign key/reference part was just skipped.
    Thank you very much, rsapir.
    PS:
    How can I configure configure 'application side' references/associations? It is described in the TopLink Developers Guide on site 34-10 ... but I have no Add/New Buttons?

  • TOPLINK-6094: Mapping OntToMany (JPA)

    Hello!
    I'm learning how to use Java Persistence API and I'm getting an error which i don't know more what to do to solve it... :(
    Exception Description: The parameter name [cdUsuar] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadAllQuery(sysgroups.entity.Profissao)
    at oracle.toplink.essentials.exceptions.QueryException.parameterNameMismatch(QueryException.java:966)
    at oracle.toplink.essentials.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:206)
    So, I'm mapping the tables User (USUARIO) and Jobs(PROFISSAO) in my entities like that:
    Entities:
    @javax.persistence.Entity
    @javax.persistence.Table(name = "USUARIO")
    @javax.persistence.NamedQueries( {
    @javax.persistence.NamedQuery( name = "Usuario.findByCdUsuar",
    query = "SELECT u FROM Usuario u WHERE u.cdUsuar = :cdUsuar"),
    @javax.persistence.NamedQuery( name = "Usuario.findByLogin",
    query = "SELECT u FROM Usuario u WHERE u.dsLogin = :dsLogin and u.dsSenha = :dsSenha"),
    @javax.persistence.NamedQuery( name = "Usuario.findByNmUsuar",
    query = "SELECT u FROM Usuario u WHERE u.nmUsuar = :nmUsuar"),
    @javax.persistence.NamedQuery( name = "Usuario.findByDsLogin",
    query = "SELECT u FROM Usuario u WHERE u.dsLogin = :dsLogin"),
    @javax.persistence.NamedQuery( name = "Usuario.findByDsSenha",
    query = "SELECT u FROM Usuario u WHERE u.dsSenha = :dsSenha")
    public class Usuario implements Serializable {
    @javax.persistence.Id
    @javax.persistence.Column(name = "CD_USUAR", nullable = false)
    @GeneratedValue(strategy=javax.persistence.GenerationType.SEQUENCE, generator="SqUsuario")
    @SequenceGenerator(name="SqUsuario",sequenceName="SQ_USUARIO", allocationSize=20)
    private BigDecimal cdUsuar;
    @javax.persistence.Column(name = "NM_USUAR", nullable = false)
    private String nmUsuar;
    @OneToMany
    @JoinTable(
    name="USUARIO_PROFISSAO",
    joinColumns=@JoinColumn(name="CD_USUAR", referencedColumnName="cdUsuar"),
    inverseJoinColumns=@JoinColumn(name="CD_PROFI", referencedColumnName="cdProfi")
    private java.util.List <sysgroups.entity.Profissao> profissoes;
    // gets and sets...
    @javax.persistence.Entity
    @javax.persistence.Table(name = "PROFISSAO")
    @javax.persistence.NamedQueries( {
    @javax.persistence.NamedQuery(name = "Profissao.findByCdProfi", query = "SELECT p FROM Profissao p WHERE p.cdProfi = :cdProfi"),
    @javax.persistence.NamedQuery(name = "Profissao.findAll", query = "SELECT OBJECT(p) FROM Profissao p"),
    @javax.persistence.NamedQuery(name = "Profissao.findByDsProfi", query = "SELECT p FROM Profissao p WHERE p.dsProfi = :dsProfi")
    public class Profissao implements Serializable {
    @javax.persistence.Id
    @javax.persistence.Column(name = "CD_PROFI", nullable = false)
    private BigDecimal cdProfi;
    @javax.persistence.Column(name = "DS_PROFI")
    private String dsProfi;
    // gets and sets
    The tables are like that:
    USUARIO
    cd_usuar (PK)
    nm_usuar
    PROFISSAO
    cd_profi (PK)
    ds_profi
    USUARIO_PROFISSAO
    cd_usuar
    cd_profi
    And the error appears, for example, when i try to do something like that:
    Usuario usuario = (Usuario)manager.createNamedQuery("Usuario.findByLogin").
    setParameter("dsLogin",login.getLogin()).
    setParameter("dsSenha",login.getSenha()).
    getSingleResult();
    if (usuario.getProfissoes() != null) { // OK
    // Test
    System.out.println("Nr Profissoes = "+ usuario.getProfissoes().size());
    // ERROR...
    enviroment:
    netbeans 5.5 beta 2 Build: 200607190830, Ent. Pack 20060810
    Sun Java System App Server 9
    jdk1.5.0_05
    Guys,
    Sorry my poor english, but I hope u can get the idea.
    Thanks a lot!

    Hello,
    The original posting seems to have defined the relationship mappings joinColumns incorrectly. For instance, in the case of :
    joinColumns=@JoinColumn(name="CD_USUAR", referencedColumnName="cdUsuar"),
    The referencedColumnName should refer to the Database table's Column name, not the object's property name. So USUARIO_PROFISSAO's CD_USUAR column should reference USUARIO's CD_USUAR column, not "cdUsuar" which doesn't exist.
    Check to see your mappings are set up correctly as well.
    Best Regards,
    Chris

  • Toplink JAXB - ClassCastException after redeploy in OC4J

    Hi,
    I'm experiencing an issue casting an unmarshalled object after the application is being redeployed in the container.
    I'm trying to unmarshall an xml that I retrieve as a resource from the classloader (the xml is also in the jar)
    The ClassCastException is being thrown at the point where I try to cast the unmarshalled object. A sysout on the unmarshalled object prints a classtype that I expect, so my first impression is that the cast fails due the ClassLoader used by the JAXBContext (?) So I've tried to create the JAXBContext with the ClassLoader parameter using the class' classloader directly and the contextClassLoader, both unsuccessfull.
    The problem solves after I restart the OC4J container, but for convenience, I would like to solve this without having to restart, if possible.
    Has anyone experienced this problem, or know a solution?
    Thx!
    Bert
    Below, some example code and the console output on the server.
    Code:
    /* create the jaxb context */
    JAXBContext context = JAXBContext.newInstance(
              "be.cm.apps.tpb.common.helper",
         Thread.currentThread().getContextClassLoader());
    if (LOGGER.isDebugEnabled()) {
         LOGGER.debug("JAXBContext=" + context);
    /* create unmarshaller */
    Unmarshaller unmarshaller = context.createUnmarshaller();
    if (LOGGER.isDebugEnabled()) {
         LOGGER.debug("Unmarshaller=" + unmarshaller);
    /* open refac-config.xml as inputstream */
    URL url = Thread.currentThread().getContextClassLoader().getResource(CONFIGURATION);
    if (LOGGER.isDebugEnabled()) {
         LOGGER.debug("url: " + url);
    /* unmarshall the configuration */
    Object unmarshalledObject = unmarshaller.unmarshal(url);
    if (LOGGER.isDebugEnabled()) {
         LOGGER.debug("unmarshalled object: " + unmarshalledObject);
    * THROWS CLASSCASTEXCEPTION AFTER REDEPLOY
    configurationDefinition = (ConfigurationDefinition) unmarshalledObject;
    if (LOGGER.isDebugEnabled()) {
         LOGGER.debug("<- initialize()");
    Output:
    |DEBUG|JAXBContext=oracle.toplink.ox.jaxb.JAXBContext@675f26|º@#
    |DEBUG|Unmarshaller=oracle.toplink.ox.jaxb.JAXBUnmarshaller@97dadf|º@#
    |DEBUG|url: code-source:/C:/java/101310/j2ee/home/applications/tpb/tpb-online-1.0.0.jar!/refac-config.xml|º@#
    |DEBUG|unmarshalled object: be.cm.apps.tpb.common.helper.ConfigurationDefinition@8f310f|º@#
    |ERROR|Unable to create BusinessFacade instance named be.cm.apps.tpb.business.facade.SendingManager|
    Caused by: java.lang.ClassCastException: be.cm.apps.tpb.common.helper.ConfigurationDefinition
    at be.cm.apps.tpb.common.helper.ConfigHelper.initialize(ConfigHelper.java:93)
    ... 83 more

    Hello Bert,
    This is a known issue and there is a patch that is available from Oracle Support. When you contact support please indicate whether you are using TopLink 10.1.3 or 10.1.3.1. Also you can refer Oracle Support to me and I can help them find the correct patch.
    -Blaise

  • Oracle.toplink.essentials.exceptions.ValidationException

    Hi,
    In my EJB 3 application we added a Schema entity to our already existing Student entity.
    I added the followning code in the student entity:
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(
              nullable = true,
              name = "SCHEMA_ID"
    private Schema schema;
    After adding the Schema enity I tried to compile and run the tests. I got the following toplink error message (roughly):
    nternal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: [class se.myapp.subsytem.alpha.Student] uses a non-entity [class se.myapp.subsytem.domain.Schema] as target entity in the relationship attribute [private e.myapp.subsytem.domain.Schema].
    I found out that I had to change the persistence.xml but not why?
    I would be very happy if someone could shed some light in this matter since I have no clue why I must put it in the persistence.xml
    cheers,
    //mike

    You must either annotate every Entity with the @Entity annotation, or map it through the ORM.xml. All Entities must also define an @Id annotation.
    -- James : http://www.eclipselink.org

  • Oracle.toplink.internal.helper.NonSynchronizedVector exception

    I get following exception when invoking session bean from EJB client generated by JDev (EJB JPA project). Session bean returns the list of value objects created using TopLink Essentials based JPA native query. Does anybody know what is causing this exception and if there is a workaround?
    java.lang.ClassCastException: oracle.toplink.internal.helper.NonSynchronizedVector
    List<ProfileBasicVO> profiles = searchFacade.queryBasicProfilesByLastName( partialName );
    I get exception at this point:
    for( ProfileBasicVO profile: profiles ) {
    System.out.println( "lastName = " + profile.getLastName() );
    ...

    I changed the code to return List and I added mapping as a second parameter:
    public List queryBasicProfilesByLastName(String partialName) {
    Query basicProfileQuery =em.createNativeQuery( "findBasicProfilesByLastName", "BasicProfileResults" );
    return basicProfileQuery.getResultList();
    It fails with following exception:
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    and the query is defined as
    <query>
    select o.last_name as LAST_NAME,
    o.first_name as FIRST_NAME,
    o.middle_name as MIDDLE_NAME,
    o.birth_date as BIRTH_DATE,
    o.sex_code as SEX_CODE,
    a.height_cm as HEIGHT_CM,
    a.weight_kg as WEIGHT_KG,
    o.PERSON_ID as PERSON_ID
    from offenders o,
    person_bookings b,
    person_physical_attributes a
    where o.PERSON_ID = b.PERSON_ID
    and b.PERSON_BOOK_ID = a.PERSON_BOOK_ID
    and o.last_name = 'POTTER'
    </query>
    Mapping is defined as:
    <sql-result-set-mapping name="BasicProfileResults">     
    <entity-result entity-class="entities.Persons">
    <field-result column="LAST_NAME" name="lastName"/>
    <field-result column="FIRST_NAME" name="firstName"/>
    <field-result column="MIDDLE_NAME" name="middleName"/>
    <field-result column="BIRTH_DATE" name="birthDate"/>
    <field-result column="SEX_CODE" name="sexCode"/>
    <field-result column="PERSON_ID" name="personId"/>
    </entity-result>
    <entity-result entity-class="entities.PersonPhysicalAttributes">
    <field-result column="HEIGHT_CM" name="heightCm"/>
    <field-result column="WEIGHT_KG" name="weightKg"/>
    </entity-result>
    </sql-result-set-mapping>
    I can execute the query manually without problem, i.e. it is valid query, but I still get exception

  • Oracle Toplink Version issue

    Oracle Toplink Version
    Hi all,
    Can i know which version of toplink is stable?
    currently i am using toplink v9.0.3 for our project.i found in the same forum that there is a bug(#2662726) in v9.0.3 related to improper setting of target foreign key and a suggestion to use v9.0.3.2 where bug had been fixed.
    I am unable to find v9.0.3.2 download in oracle site.I found only the latest versions 9.0.4(10g product).I tried to install toplink 10g which is just an extraction of zip file,but i end up with the error "Windows cannot find '-Xmx128m' file" when i tried to start workbench.cmd
    I found somewhere that there is a work-around for that bug - just reversing the feild names of addTargetForeignKeyFeildName() method.
    I don't want to take risk.
    please suggest me correct stable versions and place of downloads of both App.server and toplink
    our Oracle Application server version is 9.0.3. if i am going to use the latest version of toplink,can it solve the issue mentioned above and also can it be compatible with app server version.
    Thanks in advance.
    Regards,
    Karthick.

    Hi doug,
    Thanks for ur immediate response.
    I had installed the latest patchset 9.0.3.6 and tried to generate project java source using workbench.
    now the foreign key mapping problem is O.K. but i am having problems in the generated persistent classes code.
    I am having certain feilds in a table in Oracle Database of type Number of size varying from 1 - 6. I used workbench to generate code for that table. In that i found that all attributes which has direct to feild mapping to a Number datatype in Database is of type Double(irrespective of size even for Number(1)).
    I think it is a huge memory wastage having Double where an Integer or other types will do.
    I would be very grateful if u help me in this regards.
    -karthick.

  • How-to use custom data sources with OracleAS TopLink

    Does anyone know if there is an updated version of this dcoument ?
    I am having difficulties attempting to extend OracleAS TopLink to Support Custom Type Conversions.
    Some of the links on this tutorial are broken
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/customconversion/index.html
    Please help
    Thanks,
    John

    Doug,
    I may have been making a mountain out of a molehill.....
    My problem while generating classes & descriptors was that Numbers from my Tables were being converted to BigDecimals.
    I want these to be converted to Integers automatically as I am importing from approx 100 tables & don't want to update each mapping.
    Is there a quick & easy way to achieve this ?
    (I'm not being lazy & have spent 1/2 a day attempting to find this solution)
    Many thanks,
    John

  • Oracle TopLink Object-to-XML - issue JAXBException: Provider not found...

    Env:
    OS:XP
    Java dev env: JDev 10.1.2 production
    Toplink Workbench - 10g Developer Preview 3 (10.1.3.0) build 041116
    I am attempting to use the toplink object to xml functionality through carefully following the tutorial titled Oracle TopLink Object-to-XML on OTN (link: http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/ox/index.htm)
    The first 11 steps are nice and clear and very easy to follow. However, when I hit 12 I run into problems. I believe I have done all I am required to do.
    My demo test code falls over on the attempting to create the JAXB context:
    JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model");
    The exception I get is:
    javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory not found
    - with linked exception:
    [java.lang.ClassNotFoundException: oracle.toplink.ox.jaxb.JAXBContextFactory ]
    The code is capable of loading the jaxb.properties file, and has toplink.jar in the classpath. I am able to create a is located JAXBContextFactory prior to calling the new instance logic, illustrating that the class is in the classpath.
    Using google I have seen it mentioned that the newInstance call could be making use of a different JVM to the Application (https://jaxb.dev.java.net/faq/#classloader) hence may not be able to pick up the JAXBContextFactory class. I have attempted to follow their advice of passing in a class loader - but this makes no difference.
    I.E. JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model", this.getClass().getClassLoader());
    Does anyone recognise this issue and have a solution.
    Here is my code:
    try
    File file = new File("D:\\Toplink\\demo\\Customer-data.xml");
    JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model);
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    Customer customer = (Customer) unmarshaller.unmarshal(file);
    System.out.println(" customer.getFirstName() : "+customer.getFirstName());
    catch(Exception e)
    System.out.println("Error: "+ e.toString());
    As mentioned earlier it falls over on JAXBContext.newInstance("examples.ox.model);
    cheers
    Nick

    Hi Blaise,
    thanks for your response.
    My session.xml file is located:
    D:\Toplink\demo\classes\session.xml
    And contains:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <toplink-sessions version="10g Developer Preview 3 (10.1.3.0 )" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="database-session">
    <name>examples.ox.model</name>
    <event-listener-classes/>
    <primary-project xsi:type="xml">D:/Toplink/demo/classes/CustomerProject.xml</primary-project>
    <login xsi:type="xml-login"/>
    </session>
    </toplink-sessions>
    My classpath references only jars downloaded with the links on the How To tutorial titled Oracle TopLink Object-to-XML on OTN (link: http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/ox/index.htm)
    This is the JDev output indicating the classpath and error:
    D:\Jdev1013Preview\jdk\bin\javaw.exe -ojvm -classpath D:\Toplink\demo\classes;D:\Toplink\lib\xml.jar;D:\Toplink\lib\xmlparserv2.jar;D:\Toplink\toplink\jlib\tljaxb.jar;D:\Toplink\toplink\jlib\toplink.jar examples.ox.model.RunDemo
    Error: javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory not found
    - with linked exception:
    [java.lang.ClassNotFoundException: oracle.toplink.ox.jaxb.JAXBContextFactory
    Process exited with exit code 0.
    Any more suggestions?
    In the meantime I will go through the information on the link that you have sent and see if I can get anyfurther.
    Thanks
    Nick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • GridBagLayout Messing Up

    here is my GUI import java.awt.*; import javax.swing.*; import java.util.*; public class Update      ImageIcon logoimg;      JLabel logo;      JButton check;      JButton launch;      public static void main(String[] args)           new Update();    

  • Switching jpanels implemented in different classes

    Hi, I'm quite new to swing applications (not to java) and I run into a problem I couldn't solve. I got a frame and in that frame a jMenu and a jPanel. I want to create an application where you have to log in, so my first jPanel represents the login (

  • Out of the box web part automatically redirect to another page while setting properties

    Hi I have a situation where by if I click the + sign in front of a grouped property to customize the individual properties of a web part - the web part automatically redirects away to another page. A typical example is the "Table of Content" web part

  • HT4481 how do i upgrade from os 10.5.8 to 10.6.5 or higher?

    how do i upgrade from os 10.5.8 to 10.6.5 or higher?

  • Year Specific Batch Numbers in SAP

    Hi All Can we have year specific batch numbers in SAP. I would like to define internal batch numbers year wise. Every year this numbers have to be reset. Pls help in finding a solution.