Resource attribute of DataWeave in Mule is not accepting flow variable - mule

My dataweave code configuration xml is as below :
<dw:transform-message doc:name="Transform Message">
<dw:set-payload resource="#[flowVars['sample']]" />
</dw:transform-message>
where sample is a flow variable that contains the file path of the .dwl file that has the actual transformation logic.
<set-variable doc:name="Variable" value="file:D:/Transformer/sample.dwl" variableName="sample"/>
The error that i see when deploying the application is as follows:
org.mule.module.launcher.DeploymentInitException: FileNotFoundException: class path resource [#[flowVars['sample']]] 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: IOException parsing XML document from URL [file:/C:/Users/Satyakeerthika_Ch/AnypointStudio/workspaceLatest/.mule/apps/sample/sample.xml]; nested exception is java.io.FileNotFoundException: class path resource [#[flowVars['sample']]] cannot be opened because it does not exist (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[mule-module-launcher-3.7.3.jar:3.7.3]
... 14 more
Can someone help me how to read the variable in the resource?

You can't do it that way, but you can use the MEL function to evaluate dataweave scripts inside a set-payload.
#[dw(<dw-script-string>)]
#[dw(<dw-script-string>, <out-content-type>)]
If you don't specify a content-type the default is java.
So, it would end up as:
<set-payload value="#[dw(<dw-script-string>)]" doc:name="Set Payload"/>
Link to docs

I also experience the same issue in my anypoint studio with Mule 3.9.0
I had to correct the java library in my anypoint studio using below guide.
right click on the project
select properties from the context menu
on the project propearties page select java build path
in java build path click on libraries
select Add Library -> click on JRE System Library
select alternate JRE and browse to the JDK you would like to add to the project
this should resolve your issue

Related

How to resolve java.lang.ClassNotFoundException: com.sap.conn.jco.JCoException error in mule?

I'm using sap component in my project.
please find below is my SAP component sample code:
<sap:connector name="SAP_Configuration" jcoAsHost="${sapbw.host}" jcoUser="${sapbw.user}" jcoPasswd="${sapbw.password}" jcoSysnr="${sapbw.instance}" jcoClient="${sapbw.client}" jcoLang="${sapbw.language}" validateConnections="true" doc:name="SAP"/>
i have added required sapidoc3 and sapjco3 jar files in build path. As i'm working on window OS included sapjco3.dll file also still betting below error.
ERROR 2017-10-06 16:32:32,849 [main] org.mule.module.launcher.DefaultArchiveDeployer:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Failed to deploy artifact 'nol-integration-v1.1', see +
+ below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentException: Failed to deploy artifact [nol-integration-v1.1]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:38) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:310) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:330) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:155) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:256) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:78) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:100) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15) ~[tooling-support-3.7.0.jar:?]
Caused by: java.lang.NoClassDefFoundError: com/sap/conn/jco/JCoException
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_121]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_121]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:1.8.0_121]
at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:129) ~[spring-core-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:157) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:108) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:278) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:108) ~[mule-module-spring-config-3.7.0.jar:3.7.0]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:104) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:172) ~[mule-module-spring-config-3.7.0.jar:3.7.0]
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:95) ~[mule-module-spring-config-3.7.0.jar:3.7.0]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.0.jar:3.7.0]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.7.0.jar:3.7.0]
... 10 more
Caused by: java.lang.ClassNotFoundException: com.sap.conn.jco.JCoException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_121]
at org.mule.module.launcher.FineGrainedControlClassLoader.findClass(FineGrainedControlClassLoader.java:175) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.MuleApplicationClassLoader.findClass(MuleApplicationClassLoader.java:134) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at org.mule.module.launcher.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:119) ~[mule-module-launcher-3.7.0.jar:3.7.0]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_121]
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_121]
Please change the maven scope to "provided" for sapjco3 and then put sapjco3.dll and sapjco.jar inside tomcat lib folder.
If a JCo class cannot be found it is either because the sapjco3.jar is really not in the class path or the JCo initialization failed, for example at loading its native library.
Did you choose the correct JCo native library fitting to your JVM (32-bit vs. 64-bit)? You need to install the 32-bit version of JCo if you are using a 32-bit JVM even if running on a 64-bit operating system.
I don't know Mule, but SAP recommends not to deploy the sapjco3.jar together with a Java application into an application server runtime environment. Because JCo's native library may be loaded only once, it is better to treat it as a system library, i.e. put it into the Mule startup classpath itself. Otherwise the startup of a second application, which would also contain the sapjco3.jar, might fail.
If your project is mavenized then add this dependency to the POM:
<dependency>
<groupId>org.hibersap</groupId>
<artifactId>sapjco3</artifactId>
<version>3.0-RC02</version>
</dependency>

