Not able to see Kie Server in Business Central for Standalone rhpam 7.9 jar

1.1k Views Asked by At

I have tried passing the following config settings to rhpam 7.9 standalone.jar(https://developers.redhat.com/download-manager/file/rhpam-7.9.0-business-central-standalone.jar) and have a Kie Server Spring Boot starter up and running. However I am unable to see the Kie Server when I launch Business Central and login to it. No errors are showing in the logs as well but surely the connection between Business Central and Kie Server(7.44 version) seems to be not established.

The necessary roles are present as kieserver=admin,kie-server,rest-all,user,process-admin

The following are the code & config files for the environment. On the Kie Server Spring Boot Starter App(https://github.com/kiegroup/droolsjbpm-integration/tree/master/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample), the following is the Web Security Config and application.properties respectively

@Configuration("kieServerSecurity")
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
        .cors().and()
        .csrf().disable()
        .authorizeRequests()
            .antMatchers("/rest/*").authenticated()
            .and()
        .httpBasic();
        //.and()
        //.headers().frameOptions().disable();
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
        
        auth.inMemoryAuthentication()
            .withUser("kieserver").password(encoder.encode("kieserver1!")).roles("admin","kie-server","rest-all","user","process-admin")
            .and()        
            .withUser("john").password(encoder.encode("john@pwd1")).roles("kie-server", "PM", "HR");        
    }
    
    @Bean
    CorsConfigurationSource corsConfigurationSource() {
        CorsConfiguration configuration = new CorsConfiguration();
        configuration.setAllowedOrigins(Arrays.asList("*"));
        configuration.setAllowCredentials(true);
        configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers","Origin","Cache-Control", "Content-Type", "Authorization"));
        configuration.setAllowedMethods(Arrays.asList("DELETE", "GET", "POST", "PATCH", "PUT"));
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", configuration);
        return source;
    }
# https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties
#
#server configuration
server.address=localhost
server.port=8090

cxf.path=/rest

#jbpm configuration
jbpm.executor.enabled=false
#jbpm.executor.retries=5
#jbpm.executor.interval=0
#jbpm.executor.threadPoolSize=1
#jbpm.executor.timeUnit=SECONDS

kieserver.swagger.enabled=false
kieserver.location=http://localhost:8090/rest/server
#kieserver.controllers=http://localhost:8080/rest/controller

logging.level.root=DEBUG

kieserver.drools.enabled=true
kieserver.dmn.enabled=true
kieserver.jbpm.enabled=true
kieserver.jbpmui.enabled=true
kieserver.casemgmt.enabled=false
kieserver.optaplanner.enabled=false
kieserver.scenariosimulation.enabled=false

# only required for jBPM
#data source configuration
spring.datasource.username=sa
spring.datasource.password=sa
spring.datasource.url=jdbc:h2:./target/spring-boot-jbpm
spring.datasource.driver-class-name=org.h2.Driver

narayana.dbcp.enabled=true
narayana.dbcp.maxTotal=20

#hibernate configuration
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.show_sql=false
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

#transaction manager configuration
spring.jta.narayana.transaction-manager-id=1

The config parameters set for Business Central via sample-standalone-config.yml are -

# Sample Swarm config for KIE Drools Workbench
swarm:
  management:
    blocking:
      timeout: 2400 # This might need to be higher if the jar has timeout issues on startup
    security-realms:
      ApplicationRealm: # almost the same as default config in WildFly 10.1.0.Final
        local-authentication:
          default-user: local
          allowed-users: local
          skip-group-loading: true
        properties-authentication:
          path: application-users.properties
          plain-text: true
        properties-authorization:
          path: application-roles.properties
# Optional logging
  logging:
    console-handlers:
      CONSOLE:
        level: ALL
        named-formatter: COLOR_PATTERN
    pattern-formatters:
      PATTERN:
        pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"
      COLOR_PATTERN:
        pattern: "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"
    periodic-rotating-file-handlers:
      FILE:
        file:
          path: server.log
        suffix: .yyyy-MM-dd
        named-formatter: PATTERN
    root-logger:
      level: ALL
      handlers:
      - CONSOLE
      - FILE
  security:
    security-domains:
      other:
        classic-authentication:
          login-modules:
            kieLoginModule:
              code: org.kie.security.jaas.KieLoginModule
              flag: optional
              module: deployment.business-central-webapp.war
  undertow:
    filter-configuration:
      response-headers:
        access-control-allow-origin:
          header-name: Access-Control-Allow-Origin
          header-value: "*"
        access-control-allow-methods:
          header-name: Access-Control-Allow-Methods
          header-value: GET, POST, PUT, DELETE, OPTIONS
        access-control-max-age:
          header-name: Access-Control-Max-Age
          header-value: -1
        access-control-allow-headers:
          header-name: Access-Control-Allow-Headers
          header-value: Origin, X-Requested-With, Content-Type, Accept
    servers:
      default-server:
        hosts:
          default-host:
            filter-refs:
              access-control-allow-origin:
                priority: 1
              access-control-allow-methods:
                priority: 1
              access-control-max-age:
                priority: 1
              access-control-allow-headers:
                priority: 1
datasource:
  management:
    wildfly:
      admin: admin

# This configuration is required to make the users system work.
org:
  uberfire:
    ext:
      security:
        management:
          wildfly:
            cli:
              user: admin
  # Sample connection to KIE Server. The values here are the defaults.
  kie:
    server:
      id: SpringBoot
      user: kieserver
      pwd: kieserver1!
      location: http://localhost:8090/rest/server
      mode: development
      bypass.auth.user: true
      controller: http://localhost:8080/rest/controller
      controller.user: kieserver
      controller.pwd: kieserver1!
# CORS

The cmd executed to up the Rhpam is

java -jar rhpam-7.9.0-business-central-standalone.jar -s sample-standalone-config.yml

The same was working if I installed EAP 7.3 and deploy the Business Central.war and Kie Server.war

However we are required to use Standalone.jar in our case.

If I try to connect to Business Central by providing controller url in application.properties due to this part of the code(https://github.com/kiegroup/droolsjbpm-integration/blob/605985d6578e07fde49a28880af4be1a4f7386f9/kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java#L223), the kie url is then appended with the respective path as per the code and getting 405 error. So I rather tried to establish connection from Business Central itself by passing the mentioned config parameters mentioned in the config file above.

The below screen shot shows the Kie Server appears to be running ok so, the issue seems to be only the connection establishment that is not happening.

enter image description here

Not sure if the localhost:9990/management shows any issues as I see lot of nulls, attached screenshot below

enter image description here

Please let me know what config changes I need to do to get the connection working...

0

There are 0 best solutions below