Decision Management (ODM,ADS)

 View Only
Expand all | Collapse all

ODM 8.11.1 | decisioncenter-api context root error running on samples server

  • 1.  ODM 8.11.1 | decisioncenter-api context root error running on samples server

    Posted Thu June 22, 2023 07:37 AM

    Hi All,

    I have installed ODM 8.11.1 in my local environment, onpremises installation. I can access all components except decisioncenter-api. The error is as follows:

    decisioncenter-api

    Translated: context root not found

    I have checked the server.xml file and it is correct. However, I have seen that in the plugin-cfg.xml file, all the components are mapped except decisioncenter-api:

       <UriGroup Name="default_host_odm81110_default_node_Cluster_URIs">
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/DecisionRunner/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/res/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/miniloan-server/*"/>
          <Uri AffinityCookie="JSESSIONID_DMN" AffinityURLIdentifier="jsessionid" Name="/decisionmodel/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/DecisionService/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBMJMXConnectorREST/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ibm/api/*"/>
          <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/decisioncenter/*"/>
       </UriGroup>
    

    How can I add the decisioncenter-api entry into plugin-cfg.xml file? If I do it manually, when I restart the samples server, it overwrites it.

    Thank you very much in advance



    ------------------------------
    Charo Álvarez Martínez
    Automation Architect
    DECIDE
    Madrid
    ------------------------------


  • 2.  RE: ODM 8.11.1 | decisioncenter-api context root error running on samples server

    Posted Thu June 22, 2023 12:09 PM

    Hi All,

    The reason for not adding the decisioncenter-api entry in the plugins-cfg.xml file, is related to the following Exception I found in the messages.log file:

    ------Start of DE processing------ = [22/06/23 12:42:33:719 CEST]
    Exception = org.springframework.beans.factory.BeanCreationException
    Source = com.ibm.ws.webcontainer.osgi.DynamicVirtualHost
    probeid = startWebApp
    Stack Dump = org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'decisionCenterApi' defined in class path resource [com/ibm/rules/decisioncenter/api/SwaggerConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.swagger.v3.oas.models.OpenAPI]: Factory method 'decisionCenterApi' threw exception; nested exception is java.time.format.DateTimeParseException: Text '2021-Jan-20 10:30:00 GMT' could not be parsed at index 5
    ....
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.swagger.v3.oas.models.OpenAPI]: Factory method 'decisionCenterApi' threw exception; nested exception is java.time.format.DateTimeParseException: Text '2021-Jan-20 10:30:00 GMT' could not be parsed at index 5
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    	... 40 more
    Caused by: java.time.format.DateTimeParseException: Text '2021-Jan-20 10:30:00 GMT' could not be parsed at index 5
    	at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
    	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
    	at java.time.LocalDateTime.parse(LocalDateTime.java:492)
    	at com.ibm.rules.decisioncenter.model.util.cleanup.CleanupReport.<init>(CleanupReport.java:59)
    	at com.ibm.rules.decisioncenter.api.SwaggerConfig.makeComponents(SwaggerConfig.java:112)
    

    If anyone has any suggestions, I would appreciate it.

    Thank you very much in advance.



    ------------------------------
    Charo Álvarez Martínez
    Automation Architect
    DECIDE
    Madrid
    ------------------------------



  • 3.  RE: ODM 8.11.1 | decisioncenter-api context root error running on samples server

    Posted Fri June 23, 2023 11:06 AM

    Hi All,

    I have decompiled the class that causes the error, com.ibm.rules.decisioncenter.DTFormat inside the teamserver-common-base-8.11.1.0.jar library and solved it by adding Locale.US in the date formatter pattern, like this:

    package com.ibm.rules.decisioncenter;
    
    
    import java.time.format.DateTimeFormatter;
    import java.util.Locale;
    
    public interface DTFormat {
      public static final String DATEFORMAT_STR = "yyyy-MMM-dd";
      
      public static final String DATETIMEFORMAT_STR = "yyyy-MMM-dd HH:mm:ss z";
      
      public static final DateTimeFormatter DATEFORMAT = DateTimeFormatter.ofPattern("yyyy-MMM-dd", Locale.US);
      
      public static final DateTimeFormatter DATETIMEFORMAT = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm:ss z", Locale.US);
    }
    
    

    Regards.



    ------------------------------
    Charo Álvarez Martínez
    Automation Architect
    DECIDE
    Madrid
    ------------------------------



  • 4.  RE: ODM 8.11.1 | decisioncenter-api context root error running on samples server

    Posted Fri June 23, 2023 04:20 PM

    Sorry for the inconvenience and amazing work, thank you for sharing.

    The problem has been addressed and a fix is available in interim fix IF004 and later.



    ------------------------------
    Alain Robert
    ------------------------------