Problems When I'm trying to deploy a shared Domain in Mule Standalone but not in Anypoint

I’m trying to test the concept of shared resources, sharing an HTTP connector.
The applications are very simple, in each app only an HTTP inbound connector and a set Payload to give a response.
In Anypoint these apps work perfectly with the domain but when I want to deploy it in mule standalone, I have an error because the apps aren’t able to find the domain.
I have checked a lot of things:
The domain is deployed in domain folder and the apps in the app
folder
I'm using the same Mule version in Anypoint and standalone
The zip has been created using Anypoint.
The domain seems to be correctly deployed ( I've got the anchor file
and the directory)
But when Mule tries to deploy the apps, it gives the following errors. Is there something that I’m missing?
INFO 2017-02-28 09:54:10,953 [WrapperListener_start_runner] org.mule.module.launcher.ArtifactArchiveInstaller: Exploding a Mule artifact archive: file:/C:/EDP_POC/MULE/mule-standalone-3.8.0/apps/zz_pru1.zip ERROR 2017-02-28 09:54:10,974 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Failed to deploy artifact ‘zz_pru1’, see below + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ org.mule.api.MuleRuntimeException: Artifact directory does not exist: ‘C:\EDP_POC\MULE\mule-standalone-3.8.0\domains\zz_pru_domain’ at org.mule.module.launcher.artifact.ArtifactFactoryUtils.getDeploymentFile(ArtifactFactoryUtils.java:40) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.findDomain(DefaultDomainFactory.java:75) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:60) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:23) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createAppFrom(DefaultApplicationFactory.java:70) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:52) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:24) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.installFrom(DefaultArchiveDeployer.java:493) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.guardedInstallFrom(DefaultArchiveDeployer.java:474) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:145) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.8.0.jar:3.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111] at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.8.0.jar:3.8.0] at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) ~[wrapper-3.2.3.jar:3.2.3] INFO 2017-02-28 09:54:10,974 [WrapperListener_start_runner] org.mule.module.launcher.ArtifactArchiveInstaller: Exploding a Mule artifact archive: file:/C:/EDP_POC/MULE/mule-standalone-3.8.0/apps/zz_pru2.zip ERROR 2017-02-28 09:54:10,992 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Failed to deploy artifact ‘zz_pru2’, see below + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ org.mule.api.MuleRuntimeException: Artifact directory does not exist: ‘C:\EDP_POC\MULE\mule-standalone-3.8.0\domains\zz_pru_domain’ at org.mule.module.launcher.artifact.ArtifactFactoryUtils.getDeploymentFile(ArtifactFactoryUtils.java:40) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.findDomain(DefaultDomainFactory.java:75) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:60) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:23) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createAppFrom(DefaultApplicationFactory.java:70) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:52) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:24) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.installFrom(DefaultArchiveDeployer.java:493) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.guardedInstallFrom(DefaultArchiveDeployer.java:474) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:145) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104) ~[mule-module-launcher-3.8.0.jar:3.8.0] at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.8.0.jar:3.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111] at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.8.0.jar:3.8.0]
Thanks in advance for your support. Roberto
Thanks to #RamakrishnaN, I solved the problem.
The Domain name was incorrect in mule standalone, for that reason the app couldn't find it.
Cheers
Roberto

Json validator schema throws a com.github.fge.jsonschema.core.exceptions.ProcessingException exception

