domingo, 28 de julio de 2013

Integracion BonitaOpenSolution in Jboss

I follow the steps described in the document:
Includes BOS 5.5.1 and a JBoss 5.1.0 server
http://www.bonitasoft.com/products/BPM_downloads#tabs-9

1.  Copy all *.jar files from <BOS-5.5-DEPLOY>\bonita_execution_engine\bonita_client\libs and <BOS-5.5-DEPLOY>\bonita_execution_engine\engine\libs to <JBOSS_HOME>\server\default\lib
2. Copy <BOS-5.5-DEPLOY>\bonita_user_experience\without_execution_engine_without_client\bonita.war to <JBOSS_HOME>\server\default\deploy.
3. Edit the files
<JBOSS_HOME>\bonita\server\default\conf\bonita-journal.properties
<JBOSS_HOME>\bonita\server\default\conf\bonita-history.properties
I commented the Default database configuration section in both files and uncomment all POSTGRESQL section, for example:
##################################
# Default database configuration #
##################################
# IMPORTANT: do not use those settings for production!
# By default Bonita use a H2 database that will store all data in one file.
# Access to the database is done throught a datasource configured in Tomcat configuration file: conf/context.xml
# H2 Hibernate dialect
# hibernate.dialect                        org.hibernate.dialect.H2Dialect
# Using an interceptor can change the database behaviour. By default, an interceptor is defined to order the result of queries by adding null values at the end.
# bonita.hibernate.interceptor             org.ow2.bonita.env.interceptor.H2DescNullFirstInterceptor
# Table are automatically create in database
# hibernate.hbm2ddl.auto                   update
# Location of the datasource (define in Tomcat configuration file: conf/context.xml)
# hibernate.connection.datasource          java:/comp/env/bonita/default/history
# Default database connection over H2 (not using datasources)
# hibernate.connection.driver_class        org.h2.Driver
# hibernate.connection.url                 jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_history.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
# hibernate.connection.username            bonita
# hibernate.connection.password            bpm
hibernate.dialect                        org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class        org.postgresql.Driver
hibernate.connection.url                 jdbc:postgresql://localhost:5432/bonita_history
hibernate.connection.username            my_user
hibernate.connection.password            my_passwd
databases were previously created y my postgres server and also the username and password

4.  In <JBOSS_HOME>\external\xcmis\ext-exo-conf folder I have used exo-configuration-mysql.xml and cmis-jcr-configuration-mysql.xml in order to created two files: exo-configuration-mysql.xml
cmis-jcr-configuration-postgresql.xml and exo-configuration-postgres.xml
In exo-configuration-postgres.xml change the following:
    <component>
      <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
      <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
      <init-params>
         <value-param>
            <name>conf-path</name>
            <description>JCR configuration file</description>
            <value>/cmis-jcr-configuration-postgresql.xml</value>
         </value-param>
      </init-params>
    </component>

    <properties-param>
       <name>ref-addresses</name>
       <description>ref-addresses</description>
      <property name="driverClassName" value="org.postgresql.Driver"/>
      <property name="url" value="jdbc:postgresql://localhost:5432/xcmis"/>
      <property name="username" value="postgres"/>
      <property name="password" value="debian"/>
    </properties-param>
In cmis-jcr-configuration-postgresql.xml change the following:
    <workspace name="system">
    <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
    <properties>
      <property name="source-name" value="jdbcxcmis" />
      <property name="dialect" value="pgsql" />
      <property name="multi-db" value="false" />
      <property name="max-buffer-size" value="200k" />
      <property name="swap-directory" value="${exo.data.dir}/swap/system" />
    </properties>
    </container>
               
    <workspace name="cmis1">
      <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
        <properties>
          <property name="source-name" value="jdbcxcmis" />
          <property name="dialect" value="pgsql" />
          <property name="multi-db" value="false" />
          <property name="max-buffer-size" value="200k" />
          <property name="swap-directory" value="${exo.data.dir}/swap/cmis1" />
        </properties>
      </container>
       
5. Copy the JDBC driver to <JBOSS_HOME>\server\default\lib.
postgresql-9.1-901.jdbc4.jar
6. In the step 2.5.3 Configure logging, I  did not find <JBOSS_HOME>\conf\logging.properties , I found
/etc/java6-open-jdk/logging.properties and edit it and added the lines
org.ow2.bonita.level = INFO
org.ow2.bonita.example.level = FINE
org.ow2.bonita.runtime.event.EventDispatcherThread.level = WARNING
org.hibernate.level = WARNING
net.sf.ehcache.level = SEVERE
7. IN <JBOSS_HOME>\bin\run.conf i added the lines
BONITA_OPTS="-DBONITA_HOME=/usr/share/jbossas5/bonita -Dorg.ow2.bonita.api-type=Standard"  LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties" mycwd=`pwd` CMIS_CONFIG="-Dexo.data.dir=/usr/share/jbossas5/external/xcmis/ext-exo-data -Dorg.exoplatform.container.standalone.config=/usr/share/jbossas5/external/xcmis/ext-exo-conf/exo-configuration-postgres.xml" JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $LOG_OPTS $CMIS_CONFIG -Dfile.encoding=UTF-8 -Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError" export JAVA_OPTS
8. In the step 2.6 Configure JAAS authentication and communication,  I  did not find <JBOSS_HOME>\conf\logging.properties, I found the following files:
/etc/jbossas5/profiles/all/login-config.xml
/etc/jbossas5/profiles/default/login-config.xml
/etc/jbossas5/profiles/standard/login-config.xml
/etc/jbossas5/profiles/web/login-config.xml
In all files  I added the following lines:
<application-policy name="BonitaAuth">
      <authentication>
      <login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule"
       flag="required"/>
      </authentication>
</application-policy>
<application-policy name="BonitaStore">
      <authentication>
      <login-module code="org.ow2.bonita.identity.auth.LocalStorageLoginModule"
       flag="required"/>
      </authentication>
</application-policy>
<application-policy name="exo-domain">
<authentication>
   <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule"
     flag="required"/>
</authentication>
</application-policy>
9. My jboss server is running and I try to open the bonita software with http://127.0.0.1:8080/bonita/, in the form I placed the credentials
username: admin
passwd: bpm
And then the error occurs:
    org.ow2.bonita.util.BonitaRuntimeException: The system property 'BONITA_HOME' is not set
    org.ow2.bonita.util.BonitaConstants.getBonitaHomeFolder(BonitaConstants.java:75)
    org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:117)
    $Proxy350.generateTemporaryToken(Unknown Source)
    org.bonitasoft.console.security.server.api.impl.CredentialsEncryptionAPIImpl.generateTemporaryToken(CredentialsEncryptionAPIImpl.java:157)
    org.bonitasoft.console.security.server.CredentialsEncryptionServlet.doPost(CredentialsEncryptionServlet.java:107)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 
I do not know how to solve this I am new using open source technologies
please if anyone can help I'd appreciate it greatly

No hay comentarios:

Publicar un comentario