0

私はGitリポジトリからプロジェクトをインポートしました.ESBにデプロイしようとすると、デプロイメントが失敗し、プロパティファイルが見つかりません。 //org.springframework.beans.factory.BeanInitializationException:プロパティを読み込めませんでした。ネストされた例外はjava.io.FileNotFoundExceptionです:クラスパスリソース[config.properties]が存在しないためオープンできません at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBean Factory(PropertyResourceConfigurer.java:89)〜 [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors (PostProcessorRegistrationDelegate.java:265)〜[spring-context-4.1.6。 RELEASE.jar:4.1.6.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors (PostProcessorRegistrationDelegate.java:162)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE] ]Filenot Mule 3.8の.propertiesファイルから読み込み中に例外が発生しました

私は複数の環境の詳細にプロパティファイルを使用しています。環境名に基づいて、私はファイルを取り出してsrc/main/resourcesフォルダの下にコピーしています。しかし、ファイルが適切にピックアップされ、src/main/resourcesの場所にコピーされていることがわかりましたが。 他のものは、それを正常に展開できたようです。私はsrc/main/resourcesフォルダにプロパティファイルを移動しようとしましたが、同じ結果が出ました。 ESBが/ src/main/resourcesにあるプロパティファイルを見つけることができないのはなぜですか?

ここでは、コードスニペットです:

答えて

0

あなたのクラスパスにあなたのconfig.propertiesファイルを保持し、

<context:property-placeholder location="config.properties" /> 
以下のようにそれを参照してください。
関連する問題