0

activemqブローカーで使用される次のスキーマがあります。-

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:amq="http://activemq.apache.org/schema/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
         http://www.springframework.org/schema/beans
         file:////u//amqgod//schema//spring-beans.xsd
         http://activemq.apache.org/schema/core
         file:////u//amqgod//schema//activemq.xsd">

コマンドラインからアプリケーションを起動すると正常に実行されますが、initdメカニズムを介して起動すると次のエラーで失敗します:-

エラー:java.lang.RuntimeException:開始タスクの実行に失敗しました。理由:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:URL [file:/prod/tools/base/etc/config/activemq/amq_prod_broker_config.xml]のXMLドキュメントの23行目が無効です。ネストされた例外はorg.xml.sax.SAXParseExceptionです。l ineNumber:23; columnNumber:52; cvc-elt.1:要素'beans'の宣言が見つかりません。java.lang.RuntimeException:開始タスクの実行に失敗しました。理由:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:URL [file:/prod/tools/base/etc/config/activemq/amq_prod_broker_config.xml]のXMLドキュメントの23行目が無効です。ネストされた例外はorg.xml.sax.SAXParseExceptionです。lineNumb er:23; columnNumber:52; cvc-elt.1:要素'beans'の宣言が見つかりません。組織で。

initdは、Linuxサーバーの再起動時にスクリプトを自動的に実行するための構成に他なりません。助けてください?

4

2 に答える 2

0

私はこれに少し遅れています。同様の問題に直面しました。これは、正しい依存関係を含めることで解決できます

<dependency>
   <groupId>org.apache.activemq</groupId>
   <artifactId>activemq-all</artifactId>
   <version>5.10.0</version>
</dependency>

またはここからダウンロードできます xsd を XBeanNamespaceHandler に登録するには、これらの構成は既に完了しています ( spring.handlers および spring.schemas は jar の META-INF フォルダーにあります) 。

于 2015-02-08T15:32:54.560 に答える
0

あなたのスキーマの場所は奇妙です: なぜいくつかの file:// で xsd を指定するのですか?

元の xsd を保持します (Spring、apcache などから)。次のように、file:// を http:// に置き換えるだけです。

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd   
  http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
于 2012-08-14T12:44:54.827 に答える