wtorek, 20 października 2015

Installing KIE Server and Workbench on same server

A common requirement for installation on development machine is to run both KIE Workbench and KIE Server on same server to simplify execution environment and avoid any port offset configuration.

This article will explain all installation steps needed to make this happen on two most frequently used containers:

  • Wildfly 8.2.0.Final
  • Apache Tomcat 8

Download binaries

So let's get our hands dirty and play around with some installation steps. First make sure you download correct versions of workbench and KIE Server for the container you target.

Wildfly

Tomcat

Wildfly

Deploy applications

Copy downloaded files into WILDFLY_HOME/standalone/deployments, while copying rename them to simplify the context paths that will be used on application server:
  • rename kie-wb-distribution-wars-6.3.0.Final-wildfly8.war to kie-wb.war
  • rename kie-server-6.3.0.Final-ee7.war to kie-server.war

Configure your server

With Wildfly there is not much to setup as both transaction manager and persistence (including data source) is already preconfigured.

Configure users

  • create user in application realm 
    • name: kieserver 
    • password: kieserver1!
    • roles: kie-server
  • create user in application realm to logon to workbench
    • name: workbench 
    • password: workbench!
    • roles: admin, kie-server

Configure system properties

Following list of properties needs to be given to work smoothly for both workbench and KIE Server:
  • -Dorg.kie.server.id=wildfly-kieserver 
  • -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server 
  • -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller

Launching the server

best way is to add system properties into startup command when launching Wildfly server. Go to WILDFLY_HOME/bin and issue following command:

./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.id=wildfly-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller

Tomcat


Deploy applications

Copy downloaded files into TOMCAT_HOME/webapps, while copying rename them to simplify the context paths that will be used on application server:
  • rename kie-wb-distribution-wars-6.3.0.Final-tomcat7.war to kie-wb.war
  • rename kie-server-6.3.0.Final-webc.war to kie-server.war

Configure your server

  1. Copy following libraries into TOMCAT_HOME/lib
    1. btm-2.1.4
    2. btm-tomcat55-lifecycle-2.1.4
    3. h2-1.3.161
    4. jacc-1.0
    5. jta-1.1
    6. kie-tomcat-integration-6.3.0.Final
    7. slf4j-api-1.7.2
    8. slf4j-api-1.7.2
  2. Create Bitronix configuration files to enable JTA transaction manager
  • Create file 'btm-config.properties' under TOMCAT_HOME/conf with following content
bitronix.tm.serverId=tomcat-btm-node0
bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties
  • Create file 'resources.properties' under TOMCAT_HOME/conf with following content
resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds1.uniqueName=jdbc/jbpm
resource.ds1.minPoolSize=10
resource.ds1.maxPoolSize=20
resource.ds1.driverProperties.driverClassName=org.h2.Driver
resource.ds1.driverProperties.url=jdbc:h2:mem:jbpm
resource.ds1.driverProperties.user=sa
resource.ds1.driverProperties.password=
resource.ds1.allowLocalTransactions=true

Configure users

Create following users in tomcat-users.xml under TOMCAT_HOME/conf
  • create user
    • name: kieserver 
    • password: kieserver1!
    • roles: kie-server
  • create user to logon to workbench
    • name: workbench 
    • password: workbench!
    • roles: admin, kid-server
 
<tomcat-users>
  <role rolename="admin"/>
  <role rolename="analyst"/> 
  <role rolename="user"/>
  <role rolename="kie-server"/>

  <user username="workbench" password="workbench1!" roles="admin,kie-server"/>
  <user username="kieserver" password="kieserver1!" roles="kie-server"/>  
</tomcat-users>

Configure system properties

Configure following system properties in file setenv.sh under TOMCAT_HOME/bin
-Dbtm.root=$CATALINA_HOME 
-Dorg.jbpm.cdi.bm=java:comp/env/BeanManager 
-Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties 
-Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry 
-Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-wb/WEB-INF/classes/login.config 
-Dorg.kie.server.persistence.ds=java:comp/env/jdbc/jbpm 
-Dorg.kie.server.persistence.tm=org.hibernate.service.jta.platform.internal.BitronixJtaPlatform 
-Dorg.kie.server.id=tomcat-kieserver 
-Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server 
-Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller

