2010-12-07 8 views
1

도메인 객체의 멤버 유형을 OracleXmlType으로 매핑하려고합니다. Graeme Rocher의 제안에 따라 here에 xmlparserv2.jar를 클래스 경로에 추가하는 방법과 정적 매핑을 선언하는 방법을 설명하는 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를 추가합니다. 클래스 경로 병)이있는

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

결과

,617 나는 내 마지막 호출과 같은 클래스 경로를 사용하고이 내 매핑을 변경하는 경우
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 파일을 응용 프로그램과 함께 배포하고 도움이되는지 확인하십시오.