I have the following validator:
<json:validate-schema schemaLocation="C:/Users/NameOfUser/Documents/Project/FilesProject/jsonSchema.json" doc:name="Validate JSON Schema"/>
The content of the file is this
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Root schema.",
"description": "An explanation about the purpose of this instance.",
"properties": {}
}
When I compile mule throws the following exception:
ERROR 2016-06-14 09:49:04,191 [main] org.mule.config.spring.SpringRegistry: Failed to shut down registry cleanly: org.mule.Registry.Spring
org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "dispose" on object: org.mule.util.queue.DelegateQueueManager#1f3c5308
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:248) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.phases.MuleContextDisposePhase.applyLifecycle(MuleContextDisposePhase.java:102) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistryLifecycleManager$SpringContextDisposePhase.applyLifecycle(SpringRegistryLifecycleManager.java:141) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:91) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:67) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:140) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:111) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.dispose(AbstractRegistry.java:68) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker$2.onTransition(AbstractRegistryBroker.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker$2.onTransition(AbstractRegistryBroker.java:64) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:140) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryBrokerLifecycleManager.fireDisposePhase(RegistryBrokerLifecycleManager.java:82) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker.dispose(AbstractRegistryBroker.java:63) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:137) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.DefaultMuleContext.dispose(DefaultMuleContext.java:345) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:230) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[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: java.lang.NullPointerException
at org.mule.util.queue.TransactionalQueueManager.doDispose(TransactionalQueueManager.java:61) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.util.queue.AbstractQueueManager.dispose(AbstractQueueManager.java:109) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.util.queue.DelegateQueueManager.dispose(DelegateQueueManager.java:83) ~[mule-core-3.7.3.jar:3.7.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.7.3.jar:3.7.3]
... 35 more
INFO 2016-06-14 09:49:04,191 [main] org.mule.config.spring.MuleArtifactContext: Closing org.mule.config.spring.MuleArtifactContext#13cd7ea5: startup date [Tue Jun 14 09:48:58 ART 2016]; root of context hierarchy
ERROR 2016-06-14 09:49:04,395 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
com.github.fge.jsonschema.core.exceptions.ProcessingException: fatal: URI scheme "c" not supported (URI: "c:/Users/LBonaventura/Documents/DataWareHouse/ArchivosQuickplay/jsonSchema.json#")
level: "fatal"
scheme: "c"
uri: "c:/Users/LBonaventura/Documents/DataWareHouse/ArchivosQuickplay/jsonSchema.json#"
at com.github.fge.jsonschema.core.load.URIManager.getContent(URIManager.java:96) ~[json-schema-core-1.2.4.jar:?]
at com.github.fge.jsonschema.core.load.SchemaLoader$1.load(SchemaLoader.java:115) ~[json-schema-core-1.2.4.jar:?]
at com.github.fge.jsonschema.core.load.SchemaLoader$1.load(SchemaLoader.java:109) ~[json-schema-core-1.2.4.jar:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3937) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) ~[guava-18.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824) ~[guava-18.0.jar:?]
at com.github.fge.jsonschema.core.load.SchemaLoader.get(SchemaLoader.java:172) ~[json-schema-core-1.2.4.jar:?]
at com.github.fge.jsonschema.main.JsonValidator.buildJsonSchema(JsonValidator.java:210) ~[json-schema-validator-2.2.5.jar:?]
at com.github.fge.jsonschema.main.JsonSchemaFactory.getJsonSchema(JsonSchemaFactory.java:224) ~[json-schema-validator-2.2.5.jar:?]
at org.mule.module.json.validation.JsonSchemaValidator$Builder.loadSchema(JsonSchemaValidator.java:194) ~[mule-module-json-3.7.3.jar:3.7.3]
at org.mule.module.json.validation.JsonSchemaValidator$Builder.build(JsonSchemaValidator.java:169) ~[mule-module-json-3.7.3.jar:3.7.3]
at org.mule.module.json.validation.ValidateJsonSchemaMessageProcessor.initialise(ValidateJsonSchemaMessageProcessor.java:36) ~[mule-module-json-3.7.3.jar:3.7.3]
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:88) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:88) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.MessageProcessorFilterPair.initialise(MessageProcessorFilterPair.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.AbstractSelectiveRouter.initialise(AbstractSelectiveRouter.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.AbstractMuleObjectOwner.initialise(AbstractMuleObjectOwner.java:72) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.Foreach.initialise(Foreach.java:206) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:88) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.AbstractMuleObjectOwner.initialise(AbstractMuleObjectOwner.java:72) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.Foreach.initialise(Foreach.java:206) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:88) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.MessageProcessorFilterPair.initialise(MessageProcessorFilterPair.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.routing.AbstractSelectiveRouter.initialise(AbstractSelectiveRouter.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:88) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.AbstractFlowConstruct.initialiseIfInitialisable(AbstractFlowConstruct.java:317) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.AbstractPipeline.doInitialise(AbstractPipeline.java:241) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.Flow.doInitialise(Flow.java:74) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.AbstractFlowConstruct$1.onTransition(AbstractFlowConstruct.java:104) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.AbstractFlowConstruct$1.onTransition(AbstractFlowConstruct.java:98) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:138) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.FlowConstructLifecycleManager.fireInitialisePhase(FlowConstructLifecycleManager.java:78) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.construct.AbstractFlowConstruct.initialise(AbstractFlowConstruct.java:97) ~[mule-core-3.7.3.jar:3.7.3]
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:71) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:91) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:67) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:140) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:111) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.fireLifecycle(AbstractRegistry.java:146) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:116) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:172) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:95) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[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:?]
INFO 2016-06-14 09:49:04,397 [main] org.mule.module.launcher.application.DefaultMuleApplication: App 'trackingetl' never started, nothing to dispose of
ERROR 2016-06-14 09:49:04,596 [main] org.mule.module.launcher.DefaultArchiveDeployer:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Failed to deploy artifact 'trackingetl', see below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentInitException: ProcessingException: fatal: URI scheme "c" not supported (URI: "c:/Users/LBonaventura/Documents/DataWareHouse/ArchivosQuickplay/jsonSchema.json#")
level: "fatal"
scheme: "c"
uri: "c:/Users/LBonaventura/Documents/DataWareHouse/ArchivosQuickplay/jsonSchema.json#"
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 initialise JsonSchemaValidator (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[mule-module-launcher-3.7.3.jar:3.7.3]
... 14 more
Caused by: org.mule.api.config.ConfigurationException: Could not initialise JsonSchemaValidator (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:222) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:81) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188) ~[mule-module-launcher-3.7.3.jar:3.7.3]
... 14 more
To specify a Windows relative path, use the backslash \, for example \temp specifies C:\temp if Mule resides in drive C:\
According to Mule Docs, Schema Location should be an URI. You are passing a filePath.
The best option is to set your schema inside your resources folder and link it like this:
resource:/jsonSchema.json

