0

I'm having trouble with an Anypoint Studio project, it was working a couple of days ago but now its throwing an FileNotFoundException error. I've looked around and know my file has to be in the resources folder of my project. But it is still throwing the error and I don't know why. Could anyone guide me?

My project:

enter image description here

Configuration XML of my project:

enter image description here

org.mule.module.launcher.DeploymentInitException: FileNotFoundException: class path resource [app.properties] cannot be opened because it does not exist
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:197) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:324) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:345) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:163) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.7.3.jar:3.7.3]
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15) ~[tooling-support-3.7.3.jar:?]
Caused by: org.mule.api.config.ConfigurationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [app.properties] cannot be opened because it does not exist (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
Omaruchan
  • 403
  • 1
  • 5
  • 12

3 Answers3

0
  • Try classpath:app.properties
  • Also delete and reimport project in workspace
Nirmal- thInk beYond
  • 11,847
  • 8
  • 35
  • 46
0

In General ,Enterprise level applications will have projects at domain level and services level .When we check out the Domain project from repository ,and start building only domain project (run domain project as mule with Maven) it will try properties file and fails.At that scenario this exception is thrown.

Solution : Checkout the Services project along with domain ,and start building the project ,this exception will not be thrown. Project should build successfully. Make sure JRE and Maven settings were set properly and run mvn clean build.

Kamal Vamsi
  • 128
  • 4
0

Try creating property place holder

<context:property-placeholder location="app.properties"/>

Reference: Accessing mule-app.properties in custom properties file located in src/main/resources on cloudhub

user3366906
  • 149
  • 2
  • 11