0

This is the code i used :

<munit:config name="munit" doc:name="MUnit configuration"
    mock-connectors="false" mock-inbounds="false" />
<spring:beans>
    <spring:import resource="classpath:assign-studysite-user-role.xml"/>
    <spring:import resource="classpath:sip-eclinical-intg.xml"/>
    <spring:import resource="classpath:global-config.xml"/>
    <spring:import resource="classpath:ipet-outbound.xml"/>
    <spring:import resource="classpath:exception-config.xml"/>
    <spring:import resource="classpath:retry-sip-request.XML"/>
    <spring:import resource="classpath:properties/sip-eclinical-integ_Dev.properties"/>
</spring:beans>
<http:request-config name="HTTP_Request_Configuration"
    protocol="HTTPS" host="localhost" port="8005" doc:name="HTTP Request Configuration" />
<munit:test
    name="assign-studysite-user-role-test-suite-assignStudySiteUserRoleTest"
    description="Test">

    <munit:set
        payload="#[payload]"
        doc:name="Set Message" mimeType="application/xml" />
    <logger message="req #[payload]" level="INFO" doc:name="Logger"/>
    <dw:transform-message doc:name="Transform Message">
        <dw:set-payload
            resource="classpath:scripts/assign-user-role-in-study-site-odm-to-eclincal-transform.dwl" />
    </dw:transform-message>
    <object-to-string-transformer doc:name="Object to String"/>
    <mock:verify-call messageProcessor=".*:.*" doc:name="Verify Call">
        <mock:with-attributes>
            <mock:with-attribute name="doc:name" whereValue="#['Set Back Up Payload ']"/>
        </mock:with-attributes>
    </mock:verify-call>
</munit:test>

Error is:

java.lang.RuntimeException: org.mule.api.config.ConfigurationException: Configuration problem: Failed to import bean definitions from URL location [classpath:properties/sip-eclinical-integ_Dev.properties]

Offending resource: URL [file:/D:/DEVISWorkspace/Sip/SIP/sip-eclinical-Integ/src/test/munit/assign-studysite-user-role-test-suite.xml]; nested exception is org.springframework.beans.factory.

xml.XmlBeanDefinitionStoreException: Line 1 in XML document from class path resource [properties/sip-eclinical-integ_Dev.properties] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (org.mule.api.lifecycle.InitialisationException)

sri
  • 1
  • 4

2 Answers2

0

I see that you are loading a properties file (sip-eclinical-integ_Dev.properties) using spring:import. I have never done this before. I've only imported xml files this way.

To import a property file use the directive context:property-placeholder

0

See the section titled "Properties Files" in the mule documentation here, https://docs.mulesoft.com/mule-user-guide/v/3.7/configuring-properties

<context:property-placeholder location="classpath:sip-eclinical-integ_Dev.properties" />
  • Place the properties file directly under src/main/resources
  • Do not try substituting system variables into your filename until you get the basic working.