OracleXmlType в Grails - PullRequest
       1

OracleXmlType в Grails

1 голос
/ 07 декабря 2010

Я пытаюсь сопоставить тип члена объекта домена с OracleXmlType.Я последовал предложению Грэма Роше здесь относительно добавления xmlparserv2.jar в путь к классам, а также этого поста , описывающего, как объявлять статическое отображение.Если я запускаю Grails с

grails -cp% ORACLE_LIBS% / xmlparserv2.jar run-app

, я получаю следующее:

2010-12-07 11:25:41,532 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"
        at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
        at grails.spring.BeanBuilder.beans(BeanBuilder.java:573)
        at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:519)
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
        at grails.web.container.EmbeddableServer$start.call(Unknown Source)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
        at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
        at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
        at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
        at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at grails.spring.DynamicElementReader.invokeMethod(DynamicElementReader.groovy:121)
        ... 26 more

Начиная с Grails (добавьте xdb.jar в путь к классам):

>grails -cp %ORACLE_LIBS%/xmlparserv2.jar:%ORACLE_LIBS%/xdb.jar run-app

приведет к следующему:

Running Grails application..
2010-12-07 11:15:23,497 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomainException: Error evaluating ORM mappings block for domain [com.mydomain.DropFile]:  No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomainException: Error evaluating ORM mappings block for domain [com.mydomain.DropFile]:  No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
        at grails.web.container.EmbeddableServer$start.call(Unknown Source)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
        at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
        at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
        at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
        at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomainException: Error evaluating ORM mappings block
for domain [com.mydomain.DropFile]:  No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
        ... 23 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomainException: Error evaluating ORM mappings block for domain [com.mydomain.DropFile]:  No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
        ... 23 more
Caused by: org.codehaus.groovy.grails.exceptions.GrailsDomainException: Error evaluating ORM mappings block for domain [com.mydomain.DropFile]:  No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
        ... 23 more
Caused by: groovy.lang.MissingPropertyException: No such property: OracleXmlType for class: org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
        at com.mydomain.DropFile$__clinit__closure2.doCall(DropFile.groovy:24)
        at com.mydomain.DropFile$__clinit__closure2.doCall(DropFile.groovy)
        ... 23 more

Если я использую тот же путь к классам, что и мой последний вызов, и изменить свойсопоставление с этим:

static mapping = {
    xmlContent type:"OracleXmlType" // quotes around OracleXmlType
}

... Я получаю это:

Running Grails application..
2010-12-07 11:30:24,589 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: OracleXmlType, at table: drop_file, for columns: [org.hibernate.mapping.Column(xml_content)]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: OracleXmlType, at table: drop_file, for columns: [org.hibernate.mapping.Column(xml_content)]
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
        at grails.web.container.EmbeddableServer$start.call(Unknown Source)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
        at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
        at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
        at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
        at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: OracleXmlType, at table: drop_file, for columns: [org.hibernate.mapping.Column(xml_content)]
        ... 23 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: OracleXmlType, at table: drop_file, for columns: [org.hibernate.mapping.Column(xml_content)]
        ... 23 more
Caused by: org.hibernate.MappingException: Could not determine type for: OracleXmlType, at table: drop_file, for columns: [org.hibernate.mapping.Column(xml_content)]
        ... 23 more

Вторая и третья попытки кажутся близкими.Может ли кто-нибудь пролить свет на то, что мне не хватает?Нужно ли предоставлять реализацию OracleXmlType?

Заранее спасибо.

1 Ответ

0 голосов
/ 08 декабря 2010

Я не уверен, что это исправит это, но это звучит очень похоже на проблему, с которой я столкнулся при использовании XDB из приложения JSF в glassfish. Проблема заключалась в том, что xmlparserv2.jar регистрирует старую библиотеку XML, которая не работает с некоторыми компонентами сервера.

Создайте временный каталог, разархивируйте в него xmlparserv2.jar, удалите каталог META-INF / services и затем выполните его резервное копирование. Теперь разверните этот модифицированный jar-файл вместе с приложением и посмотрите, поможет ли он.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...