NOTE: Simple copy this into setenv.sh files to properly setup KIE Server and Workbench on Tomcat:
CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=$CATALINA_HOME -Dorg.jbpm.cdi.bm=java:comp/env/BeanManager -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-wb/WEB-INF/classes/login.config -Dorg.kie.server.persistence.ds=java:comp/env/jdbc/jbpm -Dorg.kie.server.persistence.tm=org.hibernate.service.jta.platform.internal.BitronixJtaPlatform -Dorg.kie.server.id=tomcat-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller"

Launching the server

Go to TOMCAT_HOME/bin and issue following command:
./startup.sh

Going beyond default setup

Disabling KIE Server extensions

And that's all to do to setup both KIE Server and Workbench on single server instance (either Wildfly or Tomcat). This article focused on fully featured KIE server installation meaning both BRM (rules) and BPM (processes, tasks) capabilities. Although KIE Server can be configured to serve only subset of the capabilities - e.g. only BRM or only BPM.

To do so one can configure KIE Server with system properties to disable extensions (BRM or BPM)

Wildfly:
add following system property to startup command:
  • disable BRM: -Dorg.drools.server.ext.disabled=true
  • disable BPM: -Dorg.jbpm.server.ext.disabled=true
So the startup command would look like this:
./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.id=wildfly-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.jbpm.server.ext.disabled=true

Tomcat
add following system property to setenv.sh script (must be still part of CATALINA_OPTS configuration):
  • disable BRM: -Dorg.drools.server.ext.disabled=true
  • disable BPM: -Dorg.jbpm.server.ext.disabled=true
Complete content of setenv.sh is as follows:
CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=$CATALINA_HOME -Dorg.jbpm.cdi.bm=java:comp/env/BeanManager -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-wb/WEB-INF/classes/login.config -Dorg.kie.server.persistence.ds=java:comp/env/jdbc/jbpm -Dorg.kie.server.persistence.tm=org.hibernate.service.jta.platform.internal.BitronixJtaPlatform -Dorg.kie.server.id=tomcat-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.jbpm.server.ext.disabled=true"

Changing data base and persistence settings

Since by default persistence uses just in memory data base (H2) it is good enough for first tryouts or demos but not for real usage. So to be able to change persistence settings following needs to be done:

KIE Workbench on Wildfly
Modify data source configuration in Wildfly - either via manual editing of standalone-full.xml file or using tools such as Wildfly CLI. See Wildfly documentation on how to define data sources.

  • Next modify persistence.xml that resides inside workbench war file. Extract the kie-wb.war file into directory with same name and in same location (WILDFLY_HOME/standalone/deployments). 
  • Then navigate to kie-wb.war/WEB-INF/classes/META-INF
  • Edit persistence.xml file and change following elements
    • jta-data-source to point to the newly created data source (JNDI name) for your data base
    • hibernate.dialect to hibernate supported dialect name for you data base
KIE Server on Wildfly
there is no need to do any changes to the application (the war file) as the persistence can be reconfigured via system properties. Set following system properties at the end of server startup command

  • -Dorg.kie.server.persistence.ds=java:jboss/datasources/jbpmDS
  • -Dorg.kie.server.persistence.dialect=org.hibernate.dialect.MySQL5Dialect
Full command to start server will be:
./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.id=wildfly-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.kie.server.persistence.ds=java:jboss/datasources/jbpmDS 
-Dorg.kie.server.persistence.dialect=org.hibernate.dialect.MySQL5Dialect

KIE Workbench on Tomcat
To modify data source configuration in Tomcat you need to alter resources.properties (inside TOMCAT_HOME/conf) file that defines data base connection. For MySQL it could look like this:

resource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
resource.ds1.uniqueName=jdbc/jbpmDS
resource.ds1.minPoolSize=0
resource.ds1.maxPoolSize=10
resource.ds1.driverProperties.user=guest
resource.ds1.driverProperties.password=guest
resource.ds1.driverProperties.URL=jdbc:mysql://localhost:3306/jbpm
resource.ds1.allowLocalTransactions=true

