2017-10-12 13 views
0

私のramlファイルは以下のようになるはずです。私のインターフェースを実行中にエラーメッセージの下になってramlの操作方法は?

#%RAML 0.8 
title: Contact 
version: 1 
baseUri: http://abc/api/{version} 
traits: 
    - client-id-required: 
     queryParameters: 
     client_id: 
      type: string 
     client_secret: 
      type: string 
/contact: 
    post: 
    is: [client-id-required] 
    description: Create a new contact record 
    body: 
     application/json: 
     example: !include contactCreateReq_sample.json 
     schema: !include contactCreateReq.json 
    responses: 
     200: 
     body: 
      application/json: 
      example: !include contactCreateRes_sample.json 
      schema: !include contactCreateRes.json 
    put: 
    is: [client-id-required] 
    description: update a customer record 
    body: 
     application/json: 
     example: !include contactUpdateReq_sample.json 
     schema: !include contactUpdateReq.json 
    responses: 
     200: 
     body: 
      application/json: 
      example: !include contactUpdateRes_sample.json 
      schema: !include contactUpdateRes.json 
    delete: 
    is: [client-id-required] 
    description: update a customer record 
    body: 
     application/json: 
     example: !include contactUpdateReq_sample.json 
     schema: !include contactUpdateReq.json 
    responses: 
     200: 
     body: 
      application/json: 
      example: !include contactUpdateRes_sample.json 
      schema: !include contactUpdateRes.json  
    /{functionId}: 
    post: 
     is: [client-id-required] 
     description: Create a new contact function record 
     responses: 
     200: 
      body: 
      application/json: 
       example: !include contactCreateReq_sample.json 
       schema: !include contactCreateReq.json 
    put: 
     is: [client-id-required] 
     description: Update an existing contact function record 
     responses: 
     200: 
      body: 
      application/json: 
       example: !include contactUpdateRes_sample.json 
       schema: !include contactUpdateRes.json 

、私はすべてのRAMLファイルの例では、同じ種類のエラーを取得してRAMLファイルのカップルを持っています。それは私のローカルマシンで実行しようとしている生産のインターフェイスを動作されていると上記のエラーがあります。私のコードに何かがないことを教えてください。

ERROR 2017-10-12 13:02:26,292 [main] org.mule.module.launcher.application.DefaultMuleApplication: null 
org.mule.module.apikit.exception.ApikitRuntimeException: Invalid API descriptor -- errors found: 1 

RAML resource not found -- file: contact.raml 

    at org.mule.module.apikit.parser.ParserWrapperV1.validate(ParserWrapperV1.java:68) ~[mule-module-apikit-3.8.5-HF1.jar:?] 
    at org.mule.module.apikit.ParserService.validateRaml(ParserService.java:86) ~[mule-module-apikit-3.8.5-HF1.jar:?] 
    at org.mule.module.apikit.AbstractConfiguration.initialise(AbstractConfiguration.java:112) ~[mule-module-apikit-3.8.5-HF1.jar:?] 
    at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source) ~[?:?] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121] 
    at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:71) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:99) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:71) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:155) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:126) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.registry.AbstractRegistry.fireLifecycle(AbstractRegistry.java:146) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:116) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:177) ~[mule-module-spring-config-3.8.5.jar:3.8.5] 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:100) ~[mule-module-spring-config-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:102) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:54) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:203) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:63) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:136) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:58) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:317) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:172) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:261) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:76) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:279) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:151) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:134) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:172) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121] 
    at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:33) ~[tooling-support-3.8.5.jar:?] 
INFO 2017-10-12 13:02:26,292 [main] org.mule.module.launcher.application.DefaultMuleApplication: App 'sfdc-sap-api-interface-v4.7-prod' never started, nothing to dispose of 
ERROR 2017-10-12 13:02:26,307 [main] org.mule.module.launcher.DefaultArchiveDeployer: 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
+ Failed to deploy artifact        + 
+ 'sfdc-sap-api-interface-v4.7-prod', see below   + 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
org.mule.module.launcher.DeploymentInitException: ApikitRuntimeException: Invalid API descriptor -- errors found: 1 

RAML resource not found -- file: contact.raml 

    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:212) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:63) ~[mule-module-launcher-3.8.5.jar:3.8.5] 
    at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:136) ~[mule-module-launcher-3.8.5.jar:3.8.5] 

答えて

1

このエラーは、アプリケーションがビルド中にクラスパスにramlファイルが存在しない場合に発生します。

。あなたが作成している場合Anypointスタジオを使用しています。

1.Go To プロジェクトプロパティでJava Build Path

2.Click "ソース" タブ

3.Click上上のフォルダボタンを追加します。

4.「contact.raml」が存在するフォルダを確認します。一般的にramlファイルは "api"フォルダに保存されています。その場合は「api」フォルダをチェックし、「OK」をクリックしてください。

5.Click "適用"「contact.raml」は存在しているフォルダを追加

を。一般的にramlファイルは "api"フォルダに保存されています。したがって、もしそうなら、 "api"フォルダをチェックし、 "OK"をクリックします。

Bます.IFは、プロジェクトを構築するためにMavenを使用してです。

pomファイルに「mule-module-apikit」依存関係があることを確認してください。追加しない場合は、プラグインで以下のようにリソースディレクトリを指定して試してみてください。

<groupId>org.codehaus.mojo</groupId> 
     <artifactId>build-helper-maven-plugin</artifactId> 
     <version>1.7</version> 
     <executions> 
      <execution> 
       <id>add-resource</id> 
       <phase>generate-resources</phase> 
       <goals> 
        <goal>add-resource</goal> 
       </goals> 
       <configuration> 
        <resources> 
         <resource> 
          <directory>src/main/app/</directory> 
         </resource> 
         <resource> 
          <directory>mappings/</directory> 
         </resource> 
         <resource> 
          <directory>src/main/api</directory> 
         </resource> 
        </resources> 
       </configuration> 
      </execution> 
     </executions> 
    </plugin> 
関連する問題