Mule 3.7 transformer with annotations for custom Objects

I have two custom Classes : Person, Manager. I wrote the following transformer to transform Person to Manager object.
package com.learning.transformers;
import org.mule.api.annotations.ContainsTransformerMethods;
import org.mule.api.annotations.Transformer;
import com.learning.beans.Manager;
import com.learning.beans.Person;
#ContainsTransformerMethods
public class AnnotatedTransformer {
#Transformer
public Manager transformToManager(#Payload Person person){
Manager manager = new Manager();
manager.setPerson(person);
manager.setDesignation("Manager");
return manager;
}
}
My configuraiton file is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="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-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<spring:beans>
<spring:bean id="anTransformer" name="anT" class="com.learning.transformers.AnnotatedTransformer"/>
</spring:beans>
<flow name="mule-learning-transformersFlow1">
<http:listener config-ref="GlobalHTTPConnector" path="/customTransformation" doc:name="HTTP"/>
<json:json-to-object-transformer returnClass="com.learning.beans.Person" doc:name="JSON to Object"/>
<!-- <auto-transformer returnClass="com.learning.beans.Manager" /> -->
<component class="com.learning.components.ManagerLoggingComponent" doc:name="Java" />
</flow>
</mule>
My ManagerLoggingComponent looks like :
package com.learning.components;
import com.learning.beans.Manager;
import com.learning.beans.Person;
import org.mule.api.annotations.param.Payload;
public class ManagerLoggingComponent {
public void logManager(#Payload Manager manager){
Person person = manager.getPerson();
System.out.println("Name: "+person.getName());
System.out.println("Age: "+person.getAge());
System.out.println("Designation: "+manager.getDesignation());
}
}
I first send some json input to the flow. That is converted to Person object using json-to-object transformer. Then my component is placed which expects Manager object. I have registered my annotated transformer as spring bean. Hence I expect Person object to be converted to Manager object before passing it to Component. But it is throwing following exception.
Message : Failed to transform from "json" to
"com.learning.beans.Manager" Type :
org.mule.api.transformer.TransformerException Code :
MULE_ERROR-109 JavaDoc :
http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html
Transformer : JsonToObject{this=d61a0b,
name='JsonToManager', ignoreBadInput=false,
returnClass=SimpleDataType{type=com.learning.beans.Manager,
mimeType='/', encoding='null'},
sourceTypes=[SimpleDataType{type=java.io.Reader, mimeType='/',
encoding='null'}, SimpleDataType{type=java.net.URL, mimeType='/',
encoding='null'}, SimpleDataType{type=java.io.File, mimeType='/',
encoding='null'}, SimpleDataType{type=java.lang.String,
mimeType='/', encoding='null'},
SimpleDataType{type=java.io.InputStream, mimeType='/',
encoding='null'}, SimpleDataType{type=[B, mimeType='/',
encoding='null'}]}
Also, while starting the server I found that it is throwing the following error by which I understand that it is un-registering the transformToManager transformer. That might be the reason for not picking up my custom transformer. This is being observed in mule 3.7. 3.5 is working smoothly.
WARN 2016-03-27 14:01:06,574 [main] org.mule.config.spring.SpringRegistry: Could not apply shutdown lifecycle to object 'AnnotatedTransformer.transformToManager' after being unregistered.
org.mule.api.lifecycle.InitialisationException: An Expression Evaluator for "payload" is not registered with Mule. Make sure you have the the module for this expression type on your classpath. for example, if you are using an xpath expression you need to have the Mule XML module on your classpath.
at org.mule.expression.transformers.AbstractExpressionTransformer.initialise(AbstractExpressionTransformer.java:85) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.expression.ExpressionAnnotationsHelper.getTransformerForMethodWithAnnotations(ExpressionAnnotationsHelper.java:53) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at org.mule.config.transformer.AnnotatedTransformerProxy.initialise(AnnotatedTransformerProxy.java:109) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:71) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.applyPhase(RegistryLifecycleManager.java:183) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.unregisterObject(AbstractRegistry.java:163) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry$ConfigurableRegistrationDelegate.doRegisterObject(SpringRegistry.java:451) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry$ConfigurableRegistrationDelegate.registerObject(SpringRegistry.java:405) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry.registerObject(SpringRegistry.java:253) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:249) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:262) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.MuleRegistryHelper.registerObject(MuleRegistryHelper.java:816) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.MuleRegistryHelper.registerTransformer(MuleRegistryHelper.java:458) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.transformer.AnnotatedTransformerObjectProcessor.process(AnnotatedTransformerObjectProcessor.java:76) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at org.mule.config.spring.processors.TransformerAnnotatedBeanProcessor.postProcessBeforeInitialization(TransformerAnnotatedBeanProcessor.java:30) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753) ~[mule-module-spring-config-3.7.3.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:108) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:104) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:172) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:95) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
............
My request look like
{
"name":"Sai",
"age" : "100000"
}
Any ideas on what is happening here?
Everything is working as expected in Mule 3.5. Problem is with mule 3.7.
Update 1 : Full log of Excetion:
Message : Failed to transform from "json" to "com.learning.beans.Manager"
Type : org.mule.api.transformer.TransformerException
Code : MULE_ERROR-109
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html
Transformer : JsonToObject{this=13de431, name='JsonToManager', ignoreBadInput=false, returnClass=SimpleDataType{type=com.learning.beans.Manager, mimeType='*/*', encoding='null'}, sourceTypes=[SimpleDataType{type=java.io.Reader, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.net.URL, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.io.File, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.io.InputStream, mimeType='*/*', encoding='null'}, SimpleDataType{type=[B, mimeType='*/*', encoding='null'}]}
********************************************************************************
Exception stack is:
1. null (java.lang.NullPointerException)
java.io.Reader:78 (null)
2. Failed to transform from "json" to "com.learning.beans.Manager" (org.mule.api.transformer.TransformerException)
org.mule.module.json.transformers.JsonToObject:133 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
********************************************************************************
Root Exception stack trace:
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:97)
at org.mule.module.json.transformers.JsonToObject.transformMessage(JsonToObject.java:119)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:425)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:373)
at org.mule.expression.MessagePayloadExpressionEvaluator.evaluate(MessagePayloadExpressionEvaluator.java:79)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:318)
at org.mule.expression.transformers.ExpressionArgument.evaluate(ExpressionArgument.java:116)
at org.mule.expression.transformers.ExpressionTransformer.transformMessage(ExpressionTransformer.java:51)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:366)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadFromMessageWithAnnotations(AnnotatedEntryPointResolver.java:175)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadForMethod(AnnotatedEntryPointResolver.java:161)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.invoke(AnnotatedEntryPointResolver.java:130)
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:36)
at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:73)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)
at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:55)
at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:236)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.component.AbstractComponent.process(AbstractComponent.java:154)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.e...
********************************************************************************
Update 2 : I started getting the below exception suddenly. I didn't change any code. It is showing the below exception some times and above exception some other times.
Message : The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com
Type : org.mule.api.transformer.TransformerMessagingException
Code : MULE_ERROR--2
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerMessagingException.html
Payload : {NullPayload}
********************************************************************************
Exception stack is:
1. The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com (org.mule.api.transformer.TransformerMessagingException)
org.mule.transformer.AbstractMessageTransformer:179 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerMessagingException.html)
********************************************************************************
Root Exception stack trace:
org.mule.api.transformer.TransformerMessagingException: The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com
at org.mule.transformer.AbstractMessageTransformer.checkReturnClass(AbstractMessageTransformer.java:179)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:158)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:425)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:373)
at org.mule.expression.MessagePayloadExpressionEvaluator.evaluate(MessagePayloadExpressionEvaluator.java:79)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:318)
at org.mule.expression.transformers.ExpressionArgument.evaluate(ExpressionArgument.java:116)
at org.mule.expression.transformers.ExpressionTransformer.transformMessage(ExpressionTransformer.java:51)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:366)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadFromMessageWithAnnotations(AnnotatedEntryPointResolver.java:175)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadForMethod(AnnotatedEntryPointResolver.java:161)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.invoke(AnnotatedEntryPointResolver.java:130)
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:36)
at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:73)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)
at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:55)
at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:236)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.component.AbstractComponent.process(AbstractComponent.java:154)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.m...
********************************************************************************