Make sure you're copy mysql JDBC driver into TOMCAT_HOME/lib otherwise it won't provide proper connection handling.
  • Next modify persistence.xml that resides inside workbench war file. Extract the kie-wb.war file into directory with same name and in same location (TOMCAT_HOME/webapps). 
  • Then navigate to kie-wb.war/WEB-INF/classes/META-INF
  • Edit persistence.xml file and change following elements
    • jta-data-source to point to the newly created data source (JNDI name) for your data base
    • hibernate.dialect to hibernate supported dialect name for you data base
KIE Server on Tomcat
there is no need to do any changes to the application (the war file) as the persistence can be reconfigured via system properties. Set or modify (as data source is already defined there) following system properties in setenv.sh script inside TOMCAT_HOME/bin

  • -Dorg.kie.server.persistence.ds=java:comp/env/jdbc//jbpmDS
  • -Dorg.kie.server.persistence.dialect=org.hibernate.dialect.MySQL5Dialect
Complete content of the setenv.sh script is as follows:
CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=$CATALINA_HOME -Dorg.jbpm.cdi.bm=java:comp/env/BeanManager -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-wb/WEB-INF/classes/login.config -Dorg.kie.server.persistence.ds=java:comp/env/jdbc/jbpmDS -Dorg.kie.server.persistence.tm=org.hibernate.service.jta.platform.internal.BitronixJtaPlatform 
-Dorg.kie.server.persistence.dialect=org.hibernate.dialect.MySQL5Dialect
-Dorg.kie.server.id=tomcat-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller"

Note that KIE Server persistence is required only for BPM capability so if you disable it you can skip any KIE server related persistence changes.

And that would be it. Hopefully this article will help with installation of KIE Workbench and Server on single application server. 

Have fun and comments more than welcome.

