<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-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/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">
<context:property-placeholder location="dev.properties" />
And dev.properties is in /src/main/resources
Works in Studio but not in Mule stand alone
After deployment in standalone, cross check in your server dev.properties file present in /opt/{mule.}/apps/{your apps}/classes/properties/dev.properties.
or If project maintained all the properties in config folder cross check in the following location /conf/dev.properties
make sure defined envt in either in mule-app.properties or passing in runtime.
Refer:
https://docs.mulesoft.com/mule-user-guide/v/3.6/deploying-to-multiple-environments
Related
Getting error in mulesoft. I searched for "transform" and "abstract-message-processor" in the xml and I cannot even find it.
mule_1 | + org.xml.sax.SAXParseException; lineNumber: 95; columnNumber: 84; +
mule_1 | + cvc-complex-type.2.4.a: Invalid content was found starting with element +
mule_1 | + '{"http://www.mulesoft.org/schema/mule/ee/core":transform}'. One of +
mule_1 | + '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, +
mule_1 | + "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-pr +
mule_1 | + ocessor}' is expected. +
This is the xml namespace definition:
<mule xmlns:validation="http://www.mulesoft.org/schema/mule/validation" xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:oauth2-provider="http://www.mulesoft.org/schema/mule/oauth2-provider" xmlns:oauth="http://www.mulesoft.org/schema/mule/oauth" xmlns:os="http://www.mulesoft.org/schema/mule/os" xmlns:apikit="http://www.mulesoft.org/schema/mule/mule-apikit" 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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/mule-apikit http://www.mulesoft.org/schema/mule/mule-apikit/current/mule-apikit.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
http://www.mulesoft.org/schema/mule/oauth http://www.mulesoft.org/schema/mule/oauth/current/mule-oauth.xsd
http://www.mulesoft.org/schema/mule/oauth2-provider http://www.mulesoft.org/schema/mule/oauth2-provider/current/mule-oauth2-provider.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd
http://www.mulesoft.org/schema/mule/validation http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd">
In line 95, this is how it looks:
93-- <http:request-connection host="0.0.0.0" port="8085" doc:name="HTTP">
94-- <http:authentication >
95-- <http:basic-authentication username="#[payload.id]" password="#[payload.token]" />
96-- </http:authentication>
97-- </http:request-connection>
It is possible that when you are executing inside Studio with Mule 4.3.0 Enterprise edition, but when deploying outside you are using the Community Edition, which doesn't include any of the Enterprise features.
If you are not using any Enterprise features (for example the Transform component) inside the Mule XML file, then you can remove the ee namespace from the XML declaration and schema location:
<mule
...
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
...
xsi:schemaLocation="...
...
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
...
/>
If your application is using any enterprise features you will need to remove or replace them.
So far i was able to create an example using ObjectStore from mule but it doesnt compile with an error saying Failed to read schema document...
My header is like folow:
<mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/current/mule-servlet.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/current/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
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/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.4/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.4/mule-spring-security.xsd
http://www.mulesoft.org/schema/mule/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd"
version="3.4.0">
Where can I find the schema since it is not where it was suppose to be?
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"
mule version 3.4.0
The schema location you are using is correct: http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd
So you're not missing a schema but the module itself. You need to install it in your application. For this follow this guide: http://mulesoft.github.io/mule-module-objectstore/guide/install.html
The link to the documentation from above is no longer valid. To install the object store I had to add the dependency to the pom and the schema from the above answer.
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-objectstore</artifactId>
<version>1.3.1</version>
</dependency>
http://www.mulesoft.org/schema/mule/objectstorehttp://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd
I have a little question about mule xml config file,while I try simple mule app that using logger and expression.The config file be like this :
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
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-3.1.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">
<flow name="basic_tutorialFlow1" doc:name="basic_tutorialFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8084" doc:name="HTTP"/>
<expression-filter expression="#[message.payload != '/favicon.ico']" doc:name="Expression"></expression-filter>
<logger level="INFO" doc:name="Logger" message="Current payload is #[message.payload]"/>
<set-payload doc:name="Set Payload" value="#['Hello, ' + message.payload + '. Today is ' + server.dateTime.format('dd/MM/yy') + '.' ]"/>
</flow>
I have error on expression-filter and logger. The error shown like this :
cvc-complex-type.2.4.a: Invalid content was found starting with element 'expression-filter'
The program can running but I don't feel right when the project still have error.I want to know how to fix this.
I check http://www.mulesoft.org/schema/mule/ but don't see expression-filter or logger.
my editor is STS 3.4.0 and mule version is 3.4 ,Thank you.
I'd recommend changing your schema locations to name your explicit version, e.g.
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd"
and also the xmlns statements, similarly. I've experienced this with mule 3.2.x, where certain XML attributes would fail to resolve in Mule IDE, although they compiled just fine. Changing from "current" to my specific version often corrected these resolution errors (although not always).
In general, it's usually safe to ignore these resolution failures if compilation and execution succeeds, but I agree with your general assertion that it's not a good feeling. Try being explicit with your schema definition, as I searched the core mule.xsd and both logger and expression-filter are properly defined in that file, so that should resolve your resolution errors.
I have sample Munit Test case in My Mule Project. But the file always showing an error mark at <munit:config> tag at the start of the configuration file.
Note: But currently I'm able to execute my munit test cases.
The error is:
cvc-complex-type.2.4.a: Invalid content was found starting with
element 'munit:config'. One of
'{"http://www.mulesoft.org/schema/mule/core":annotations,
"http://www.mulesoft.org/schema/mule/core":description,
This is an old post, but I don't see an answer. I had the same issue:
I had
at the top of declarations. I deleted it since I also had
xmlns:core="http://www.mulesoft.org/schema/mule/core" below.
This fixed the error.
This error means that the munit jars are not in your classpath
check for duplicate names of files, or flow names.
even if the files are in different folders or packages.
make them unique no matter what !
To help anyone else and the future me who still face this issue in Anypoint Studio 6.5 and munit tools 3.9.0 we had to configure the munit configuration global element as follows
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:munit="http://www.mulesoft.org/schema/mule/munit" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:mock="http://www.mulesoft.org/schema/mule/mock" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/munit http://www.mulesoft.org/schema/mule/munit/current/mule-munit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.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/tls http://www.mulesoft.org/schema/mule/tls/current/mule-tls.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/mock http://www.mulesoft.org/schema/mule/mock/current/mule-mock.xsd">
<munit:config mock-connectors="false" mock-inbounds="false" name="munit"
doc:name="MUnit configuration"/>
<spring:beans>
<spring:import resource="classpath:insurer-sys-api.xml"/>
<spring:import resource="classpath:global.xml"/>
<spring:import resource="classpath:insurer-sys-api-claims.xml"/>
<spring:import resource="classpath:insurer-sys-api-policyValidation.xml"/>
<spring:import resource="classpath:insurer-ctp-sys-api-shared.xml"/>
<spring:import resource="classpath:insurer-ctp-sys-api-health.xml"/>
</spring:beans>
<http:request-config name="HTTPS_Request_Configuration" protocol="HTTPS"
host="localhost" port="8082" basePath="/api" doc:name="HTTP Request
Configuration">
<tls:context>
<tls:trust-store insecure="true"/>
</tls:context>
</http:request-config>
I am using Mule Studio 3.4 and would like to experiment with Active Mq. I understood that ActiveMq is embedded in Mule, so it's not necessary to add jars on the classpath, by the way activeMq classes cannot be found on the classpath. Where am I wrong?
Here you are my configuration (copied from http://www.mulesoft.org/mule-activemq-integration-examples):
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
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" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd 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">
<spring:beans>
<spring:bean id="AmqDeadLetterStrategy"
class="org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy"
p:queuePrefix="DLQ." />
<spring:bean id="AmqDefaultPolicyEntry"
class="org.apache.activemq.broker.region.policy.PolicyEntry"
p:queue="jobs.*"
p:deadLetterStrategy-ref="AmqDeadLetterStrategy" />
<spring:bean id="AmqPolicyMap"
class="org.apache.activemq.broker.region.policy.PolicyMap"
p:defaultEntry-ref="AmqDefaultPolicyEntry" />
<spring:bean name="AmqBroker"
class="org.apache.activemq.broker.BrokerService"
p:brokerName="esb-amq-broker"
p:persistent="true"
p:dataDirectory="${activemq.data.dir}"
p:useJmx="true"
p:useShutdownHook="false"
p:destinationPolicy-ref="AmqPolicyMap"
init-method="start"
destroy-method="stop" />
<spring:bean name="AmqRedeliveryPolicy"
class="org.apache.activemq.RedeliveryPolicy"
p:useExponentialBackOff="true" />
<spring:bean name="AmqConnectionFactory"
class="org.apache.activemq.spring.ActiveMQConnectionFactory"
p:brokerURL="vm://esb-amq-broker"
p:redeliveryPolicy-ref="AmqRedeliveryPolicy"
depends-on="AmqBroker" />
</spring:beans>
<jms:activemq-connector name="EsbJmsConnector"
specification="1.1"
connectionFactory-ref="AmqConnectionFactory"
disableTemporaryReplyToDestinations="true"
persistentDelivery="true" />
</mule>
The errors are "Unable to find type org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy on build path of project..." and similar others.
Thanks!
Mule does not bundle activemq jars, nor the ones for any JMS broker, therefor you will need either to add it manually to your project or to the ${studio.home}/plugins/org.mule.tooling.server.${mule.version}_${mule.version}.${time.stamp}/mule/user if you want the container to provide it.