Invalid content error on compression:extract - anypoint-studio

I am attempting to use the zip-extract method in a foreach loop to unzip several files. When I attempt to deploy the project the following error is returned:
Invalid content was found starting with element 'compression:extract'. One of >'{"http://www.mulesoft.org/schema/mule/core":annotations, >"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, >"http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.
The actual code is:
<compression:extract doc:name="Extract" doc:id="9119d722-95eb-4aee-a734-50e2a2825449" >
<set-payload value="#[payload]" />
<compression:extractor >
<compression:zip-extractor />
</compression:extractor>
</compression:extract>
I have not been able to find anything online that would point towards a solution.

It look like accidentally a <set-payload> was put inside the <compression:extract> element. Also it doesn't make sense at all because it puts the payload as the payload, which it is already is. Just remove that line.
Maybe the intention was to use <compression-compressed>?
Example:
<compression:extract>
<compression:compressed>#[payload]</compression:compressed>
<compression:extractor>
<compression:zip-extractor/>
</compression:extractor>
</compression:extract>
payload is already the default, so it is not needed.

Related

Kotlin BuildType 'XYZ': id 'XYZ' is already used in BuildType(uuid='', id='XYZ', name='Deploy to envr') error

I was trying to refactor my Kotlin file that contains the configuration for a TeamCity pipeline. However, I keep getting the following error:
BuildType 'KotlinExperiments_DeployToEnvironment': id 'KotlinExperiments_DeployToEnvironment' is already used in BuildType(uuid='', id='KotlinExperiments_DeployToEnvironment', name='Deploy to test')
I tried to dynamically assign an ID, but that doesn't seem to work. Here are the links to the relevant files:
.teamcity/settings.kts
.teamcity/KotlinExperiments.kt
.teamcity/_buildTypes/DeployToEnvironment.kt
What am I missing?
It appears that there was an extra } in this line which is an invalid character for an ID. TeamCity didn't really provide an accurate error. After deleting the whole and recreating it again, TeamCity provided a much better error which led me to this finding.

Issues with overriding the Mule Watermark (SF Polling) in flow via ObjectStore:store

I have defined the object store as following:
<objectstore:config name="objectStore" objectStore-ref="_defaultUserObjectStore"/>
And am trying to modify the watermark variable defined by name "lastmodified" in object store via a flow which call
<objectstore:store key="lastmodified" value-ref="#[payload.lastmodified]" overwrite="true" config-ref="objectStore" doc:name="Default User Object Store"/>
Note: payload.lastmodified has appropriate value of "2016-06-29T15:08:45.000Z" in it.
I am not seeing any error on console but when the next time the Poll executes it doesn't read the updated value of the watermark.
Any pointer would be surely helpful.
Thanks.
Instead of the method used above, try using poll-watermarking. Can set you update expression in poll-watermarking and if needed, can use object store also.
I fixed it by making changing the object store config to: <objectstore:config name="objectStore" partition="mule.watermark" doc:name="ObjectStore: Connector"/>

How to find current flow name in mule?

I need to capture current flow name into a variable.
I tried with #[flow.name] but no luck in mule 3.8.0
can anybody please assist me?
Based on the answer in this post: How to get caller flow name in private flow in Mule
There is a simplest way to get the flow name and put it into a variable:
<expression-component doc:name="Expression"><![CDATA[flowVars.flowName = flow.name;]]></expression-component>
Alternately, you can directly use expression #[mule:context.serviceName] in a variable :-
<set-variable variableName="myFlowName" value="#[mule:context.serviceName]" doc:name="Variable"/>
<!-- Print the value of variale in logger -->
<logger message="#[flowVars.myFlowName]" level="INFO" doc:name="Logger"/>
This will set your current flow name directly in variable
In mule 3.8.5 using Groovy script component,
flowVars.currentFlowName = eventContext.getFlowConstruct().getName();
I have been using #[flow.name] in 3.7.3 and just tried in 3.8.0 to make sure it had not been removed and it worked fine for me in logger and setting a flowVars value. I suggest posting up at least a snippet of your flow and maybe we can spot the issue you are having.
PS, not sure why flow.name is not in standard forms or really documented by Mule, and as it is not there continues to be some worries they will remove it. I have seen it stated more than just here that it is not accessible in MEL, but #[flow.name] is a MEL expression and does work. To use if for something like I Parse Template in exception strategies, I use sulthony's form, set a flowVars value in an expression and refer to that flowVars in my template.
You can access flow name in logger by using #[flow.name] but its not accessible in MEL. Use flowconstruct for getting flow name. Refer this answer
Hope this helps.