Facing issue in custom connector : mule esb

I create custom connector in mule esb using Anypoint connector project.
I used REST type API. Following is my code
#Processor
#ReconnectOn(exceptions = { Exception.class })
#RestCall(uri="http://myapi/{content}", method=HttpMethod.GET)
public abstract void myProcessor(#RestUriParam("content") String content) throws IOException;
public ConnectorConnectionStrategy getConnectionStrategy() {
return connectionStrategy;
}
public void setConnectionStrategy(ConnectorConnectionStrategy connectionStrategy) {
this.connectionStrategy = connectionStrategy;
}
I used my custom connector as follow..
<connect-custom:config-type name="customConnector" doc:name="customConnector" />
<flow name="testinghelloFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<connect-custom:my-processor config-ref="customConnector" content="APP" doc:name="customConnector"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
I got following error..
ERROR 2015-02-16 19:06:13,418 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) ~[?:1.7.0_75]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_75]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1031) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:984) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:86) ~[mule-module-spring-config-3.6.0.jar:3.6.0]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:105) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:135) ~[mule-module-spring-config-3.6.0.jar:3.6.0]
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:90) ~[mule-module-spring-config-3.6.0.jar:3.6.0]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:84) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:217) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:76) ~[mule-core-3.6.0.jar:3.6.0]
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:187) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:310) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:330) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:155) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:256) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:78) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:100) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:152) ~[mule-module-launcher-3.6.0.jar:3.6.0]
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15) ~[tooling-support-3.6.0.jar:?]
INFO 2015-02-16 19:06:13,624 [main] org.mule.module.launcher.application.DefaultMuleApplication: App 'testinghello' never started, nothing to dispose of
ERROR 2015-02-16 19:06:13,812 [main] org.mule.module.launcher.DefaultArchiveDeployer:
When I test my class using junittest then got following error..
org.mule.api.config.ConfigurationException: Error creating bean with name 'Connect__Configuration_type_strategy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.mule.modules.customconnect.adapters.ConnectorConnectionStrategyBasicAdapter]: Is it an abstract class?; nested exception is java.lang.InstantiationException (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69)
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:84)
at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:217)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:76)
at org.mule.tck.junit4.AbstractMuleContextTestCase.createMuleContext(AbstractMuleContextTestCase.java:236)
at org.mule.tck.junit4.AbstractMuleContextTestCase.setUpMuleContext(AbstractMuleContextTestCase.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
How can I solve this error??
I got this error at compile time.. I just tried to fetch data using REST Api..
Which step i am missing???
How is it possible??
Thanks
I think this might be an issue with the latest devkit version. Can you try using the previous version and check whether this solves your issue? HTH.
As #clare mentioned, this appears to be an issue with the 3.6 DevKit in Anypoint Studio. This issue occurs if you generate the class and tests in Anypoint Studio 3.6.
You can get the connector to work correctly if you remove all the methods and variables in the connector class that are related to Connection Strategy, including the #ConnectionStrategy annotation and ConnectorConnectionStrategy class. You then have to update the connector config type in the XML config file from <connector:config-type> to <connector:config>, (where "connector" is your connector name). This is the previous style.
Basically, go back to the 3.5.x way of doing the connector and you will be fine. I'm sure an update will come out soon for this.