2010-12-07 6 views
1

ドメイン・オブジェクトのメンバー・タイプをOracleXmlTypeにマップしようとしています。私はクラスパスにxmlparserv2.jarを追加することに関してGraeme Rocherの提案 hereと、静的マッピングを宣言する方法を説明するthis postを提案しました。私はGrailsのOracleXmlType

のGrailsでGrailsのを起動した場合-cp%ORACLE_LIBS%/ xmlparserv2.jarの実行アプリ私は、次を得る

:これで

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の実装を提供する必要がありますか?

ありがとうございます。

答えて

0

これを修正するかどうかはわかりませんが、glassfishのJSFアプリケーションからXDBを使用した場合の問題とよく似ています。問題は、xmlparserv2.jarが古いXMLライブラリを登録していて、一部のサーバーコンポーネントで動作しないことです。

tempディレクトリを作成し、そのディレクトリにunjar xmlparserv2.jarを作成し、META-INF/servicesディレクトリを削除してバックアップし直します。今度は、変更されたjarファイルをアプリケーションとともにデプロイし、役立つかどうか確認してください。