Mule ESB 3 not getting port value from property file

In my configuration file, I have this...
<spring:beans>
<context:property-placeholder
location="classpath:sbg-esb.properties" />
</spring:beans>
My properties file looks like this...
# Primary endpoint
esb.endpoint=localhost
esb.port=8081
The endpoint in the config file looks like this...
<http:inbound-endpoint exchange-pattern="request-response" host="${esb.endpoint}" port="${esb.port}" doc:name="Incoming localhost"/>
When starting the Mule Server I get the following error...
Invalid bean definition with name 'sbg-mobile-direction-flow' defined in null: Could not resolve placeholder 'esb.port' in string value "${esb.port}
I don't get any error if all I do is use the esb.endpoint value in the properties file. Once I put in the esb.port value the server breaks as described. Is there a problem with integer values? Am I screwing up the properties file somehow? I thought perhaps using "port" was messing it up but I changed the name to esb.esb.port-like-thing and that got the same error. Any help would be appreciated.
MORE INFO
I took the port out of the properties file. I added the following.
esb.wsdlLocation=http\://dev.example.com/services/Mobile/LinkDevice/soap_server.php?wsdl
The Server breaks with the same error. That would seem to mean that whatever is wrong doesn't have anything to do with port value itself. No properties after the first one are being read correctly.

Error Getting Property

So.. I've got this CA
<CustomAction Id="InstallSetProp" Property="CustomActionData" Value="<some other data that's formatted exactly the same> /webconftmploc="[WEBCONFIGTMPLOC]"" />
However, when this CA is called, a message box is shown saying "Error Getting Property" which is bogus since the property is correctly set and accessible later on. (And does nothing except mess up my attempts to fully automate installation) I'm running the .msi through a bootstrapper that switches /qr to help with this.
The message box error is not shown when /webconftmploc="[WEBCONFIGTMPLOC]" is removed, for the record [WEBCONFIGTMPLOC] is either an absolute file path or "Not Set" and I'm wondering if there's any special reason why this behaviour can occur.
However, I'm much more interested in any possible way to suppress or fix this action, of-course.
That CustomAction only sets a property. It is not possible for it to show an error message. If any of the properties were not defined they would just resolve to blank. Something else must be showing the error message.
However, it appears that you are trying to pass data to a deferred custom action due to your use of the specially named CustomActionData. That isn't quite the way to use CustomActionData though. Instead, the Property attribute should be set to the Id of the CustomAction that you want to pass data too. Say the custom action that uses that property value is something like:
<CustomAction Id='MyDeferredCustomAction' Execute='deferred' ... />
To pass it the string you are trying to send, you could write:
<CustomAction Id="InstallSetProp"
Property="MyDeferredCustomAction"
Value="<some other data that's formatted exactly the same> /webconftmploc="[WEBCONFIGTMPLOC]"" />
Notice that the second custom action is setting a property with the same name as the deferred custom action: MyDeferredCustomAction. The MyDeferredCustomAction can access the value <some other data that's formatted exactly the same> /webconftmploc="value_of_WEBCONFIGIMPLOC_goes_here" via the magical CustomActionData property. You can read more about that here: http://msdn.microsoft.com/en-US/library/2w2fhwzz(v=VS.80).aspx