0

Java と Spring を使用してアプリを開発しており、それを AppFog にアップロードしようとしています。

アプリケーションは正常に動作しており、AppFog では動作していますが、Eclipse ではapplicationContext.xmlファイルに非常に厄介なエラーが表示されます。

AppFog のドキュメントによると、次のように設定する必要があります: Spring - AppFog Documentation

私のapplicationContext.xmlのスニペット

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

<cloud:data-source id="dataSource">

タグcloud:data sourceでエラーが発生しています:

Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://schema.cloudfoundry.org/spring/cloudfoundry-spring.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>.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'cloud:data-source'.

さまざまなバージョンで試しましたhttp://schema.cloudfoundry.org/spring/cloudfoundry-spring-0.8.xsdが、常に同じエラーが発生します。

次のライブラリも pom に含めました。

<dependency>
    <groupId>org.cloudfoundry</groupId>
    <artifactId>cloudfoundry-runtime</artifactId>
    <version>0.8.1</version>
</dependency>

いくつかのアイデア?

ありがとう!

4

1 に答える 1

0

したがって、アプリはローカルおよび AppFog で動作しているように見えますが、問題は Eclipse の検証エラーです。Spring Tool Suite プラグインを使用していますか? ここで実際に起こるべきことは、スキーマが Spring Jar ファイル内にあることです (ソースは Github https://github.com/cloudfoundry/vcap-java/blob/master/cloudfoundry-runtime/src/main/resourcesにあります)。 /META-INF/spring.schemas ) - Eclipse にそこで解決するように指示する方法が必要だと思います。STS は実際に解決方法を知っていると思います。

于 2013-07-22T17:18:32.033 に答える