3 Replies Latest reply: Mar 21, 2012 10:01 AM by JamesSutherland RSS

    Toplink initialization error

    513073
      Hi all!
      I have an Exception while my toplink app is initializing:
      The error

      Exception occurred while initializing property group, BBPersistenceConfig, in configuration file persistence-config.xml.
      Exception [TOPLINK-9005] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build RELEASE)): oracle.toplink.exceptions.SessionLoaderException
      Exception Description: An exception was thrown while loading the <project-xml> file [db-mappings.xml].
      Internal Exception: Exception [TOPLINK-106] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build RELEASE)): oracle.toplink.exceptions.DescriptorException
      Exception Description: The method [setDescriptorTypeValue] on the object is throwing an exception.
      Argument: [null]
      Internal Exception: java.lang.reflect.InvocationTargetException
      Target Invocation Exception: java.lang.NullPointerException
      Mapping: oracle.toplink.ox.mappings.XMLDirectMapping[descriptorTypeValue-->toplink:descriptor-type/text()]
      Descriptor: XMLDescriptor(oracle.toplink.internal.descriptors.RootDescriptor --> [DatabaseTable(class-mapping-descriptor)])
           at oracle.toplink.exceptions.SessionLoaderException.failedToLoadProjectXml(SessionLoaderException.java:74)
           at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.loadProjectConfig(TopLinkSessionsFactory.java:316)
           at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.createSession(TopLinkSessionsFactory.java:241)
           at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildServerSessionConfig(TopLinkSessionsFactory.java:215)
           at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildSession(TopLinkSessionsFactory.java:168)
           at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildTopLinkSessions(TopLinkSessionsFactory.java:124)
           at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:103)
           at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:367)
           at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:334)
           ... 24 more

      DB_MAPPING.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <toplink:object-persistence version="Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <opm:name>TEST</opm:name>
      <opm:class-mapping-descriptors>
           <opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
           <opm:class>foo.Customer</opm:class>
           <opm:alias>Customer</opm:alias>
           <opm:primary-key>
           <opm:field table="CUSTOMER" name="EMAIL" xsi:type="opm:column"/>
           </opm:primary-key>
           <opm:events xsi:type="toplink:event-policy"/>
           <opm:attribute-mappings>
                <opm:attribute-mapping xsi:type="toplink:direct-mapping">
           <opm:attribute-name>eMail</opm:attribute-name>
           <opm:field table="CUSTOMER" name="EMAIL" xsi:type="opm:column"/>
           </opm:attribute-mapping>
           <opm:attribute-mapping xsi:type="toplink:direct-mapping">
           <opm:attribute-name>name</opm:attribute-name>
           <opm:field table="CUSTOMER" name="NAME" xsi:type="opm:column"/>
           </opm:attribute-mapping>
           </opm:attribute-mappings>
           </opm:class-mapping-descriptor>
           </opm:class-mapping-descriptors>
      </toplink:object-persistence>

      Any help? Thanks!!

      Edited by: rengo.Java on Mar 20, 2012 11:31 AM
        • 1. Re: Toplink initialization error
          cdelahun
          How was this generated, and is there any reason why you are not using the latest 10.1.3 patchset (10.1.3.5 I believe)?

          Try adding the
          <opm:querying xsi:type="toplink:query-policy"/>
          tag just after the event-policy tag but before the attribute-mappings. If this doesn't work, please show the full error stack trace as well as how you have configured your classpath and the xml parser being used.

          Best Regards,
          Chris
          • 2. Re: Toplink initialization error
            JamesSutherland
            Seems like the xsi:type in your file is being read as null.

            What did you change to get this error? Do you have other xml files that work?

            10.1.3 is very old.
            • 3. Re: Toplink initialization error
              513073
              Thanks for the aswers.
              Was my mistake...
              I forget to put the tale info in the xml:
              <toplink:descriptor-type>independent</toplink:descriptor-type>
                   <toplink:instantiation/>
                   <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
                   <toplink:change-policy xsi:type="toplink:deferred-detection-change-policy"/>
                   <toplink:tables>
                   <toplink:table name="CUSTOMERS"/>
                   </toplink:tables>

              Thanks a lot!