Я пытаюсь интегрировать экспорт сеансов toplink с моим процессом сборки (Apache Ant).Я работал на следующем примере: http://download.oracle.com/docs/cd/E14571_01/web.1111/b32441/mw.htm
Моя цель инициализации Ant и цель проверки сеанса показаны ниже:
<!-- ============
init Target
============== -->
<target name="init">
<property name = "toplink.home" value = "C:/APPS/OC4J/toplink"/>
<property name = "oracle.home" value = "C:/APPS/OC4J"/>
<property name = "toplink.log.dir" value = "${basedir}/../toplinklogs"/>
<property name = "toplink.mwp.dir" value = "${basedir}/../java/mwb"/>
<property name = "toplink.sessions.dir" value = "${basedir}/config"/>
<property name = " myProject.classes" value = "${basedir}/../java/classes "/>
<path id = "database.classpath">
<pathelement path = "${oracle.home}/lib/dms.jar"/>
</path>
<path id = "toplink.classpath">
<pathelement path = "${toplink.home}/jlib/toplink.jar"/>
<pathelement path = "${oracle.home}/j2ee/home/lib/ejb.jar"/>
<pathelement path = "${oracle.home}/lib/xmlparserv2.jar"/>
<pathelement path = "${toplink.home}/jlib/antlr.jar"/>
</path>
<path id = "mw.classpath">
<pathelement path = "${toplink.home}/jlib/tlmwcore.jar"/>
<pathelement path = "${toplink.home}/jlib/toplinkmw.jar"/>
</path>
<path id = "mwplatforms.classpath">
<pathelement path = "${toplink.home}/config"/>
</path>
<typedef file = "${basedir}/toplink-ant-lib.xml" classpathref = "mw.classpath" uri = "toplinklib" />
</target>
<!-- ======================
validate session Target
======================= -->
<target name="validate.session" depends="export.project" if="export-completed">
<toplink:session.validate
sessionsfile = "${basedir}/../java/src/aquila/administrator/accounting/config/toplink/AccountingMapping.xml"
sessionname = "AccountingMapping"
property = "session-valid"
classpathref = "toplink.classpath"
classpath = "${myProject.classes}" >
<toplink:classpath refid = "mw.classpath" />
<toplink:classpath refid = "database.classpath" />
<toplink:loginspec refid = "loginSpec" />
</toplink:session.validate>
</target>
Я получаю следующие ошибки от ant:
validate.session:
[toplink:session.validate] An error occured while validating project:
[toplink:session.validate] Exception Description: Several [3] SessionLoaderExceptions were thrown:
BUILD FAILED
C:\Eclipse\Administrator\ant\example.xml:105: An error occured while validating project:
Exception Description: Several [3] SessionLoaderExceptions were thrown:
Когда я включаю подробный режим в ant, я вижу более подробную информацию об ошибке:
Local Exception Stack:
Exception [TOPLINK-9001] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.SessionLoaderException
Exception Description: Unknown tag name: [toplink:login] in XML node: [toplink:object-persistence].
Internal Exception: java.lang.NoSuchMethodException: oracle.toplink.tools.sessionconfiguration.XMLLoader.process_toplink:login_Tag(org.w3c.dom.Node, oracle.toplink.tools.sessionconfiguration.XMLLoader$ObjectHolder)
Local Exception Stack:
Exception [TOPLINK-9001] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.SessionLoaderException
Exception Description: Unknown tag name: [opm:class-mapping-descriptors] in XML node: [toplink:object-persistence].
Internal Exception: java.lang.NoSuchMethodException: oracle.toplink.tools.sessionconfiguration.XMLLoader.process_opm:class_mapping_descriptors_Tag(org.w3c.dom.Node, oracle.toplink.tools.sessionconfiguration.XMLLoader$ObjectHolder)
Local Exception Stack:
Exception [TOPLINK-9001] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.SessionLoaderException
Exception Description: Unknown tag name: [opm:name] in XML node: [toplink:object-persistence].
Internal Exception: java.lang.NoSuchMethodException: oracle.toplink.tools.sessionconfiguration.XMLLoader.process_opm:name_Tag(org.w3c.dom.Node, oracle.toplink.tools.sessionconfiguration.XMLLoader$ObjectHolder)
Показанные выше 3 ошибки соответствуют 3 тегам на одном уровне вфайл session.xml.Я проверил этот процесс проверки с помощью файла session.xml, сгенерированного из рабочей среды, и он тоже не удался.Поскольку это исключение NoSuchMethodException, похоже, что мой процесс ant не находит класс oracle.toplink.tools.sessionconfiguration.XMLLoader, но находится в toplink.jar, который находится в пути к классам.1015 *