0
votes

I'm trying to create Mule 4 service template and trying to invoke java method but getting below error:-

org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 140; cvc-complex-type.2.4.a: Invalid content was found starting with element 'java:invoke-static'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.

I've update the mule-artifact.json :-

{
  "configs": [
    "implementationservice.xml","globals.xml"
  ],
  "secureProperties": [],
  "redeploymentEnabled": true,
  "name": "implementationservice",
  "minMuleVersion": "4.1.4",
  "requiredProduct": "MULE_EE",
  "classLoaderModelLoaderDescriptor": {
    "id": "mule",
    "attributes": {
      "exportedResources": [],
      "exportedPackages": ["Utilities.systemInfo"]
    }
  },
  "bundleDescriptorLoader": {
    "id": "mule",
    "attributes": {}
  }
}
2
It sounds like you do t have the java namespace in your config or the java module. Can you share your mule config xml?Ryan Carter

2 Answers

2
votes

Even I faced the same issue, may be some problem with Anypoint studio in generating the configuration xml. You can add the below namespaces and schemas locations to get rid of the error

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:java="http://www.mulesoft.org/schema/mule/java" 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/java http://www.mulesoft.org/schema/mule/java/current/mule-java.xsd"> 

0
votes

You need to add the Java Module to your pom.xml. It is an optional module.

Also if you use the last Mule Maven Plugin version (current is 3.3.1 I think) you can omit almost all of the mule-artifact.json and it will auto generated. Example of a minimal mule-artifact.json:

{
  "minMuleVersion": "4.1.4",
}