org.mule.runtime.core.api.MuleRuntimeException: Exception found while trying to document XSD schema

MuleSoft JIRA | Alejandro Garcia Marra | 7 months ago
  1. 0

    StringIndexOutOfBoundsException is thrown while documenting the schema with javadoc. {code} [ERROR] diagnostic: error: Exception found while trying to document XSD schema org.mule.runtime.core.api.MuleRuntimeException: Exception found while trying to document XSD schema at org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.documentOperations(SchemaDocumenter.java:101) at org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.document(SchemaDocumenter.java:71) at org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenterModelEnricher.enrich(SchemaDocumenterModelEnricher.java:58) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.lambda$enrichModel$1(DefaultExtensionFactory.java:339) at java.lang.Iterable.forEach(Iterable.java:75) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.enrichModel(DefaultExtensionFactory.java:339) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.createFrom(DefaultExtensionFactory.java:123) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.parseExtension(ExtensionResourcesGeneratorAnnotationProcessor.java:107) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$null$17(ExtensionResourcesGeneratorAnnotationProcessor.java:82) at org.mule.runtime.core.util.ClassUtils.lambda$withContextClassLoader$10(ClassUtils.java:1214) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1193) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1213) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$18(ExtensionResourcesGeneratorAnnotationProcessor.java:81) at java.util.Optional.ifPresent(Optional.java:159) at ... ... Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:658) at org.mule.runtime.module.extension.internal.capability.xml.schema.AnnotationProcessorUtils.parseJavaDoc(AnnotationProcessorUtils.java:345) at org.mule.runtime.module.extension.internal.capability.xml.schema.AnnotationProcessorUtils.getMethodDocumentation(AnnotationProcessorUtils.java:180) at org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.documentOperations(SchemaDocumenter.java:94) {code}

    MuleSoft JIRA | 7 months ago | Alejandro Garcia Marra
    org.mule.runtime.core.api.MuleRuntimeException: Exception found while trying to document XSD schema
  2. 0

    When writing an extension with metadata, if the operation returns a Map<String,Object> and there is not OutputResolver, a model validator fails and shows an error, but if the return type is a List<Map<String,Object>> the validation doesn't fail *Invalid code* {code:java} public class BasicOperations { public Map<String, Object> createEntity(@Connection MetadataConnection connection, @MetadataKeyId String type, @Content @TypeResolver(TestInputAndOutputResolverWithKeyResolver.class) Map<String, Object> dynamicObject); public List<Map<String, Object>> createBulk(@Connection MetadataConnection connection, @MetadataKeyId String type, @Content @TypeResolver(TestInputAndOutputResolverWithKeyResolver.class) List<Map<String, Object>> dynamicObjects); {code} The example above fails with the error: {code} org.mule.runtime.extension.api.exception.IllegalModelDefinitionException: createEntity 'Metadata' specifies 'java.util.Map' as a return type. Operations and Sources with return type such as Object or Map must have defined a not null OutputTypeResolver org.mule.runtime.core.api.MuleRuntimeException: org.mule.runtime.extension.api.exception.IllegalModelDefinitionException: createEntity 'Metadata' specifies 'java.util.Map' as a return type. Operations and Sources with return type such as Object or Map must have defined a not null OutputTypeResolver at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:946) {code} After adding the @OutputResolver to the create entity, the compilation doesn't fail, but it should fail for the createBulk *Invalid code that doesn't fail* {code:java} public class BasicOperations { @OutputResolver(TestInputAndOutputResolverWithKeyResolver.class) public Map<String, Object> createEntity(@Connection MetadataConnection connection, @MetadataKeyId String type, @Content @TypeResolver(TestInputAndOutputResolverWithKeyResolver.class) Map<String, Object> dynamicObject); public List<Map<String, Object>> createBulk(@Connection MetadataConnection connection, @MetadataKeyId String type, @Content @TypeResolver(TestInputAndOutputResolverWithKeyResolver.class) List<Map<String, Object>> dynamicObjects); {code}

    MuleSoft JIRA | 3 months ago | Pablo Cabrera
    org.mule.runtime.core.api.MuleRuntimeException: org.mule.runtime.extension.api.exception.IllegalModelDefinitionException: createEntity 'Metadata' specifies 'java.util.Map' as a return type. Operations and Sources with return type such as Object or Map must have defined a not null OutputTypeResolver

    Root Cause Analysis

    1. org.mule.runtime.core.api.MuleRuntimeException

      Exception found while trying to document XSD schema

      at org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.documentOperations()
    2. org.mule.runtime
      DefaultExtensionFactory.lambda$enrichModel$1
      1. org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.documentOperations(SchemaDocumenter.java:101)
      2. org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenter.document(SchemaDocumenter.java:71)
      3. org.mule.runtime.module.extension.internal.capability.xml.schema.SchemaDocumenterModelEnricher.enrich(SchemaDocumenterModelEnricher.java:58)
      4. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.lambda$enrichModel$1(DefaultExtensionFactory.java:339)
      4 frames
    3. Java RT
      Iterable.forEach
      1. java.lang.Iterable.forEach(Iterable.java:75)
      1 frame
    4. org.mule.runtime
      ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$18
      1. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.enrichModel(DefaultExtensionFactory.java:339)
      2. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.createFrom(DefaultExtensionFactory.java:123)
      3. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.parseExtension(ExtensionResourcesGeneratorAnnotationProcessor.java:107)
      4. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$null$17(ExtensionResourcesGeneratorAnnotationProcessor.java:82)
      5. org.mule.runtime.core.util.ClassUtils.lambda$withContextClassLoader$10(ClassUtils.java:1214)
      6. org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1193)
      7. org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1213)
      8. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$18(ExtensionResourcesGeneratorAnnotationProcessor.java:81)
      8 frames
    5. Java RT
      Optional.ifPresent
      1. java.util.Optional.ifPresent(Optional.java:159)
      1 frame