46 komentarzy:

  1. Hi there, do have have an example for Websphere 8.5 ? I'm struggling to get it working on WAS.
    The instruction from here:
    https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-wb/kie-wb-distribution-wars/src/main/assembly/was8
    doesn't work, when using kie-drools-wb-6_3_0_Final-was8_war.

    Regards

    OdpowiedzUsuń
    Odpowiedzi
    1. what sort of issues do you have? The instruction in github should be up to date as it was recently verified. So if you could provide more details about the issue we could try to figure out what's causing troubles.

      Usuń
  2. Sure .. these configuration steps don't exist with the was8.war file:

    "From here, you will be asked with several deployments settings.
    - You'll need to select the datasource created above as the datasource to be used by the application.
    - Screen Bind listeners for message-driven beans - select for every bean Activation Specification and fill the corresponding activation specification JNDI name into Target Resource JNDI Name (e.g. jms/activation/KIE.SESSION). You may also specify Destination JNDI name using JNDI name of the appropriate JMS queue (e.g. jms/queue/KIE.SESSION)"

    When deploying the war from the WAS Console even with the 'Detailed deployment path' only those config steps are available:
    1. Select installation options
    2. Map modules to servers
    3. Provide JSP reloading options for Web modules
    4. Map shared libraries
    5. Map shared library relationships
    6. Initialize parameters for servlets
    7. Provide JNDI names for beans
    8. Bind EJB Business
    9. Map virtual hosts for Web modules
    10. Map context roots for Web modules
    11. Map security roles to users or groups
    12. Map JASPI provider
    13. Metadata for modules
    14. Display module build Ids
    15. Summary

    Step 7. has the following beans:
    - AvailableJobsExecutor
    - SimpleAsyncExecutorService
    - AlternativeStarterBean
    - DeploymentSynchronizerCDInvoker
    - MailboxProcessOutgoingExecutorManager
    - ConfigServiceWatchServiceExecutorImpl
    - EJBTimerScheduler
    - IOWatchServiceExecutorImpl
    - IncrementalBuilderExecutorManager

    As you can see this doesn't quite fit the installation description.
    Regards

    OdpowiedzUsuń
    Odpowiedzi
    1. Hi Maciej,

      Any luck with this ? Is there any official place I can log a ticket ?
      Regards

      Usuń
    2. Have you seen this installation notes:http://mswiderski.blogspot.com/2014/04/jbpm-6-on-websphere-installation-notes.html

      if that still does not help please start a new email thread on the mailing list: jbpm-setup@googlegroups.com will be way easier to go over the issue then on blog comments.

      Usuń
  3. Hi there,
    It worked well. But I fail to understand what exactly the kie-server vs kie-wb.
    Does kie-wb has development tools and kie-server only the runtime? Does kie-wb includes a kie-server?

    Thank you

    OdpowiedzUsuń
    Odpowiedzi
    1. correct, kie server is just runtime execution server while workbench has authoring, management and reporting.

      Usuń
  4. kie-wb working fine, but i am getting Forbidden error while access the server..http://localhost:8080/kie-server/

    OdpowiedzUsuń
    Odpowiedzi
    1. double check your settings for kie server user on both ends.

      Usuń
  5. my tomcat is not starting... tomcat hangs after "Starting Bitronix Transaction Manager"

    INFO: Starting service Catalina
    Jan 6, 2016 4:23:45 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
    Jan 6, 2016 4:23:45 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive /app_local/whp-tomcat-7/webapps/kie-server.war
    Jan 6, 2016 4:23:46 PM bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
    INFO: Starting Bitronix Transaction Manager

    OdpowiedzUsuń
  6. I am not able to see 'Tools' menu in the workbench.
    Though rest of the menu items are visible viz., Explore, New Item and Repository.

    Please help. Thanks

    OdpowiedzUsuń
  7. does this instructions work in wildfly 9 ??

    OdpowiedzUsuń
  8. i deployed both wars to wildfly 9, but when i try to access this endpoint http://127.0.0.1:8080/kie-wb/rest/runtime/com.lidapsi:autorizacion:1.0/history/instances
    the server gives me the error

    16:58:39,065 WARN [org.jboss.resteasy.core.ExceptionHandler] (default task-56) failed to execute: javax.ws.rs.NotFoundException: Could not find resource for full path: http://127.0.0.1:8080/kie-wb/rest/runtime/com.lidapsi:autorizacion:1.0/history/instances
    at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:112)
    at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43)
    at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)
    at ........................

    also, my session in the workbench logs out

    what am i missing ?

    OdpowiedzUsuń
    Odpowiedzi
    1. I don't think there is such endpoint as the exception suggests. Make sure you access valid and existing endpoint of the rest api

      Usuń
  9. i have also tried to access the rest api in wildfly 8 but accessing this url
    http://127.0.0.1:8080/kie-wb/rest/task/query

    gives me this exception

    17:22:27,064 WARN [org.jboss.resteasy.core.ExceptionHandler] (default task-45) failed to execute: javax.ws.rs.ForbiddenException: HTTP 403 Forbidden
    at org.jboss.resteasy.plugins.interceptors.RoleBasedSecurityFilter.filter(RoleBasedSecurityFilter.java:45) [resteasy-jaxrs-3.0.10.Final.jar:]
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:264) [resteasy-jaxrs-3.0.10.Final.jar:]
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) [resteasy-jaxrs-3.0.10.Final.jar:]

    even if i am logged in as workbench user

    i have also noticed that there are many of this entries while the server is starting

    2016-01-26 17:18:36,504 WARN [org.kie.server.services.impl.controller.DefaultRestControllerImpl] (MSC service thread 1-1) Exception encountered while syncing with controller at http://127.0.0.1:8080/kie-wb/rest/controller/server/wildfly-kieserver error Error while sending PUT request to http://127.0.0.1:8080/kie-wb/rest/controller/server/wildfly-kieserver response code 405

    OdpowiedzUsuń
    Odpowiedzi
    1. make sure that your user has a rest-all role assigned otherwise you won't be able to use REST api of workbench.

      These warning in server.log are valid as kie server starts faster that workbench and thus cannot connect to it unless workbench is fully started

      Usuń
    2. I added rest-all roles tot he user, But I am getting the same error.
      14:43:54,470 WARN [org.kie.server.services.impl.controller.DefaultRestControlle
      rImpl] (KieServer-ControllerConnect) Exception encountered while syncing with co
      ntroller at http://:8080/kie-wb/rest/controller/server/wildfly-kie
      server error Connection refused: connect

      Usuń
  10. -- localhost.2016-02-12.log --
    SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Resteasy] in context with path [/kie-wb] threw exception
    java.util.NoSuchElementException
    at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:59)
    at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
    at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
    at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
    at org.uberfire.backend.server.security.adapter.GroupAdapterAuthorizationSource.collectGroups(GroupAdapterAuthorizationSource.java:22)
    at org.uberfire.ext.security.server.ServletSecurityAuthenticationService.getUser(ServletSecurityAuthenticationService.java:114)
    at org.uberfire.ext.security.server.ServletSecurityAuthenticationService.login(ServletSecurityAuthenticationService.java:66)
    at org.uberfire.ext.security.server.ServletSecurityAuthenticationService$Proxy$_$$_WeldClientProxy.login(ServletSecurityAuthenticationService$Proxy$_$$_WeldClientProxy.java)
    at org.uberfire.ext.security.server.BasicAuthSecurityFilter.authenticate(BasicAuthSecurityFilter.java:91)
    at org.uberfire.ext.security.server.BasicAuthSecurityFilter.doFilter(BasicAuthSecurityFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.uberfire.ext.security.server.SecureHeadersFilter.doFilter(SecureHeadersFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.uberfire.ext.security.server.SecurityIntegrationFilter.doFilter(SecurityIntegrationFilter.java:45)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

    OdpowiedzUsuń
  11. -- localhost_access_log.2016-02-12.txt --
    127.0.0.1 - kieserver [12/Feb/2016:11:52:25 -0700] "PUT /kie-wb/rest/controller/server/tomcat-kieserver HTTP/1.1" 500 -
    127.0.0.1 - kieserver [12/Feb/2016:11:52:34 -0700] "PUT /kie-wb/rest/controller/server/tomcat-kieserver HTTP/1.1" 201 3

    OdpowiedzUsuń
  12. Maciej, firstly thanks for all the posts I've seen regarding Drools. I know it takes time to create them and they are appreciated.

    I am still having issues runing KIE server and KIE workbench on the same server. I have followed your instructions above.

    I've tried a similar setup on a Centos 7 server and the same thing happens. I've been trying for days to make this work, but no luck.

    Here's my setup:

    Operating System: Windows 7 64-bit
    Java: 1.8.0_66
    Java Container: Wildfly 8.1.0 Final

    Contents of application-roles.properties:

    kieserver=admin,kieserver,rest-all
    workbench=admin,kieserver,rest-all

    Contents of users.properties:

    admin=admin
    krisv=krisv
    john=john
    mary=mary
    sales-rep=sales-rep
    katy=katy
    jack=jack
    salaboy=salaboy

    JBoss Initial Startup Log:

    2016-03-21 11:53:12,583 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
    2016-03-21 11:53:12,588 DEBUG [org.jboss.as.config] (MSC service thread 1-6) Configured system properties:
    java.class.path = C:\jbpm-installer\wildfly-8.1.0.Final\jboss-modules.jar
    java.class.version = 52.0
    java.endorsed.dirs = C:\Progra~1\Java\jdk1.8.0_66\jre\lib\endorsed
    java.home = C:\Progra~1\Java\jdk1.8.0_66\jre
    java.io.tmpdir = C:\Users\mp4783\AppData\Local\Temp\
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.8.0_66-b18
    java.specification.name = Java Platform API Specification
    java.specification.vendor = Oracle Corporation
    java.version = 1.8.0_66
    java.vm.info = mixed mode
    jboss.bind.address = localhost
    jboss.home.dir = C:\jbpm-installer\wildfly-8.1.0.Final
    jboss.host.name = ohcdtd02mp4783
    jboss.modules.dir = C:\jbpm-installer\wildfly-8.1.0.Final\modules
    jboss.server.base.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone
    jboss.server.config.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone\configuration
    jboss.server.data.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone\data
    jboss.server.deploy.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone\data\content
    jboss.server.log.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone\log
    jboss.server.name = ohcdtd02mp4783
    jboss.server.persist.config = true
    jboss.server.temp.dir = C:\jbpm-installer\wildfly-8.1.0.Final\standalone\tmp
    line.separator =

    org.kie.demo = false
    org.kie.example = false
    org.kie.server.controller = http://localhost:8080/kie-wb/rest/controller
    org.kie.server.controller.pwd = kieserver1!
    org.kie.server.controller.user = kieserver
    org.kie.server.id = first-kie-server
    org.kie.server.location = http://localhost:8080/kie-server/services/rest/server
    org.kie.server.pwd = kieserver1!
    org.kie.server.user = kieserver
    org.xml.sax.driver = __redirected.__XMLReaderFactory
    os.arch = amd64
    os.name = Windows 7
    os.version = 6.1
    sun.boot.class.path = C:\Progra~1\Java\jdk1.8.0_66\jre\lib\resources.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\rt.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\sunrsasign.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\jsse.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\jce.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\charsets.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\lib\jfr.jar;C:\Progra~1\Java\jdk1.8.0_66\jre\classes
    sun.java.command = C:\jbpm-installer\wildfly-8.1.0.Final\jboss-modules.jar -mp C:\jbpm-installer\wildfly-8.1.0.Final\modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=C:\jbpm-installer\wildfly-8.1.0.Final -b localhost --server-config=standalone-full.xml -Dorg.kie.demo=false -Dorg.kie.example=false -Dorg.kie.server.id=first-kie-server -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.kie.server.user=kieserver -Dorg.kie.server.pwd=kieserver1! -Dorg.kie.server.controller.user=kieserver -Dorg.kie.server.controller.pwd=kieserver1!

    OdpowiedzUsuń
    Odpowiedzi
    1. you have a type in the role name - it should be kie-server with dash in between kie and server:
      kieserver=admin,kie-server,rest-all
      workbench=admin,kie-server,rest-all

      Usuń
  13. Forgive me, but I do not understand.

    Is the key value supposed to be "kieserver" (kieserver=...) or "kie-server" (kie-server=...)?

    Which of the following commands would be the correct one?

    add-user -a -u kieserver -p kieserver1! -ro admin,kieserver,rest-all

    add-user -a -u kieserver -p kieserver1! -ro admin,kie-server,rest-all

    If it's not too much trouble, perhaps you could show me what the entry is supposed to look like in each of the files that control this authentication.

    I have tried multiple combinations of kieserver and kie-server and none of them work. I seem to remember some time ago when I looked at Drools that I had to use Tomcat instead of JBoss to make it work, though that was at least 18 months ago.

    I also added the kieserver user to the management realm to confirm that I had the password correct and that WildFly could authenticate it. There were no issues.

    Is there a higher debugging level I might use here?

    Thanks again for your generosity.

    OdpowiedzUsuń
  14. Sorry for all the messages. I just went to my Centos 7 box, downloaded WildFly 8.2.0.Final and the other two components, and followed the instructions above.

    The kie-wb component failed, but I think that was due to issues with the server being behind a proxy.

    Anyway, it appeared to work. I think the issue may be the WildFly version, though it is possible that I made some other error now that I look at it. The kie.server.id may have gotten mixed up.

    I'll let you know if I have issues in Windows.

    OdpowiedzUsuń
  15. I can confirm that it works on my Windows 7 workstation also. I must have gotten something in the configuration wrong on I needed to use WildFly 8.2.0 as you detail above.

    I'm sorry to have troubled you with this.

    OdpowiedzUsuń
  16. If I may impose upon you again, is there a way to configure a KIE execution server so that it can be accessed from another system? All of the examples configure it on localhost, but I wanted to have a Workbench instance on one server and one (or more) KIE execution servers on another server.

    I can't find anything in the documentation that directly addresses this.

    As always, thank you for your generous help.

    OdpowiedzUsuń
  17. Me again... I actually think I figured it out. I "exposed" the kie-server and controller on "workbench" host and the remote "kie server" host by replacing "localhost" in the org.kie.server.location and org.kie.server.controller system properties with the fully qualified domain name of the appropriate hosts.

    Example:

    KIE Execution Server:

    org.kie-server.id=remote-kieserver
    org.kie.server.location=http://kie-exec-server.domain.com:8080/kie-server/services/rest/server
    org.kie.server.controller=http://kie-wb-server.domain.com:8080/kie-wb/rest/controller

    KIE Workbench Server:

    org.kie-server.id=workbench-kieserver
    org.kie.server.location=http://kie-wb-server.domain.com:8080/kie-server/services/rest/server
    org.kie.server.controller=http://kie-wb-server.domain.com:8080/kie-wb/rest/controller

    After both environments are started, this results in multiple KIE execution servers being displayed under the Deploy->Server Management Browser page. I assume then that I would be able to deploy to the remote server at some point. I'm just getting started with Drools, so I haven't gotten that far.

    Thanks for listening.

    OdpowiedzUsuń
    Odpowiedzi
    1. correct, you control them via these properties. Since you change endpoint location but kept the same server id they will be seen as two - one on localhost used previously and the new one. In 6.4 there was much nicer UI for execution servers and this issue is already addressed.

      Usuń
  18. Hi ... i am getting a problem with the kie-wb. I have followed the instructions and trying to get the kie-wb working tomcat... i could see the the war is getting unpacked. I get some error while tomcat starts..

    java.lang.RuntimeException: Unable to create EntityManagerFactory due to [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory

    Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:jboss/datasources/ExampleDS]

    I try hitting http://localhost:8080/kie-wb/rest/controller and i always get 404. Any help would be much appreciated!

    Rahul

    OdpowiedzUsuń
  19. Hi

    I have problem with localization of kie-wb.

    For example i build source of kie-wb-common-6.3.0.Final and change the CommonConstants.properties
    file in kie-wb-common-6.3.0.Final\kie-wb-common-widgets\kie-wb-common-ui\target\classes\org\kie\workbench\common\widgets\client\resources\i18n.
    I copy CommonConstants.properties in
    \webapps\kie-wb\WEB-INF\classes\org\kie\workbench\client\resources\i18n .
    but nothing happen and the jar file in source is not in the kie-wb war file
    Please help me
    Thanx so much

    OdpowiedzUsuń
  20. Hi,
    Not able to connect with MySQL DB. getting error

    SEVERE [localhost-startStop-1] org.kie.workbench.drools.backend.server.AppSetup.assertPlayground Error during update config
    javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925)
    .
    .
    .
    ..
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:comp/env/jdbc/jbpmDS]
    at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)

    Please help me.
    Thanks in advance

    OdpowiedzUsuń
  21. there is a lot to learn from you regarding my jboss training.

    OdpowiedzUsuń
  22. Hi I downloaded wildfly-8.1, and the war file this blog. I am running using jdk 1.7.
    I am getting the following 405 error.
    I added user with role : admin, kie-server,rest-all
    localhost:8080 shows wildfy8 is running, but http://localhost:8080/kie-wb gives 404 error
    Thank you.
    ----
    14:38:20,037 WARN [org.kie.server.services.impl.controller.DefaultRestControlle
    rImpl] (KieServer-ControllerConnect) Exception encountered while syncing with co
    ntroller at http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserve
    r error Error while sending PUT request to http://localhost:8080/kie-wb/rest/con
    troller/server/wildfly-kieserver response code 405

    OdpowiedzUsuń
  23. Hi I downloaded wildfly-8.1, and the war file this blog. I am running using jdk 1.7.
    I am getting the following 405 error.
    I added user with role : admin, kie-server,rest-all
    localhost:8080 shows wildfy8 is running, but http://localhost:8080/kie-wb gives 404 error
    Thank you.
    ----
    14:38:20,037 WARN [org.kie.server.services.impl.controller.DefaultRestControlle
    rImpl] (KieServer-ControllerConnect) Exception encountered while syncing with co
    ntroller at http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserve
    r error Error while sending PUT request to http://localhost:8080/kie-wb/rest/con
    troller/server/wildfly-kieserver response code 405

    OdpowiedzUsuń
  24. Hi maciej,
    I follow your post and i deployed kie workbench on tomcat but when i am connecting workbench
    to mysql i am getting some error.could you tell me how come i can out from this error..
    Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:comp/env/jdbc/jbpm]
    Caused by: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/jbpm', available resources: [jdbc/jbpmDS]

    OdpowiedzUsuń
  25. Hi, I'm try to get it working kie on tomcat 7 and getting the below error, kie unable to deploy:

    java.lang.RuntimeException: https://github.com/guvnorngtestuser1/jbpm-console-ng-playground-kjar.git: cannot open git-upload-pack
    at org.guvnor.structure.backend.repositories.git.GitRepositoryBuilder.createFileSystem(GitRepositoryBuilder.java:139)
    at org.guvnor.structure.backend.repositories.git.GitRepositoryBuilder.build(GitRepositoryBuilder.java:61)
    at org.guvnor.structure.backend.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:64)
    at org.guvnor.structure.backend.repositories.git.GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.newRepository(GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.java)
    at org.guvnor.structure.backend.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:61)

    OdpowiedzUsuń
  26. This is really an interesting blog as it focuses on the very important topic. i came to know about so many things or tips.
    Herbal Incense

    OdpowiedzUsuń
  27. This is really an interesting blog as it focuses on the very important topic. i came to know about so many things or tips.
    Herbal Incense

    OdpowiedzUsuń
  28. Hi,

    I have the kieserver and workbench running on same server as instructed above using

    ./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.id=wildfly-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller

    Is there a way to run multiple servers on same box. For example:
    -Dorg.kie.server.id=wildfly-kieserver1
    -Dorg.kie.server.id=wildfly-kieserver2

    Thanks in advance for your help.

    Rob

    OdpowiedzUsuń
    Odpowiedzi
    1. nope, this is not possible as they are given as system property and thus are global for single jvm/server instance

      Usuń
  29. Hi, need your help with the deployment of workbench. I installed wildfly 9.0.2 final from their website (Java EE7 Full & Web Distribution). I then added an admin user in the managemenr realm and 2 users in application realm with the same credentials as you suggested. Then i downloaded the .war 2 files from the above link, changed their name and copied them in the deployement folder. Post all this i use:
    ./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.id=wildfly-kieserver -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller


    command on my terminal to start the server. I was able to start the wildfly server and the Kie server got deployed but workbench deployment failed for some reason.
    I get the following warning:
    WARN [org.kie.server.services.impl.controller.DefaultRestControllerImpl] (KieServer-ControllerConnect) Exception encountered while syncing with controller at http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserver error Error while sending PUT request to http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserver response code 405

    and the following message on my terminal:

    service jboss.ws.endpoint."kie-wb.war".CommandWebService (new available)
    WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."kie-wb.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."kie-wb.war".WeldStartService: Failed to start service

    Please do help.. have been trying to figure it out.

    Thanks
    Nikhil

    OdpowiedzUsuń
  30. Hi.

    I followed the instructions above but for versions 6.5 with the corresponding kie-tomcat-integration-6.5.0-Final.jar, my workbench won't come up. I'm using the H2 connector. In my catalina.out for my tomcat, I see this in the log repeating every few seconds.

    org.kie.server.services.impl.controller.DefaultRestControllerImpl connect
    WARNING: Exception encountered while syncing with controller at http://localhost:8080/kie-wb/rest/controller/server/tomcat-kieserver error Error while sending PUT request to http://localhost:8080/kie-wb/rest/controller/server/tomcat-kieserver response code 500


    http://localhost:8080/kie-server/services/rest/server seems to be working fine.

    Any advice on what could be causing the 500 error code?

    Thanks.
    Lap

    OdpowiedzUsuń
    Odpowiedzi
    1. I resolved it. There is a README in the kie-wb war that talks about configuring JEE security for kie-wb on tomcat. It didn't seem to be a necessary step for 6.3, but is for 6.5

      Usuń
  31. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in DROOLS TRAINING, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Sangita Mohanty
    MaxMunus
    E-mail: sangita@maxmunus.com
    Skype id: training_maxmunus
    Ph:(0) 9738075708 / 080 - 41103383
    http://www.maxmunus.com/

    OdpowiedzUsuń
  32. I honestly love your blog. It was very useful and it inspired me a whole lot. Thanks for sharing
    Herbal Incense

    OdpowiedzUsuń
  33. Hi
    Can any one help me to fix this issue, i installed both kie server and workbench in ubuntu .But am getting below error
    Caused by: org.uberfire.java.nio.IOException: java.io.IOException: Failed to open server socket for /127.0.0.1:9418
    at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.buildAndStartDaemon(JGitFileSystemProvider.java:508)
    at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.(JGitFileSystemProvider.java:374)
    at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.(JGitFileSystemProvider.java:343)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    ... 70 more
    Caused by: java.io.IOException: Failed to open server socket for /127.0.0.1:9418
    at org.uberfire.java.nio.fs.jgit.daemon.git.Daemon.start(Daemon.java:197)
    at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.buildAndStartDaemon(JGitFileSystemProvider.java:506)

    OdpowiedzUsuń
    Odpowiedzi
    1. looks like there is already something bound to port 9418. Maybe another instance of workbench is still running

      Usuń