2012-09-10 2 views
6

전 직장에서 전직 직원이 남긴 시스템을 실행하려고하는데 문제가 있습니다.Spring XSD의 액세스 오류

Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 

그리고 XSD는 로컬 액세스에 의해 실행되는 경우가 :

<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xmlns:tx="http://www.springframework.org/schema/tx" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
      classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd 
      http://www.springframework.org/schema/tx 
      classpath:org/springframework/transaction/config/spring-tx-3.0.xsd 
      http://www.springframework.org/schema/context 
      classpath:org/springframework/context/config/spring-context-3.0.xsd 
      http://www.springframework.org/schema/tool 
      classpath:org/springframework/beans/factory/xml/spring-tool-3.0.xsd"> 

그것을

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans.xsd 
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-3.0.xsd 
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx.xsd"> 

그것은이 발견되지 예외를 제공합니다

XSD를 원격 액세스에 의해 실행되는 경우

이 예외는 다음과 같습니다.

C:\Users\claudiomazur>java -jar c:\temp\fin\c.jar 
0 [AWT-EventQueue-0] INFO support.ClassPathXmlApplicationContext - Refreshing org[email protected]4fa52fdf: startup date [Thu Sep 06 
11:22:59 BRT 2012]; root of context hierarchy 
45 [AWT-EventQueue-0] INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [context.xml] 
Exception in thread "AWT-EventQueue-0" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for 
XML schema namespace [http://www.springframework.org/schema/context] 
Offending resource: class path resource [context.xml] 

     at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) 

이 아이디어를 해결하기위한 몇 가지 아이디어가 있습니까?

큰 포옹!

+0

에? – user1516873

+0

나는 그것에 대해 모른다. – claudioivp

답변

9

스프링 XDS는 스프링 용기로 정의되어 제공됩니다! 예를 들어, spring-context.jarspring-context-3.0.xsd을 포함합니다. (spring-context.jar/META-INF/spring.schema)

프로젝트에이 병이 있는지 확인하십시오.

그래서 "원격"이라고하는 것은 정말 원격지가 아닙니다! 그리고 나는 당신이 "로컬 액세스"라고 불렀던 것을 결코 보지 못했고, 그래서 나는 왜 "원격"(원격이 아닌) 것들이 모든 xsd에서 작동하지만 스프링 컨텍스트에서 작동하는지 확인하려고 할 것입니다. 이 바탕 화면 프로그램이며 다른 모든 폭발 단지를 포함하는 하나의 항아리를 사용하는 경우


는, 당신은 걸릴 치료를 필요로하는 다른 봄-XXX에서 단일 spring.handlersspring.schames 파일의 내용 .jar는 (두 개의) "hunge"파일로 결합됩니다. 결국이 두 파일에는 모든 스키마 이름과 핸들러 이름이 포함됩니다.

+0

는 생각 예,이 종속성에서 : ' code' org.springframework'user1618606 @ – claudioivp

+0

을 code' 3.0.6.RELEASE 스프링 컨텍스트 : 정말 확인 뜻! 이 파일이 서버에 배포 된 WAR 내에 있는지 확인하십시오. – Ralph

+0

예 ... 전체 경로에 있습니다. C : \ Users \ claudiomazur \ .m2 \ repository \ org \ springframework \ spring-context \ 3.0.6.RELEASE \ spring-context-3.0.6.RELEASE.jar – claudioivp

2

시도해보십시오 wget http://www.springframework.org/schema/context/spring-context-3.0.xsd.

should be something like: wget http://www.springframework.org/schema/context/spring-context-3.0.xsd 
--2012-09-10 15:56:05-- http://www.springframework.org/schema/context/spring-context-3.0.xsd 
Resolving www.springframework.org... 205.140.197.88 
Connecting to www.springframework.org|205.140.197.88|:80... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 19651 (19K) [text/xml] 
Saving to: “spring-context-3.0.xsd” 

100%[=====================================================================>] 19,651  24.6K/s in 0.8s  

2012-09-10 15:56:06 (24.6 KB/s) - “spring-context-3.0.xsd” saved [19651/19651] 

xsd 스키마를 가져 오는 데 문제가 있으면이 스키마를 상속 한 xml 파일로 작업하기가 어렵습니다.

두 번째 경우에는 classpath에 spring - * - 3.0.xsd 파일이 없어도됩니다.

+0

@ 랄프 예, 당신은 최선을 다합니다. 그러나 문제 행동에 묘사 된 것은 평범하지 않습니다. 파서가 메타 인바운드에 정의 된 것을 사용하지 않는 것 같습니다. – user1516873

+0

죄송합니다. 내 잘못을 읽었습니다. 올바른 답을 읽지 못했습니다. xsd 파일을 검사 해 보시기 바랍니다. – Ralph

+0

모든 인터넷 보호 기능을 사용할 수 없게되었습니다. 이제는 xsd에 액세스하고 있습니다 ... 그러나 이제는 마지막 예외가 있습니다. 에 대한 Spring NamespaceHandler를 찾을 수 없습니다. XML 스키마 네임 스페이스 [http://www.springframework.org/schema/context ] 잘못된 리소스 : 클래스 경로 리소스 [context.xml] – claudioivp

3

스프링 XSD가 항아리와 함께 선적 된 것은 사실입니다.

이 XSD 년대이 저장되는 정보 :

  1. 는 XML 파일에 말할 수 있습니다, "우리는 콩 네임 스페이스를 사용하고 우리는 파일을 확인하시기 바랍니다

    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    
  2. 으로 볼 필요가 spring-schemas "META-INF 폴더의 spring-beans-4.0.1.RELEASE.jar.이 파일에서 샘플 컨텍스트해야한다 : 따라서

    http\://www.springframework.org/schema/beans/spring-beans-4.0.xsd 
    =org/springframework/beans/factory/xml/spring-beans-4.0.xsd 
    
    http\://www.springframework.org/schema/beans/spring-beans.xsd 
    =org/springframework/beans/factory/xml/spring-beans-4.0.xsd 
    
  3.  http\://www.springframework.org/schema/beans/spring-beans.xsd is mapped to  
        org/springframework/beans/factory/xml/spring-beans-4.0.xsd 
    

    당신의 항아리 무엇 XML 파서는 응용 프로그램에서 사용