miércoles, 10 de agosto de 2011

DEPLOY BONITA USER XP 5.4.1 on GlassFish 3.1

Spanish Version


Prerequisites:
-ant installation: in linux:

apt-get install ant

-Create PostgreSQL databases: journal and history in PostgreSQL.

1. Export from the STUDIO the userxp and the engine:

Go to Bonita Studio menu, Export Process-Advanced, click on Switch to the last step, Runtime Export Select, verify path: / home/silvia/bonita_applications2, click on Export.

2. Connecting to databases: history and journal.

you have to change this files content:
/ Home/silvia/bonita_applications2/conf/bonita/server/default/conf/bonita-history.properties
and
/ Home/silvia/bonita_applications2/conf/bonita/server/default/conf/bonita-journal.properties


Taking into account for postgreSQL:

hibernate.connection.driver_class org.hibernate.dialect.PostgreSQLDialect hibernate.dialect org.postgresql.Driver
hibernate.connection.url jdbc: postgresql: localhost: 5432/bonita_core
hibernate.connection.shutdown true
postgres hibernate.connection.username
suPostgresPassword hibernate.connection.password

Configure two files:

##
# POSTGRESQL HISTORY

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.shutdown true

# The following properties must be commented out for deployment using datasource (e.g. when using bundles provided by BonitaSoft)
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/history
hibernate.connection.username postgres
hibernate.connection.password silvia

# #
# PostgreSQL JOURNAL OR CORE

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.shutdown true

# The following properties must be commented out for deployment using datasource (e.g. when using bundles provided by BonitaSoft)
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/journal
hibernate.connection.username postgres
hibernate.connection.password silvia


3. copy the DB(PostgreSQL) driver : postgresql-8.4-702.jdbc4.jar

in :

/ home/silvia/bonita_applications2/runtime/lib/server/



4. Db Connection, filling the database tables by built.xml
Located in the runtime folder and enter the command console terminal: ant init-db

silvia-root @ desktop: / home / silvia / bonita_applications2 / runtime # ant init-db

BuildFile: / home / silvia / bonita_applications2 / runtime / build.xml
init-db:
[Input]
[Input] Which domain you want to use to (press enter to use default Without nothing)?
[Input] [default]

ENTER to: DEFAULT

[Input] Where is your BONITA_HOME folder?
[Input]
/Home/silvia/bonita_applications2/conf/bonita /: path BONITA_HOME
[Input]
[Input] Which configuration to use hibernate to generate database (press enter to use default Without nothing)?
[Input] Default is 'hibernate-configuration: core hibernate-configuration: history' to init Both databases
[Input] [hibernate-configuration: core hibernate-configuration: history]
hibernate-configuration: history first
hibernate-configuration: core second time


4. GENERATE BONITA.EAR
Enter the command ant ear.ejb3 from runtime.

root@silvia-desktop:/home/silvia/bonita_applications2/runtime# ant ear.ejb3
Buildfile: /home/silvia/bonita_applications2/runtime/build.xml
ear.ejb3:
ear:
[mkdir] Created dir: /home/silvia/bonita_applications2/runtime/ear/tmp
[mkdir] Created dir: /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 1 file to /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 4 files to /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 1 file to /home/silvia/bonita_applications2/runtime/ear/ejb3
[jar] Updating jar: /home/silvia/bonita_applications2/runtime/ear/ejb3/bonita-ejbjar.jar
[delete] Deleting directory /home/silvia/bonita_applications2/runtime/ear/tmp
[copy] Copying 49 files to /home/silvia/bonita_applications2/runtime/ear/lib
[ear] Building ear: /home/silvia/bonita_applications2/runtime/ear/ejb3/bonita.ear
[echo] EJB3 ear has been generated in ear/ejb3 directory.
[echo] You can use it in the easybeans container, jonas 5 and jboss 5 application server.
BUILD SUCCESSFUL
Total time: 3 seconds


This will generate the file in the directory bonita.ear: bonita_applications2/runtime/ear/ejb3, and this is the file that we can deploy our application server.


You can verify that created the. Ear, and has sun-ejb-jar.xml inside it.
/ Home/silvia/bonita_applications2/runtime/ear/ejb3/glassfish/sun-ejb-jar.xml
Display bonita.ear file in Glassfish.


5. copy the contents of the folders


bonita_applications2/runtime / server / lib: Libraries Bonita engine
bonita_applications2/runtime / client / lib: Libraries Client
bonita_applications2/web / lib: Libraries (Bonita User XP)

in
glassfish3/glassfish/domains/domain1/lib/


6. Set BONITA_HOME path in JVM.

-DBONITA_HOME=${com.sun.aas.installRoot}/bonita

7. Bonita configure User security XP (Auth) and Bonita engine
: BonitaStore


Copy the the contents of JAAS-standard.cfg located in:
/bonita_applications2/conf/external/security/jaas-standard.cfg

to:
/glassfish/domains/domain1/config/login.conf:



BonitaAuth {
org.ow2.bonita.identity.auth.BonitaIdentityLoginModule required;
};
BonitaStore {
org.ow2.bonita.identity.auth.LocalStorageLoginModule required;
};

8. Deploy bonita.war on the server who is located in the bonita_applications2/web/bonita.war: D




HOW TO SOLVE THE ERROR?


HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP  PWC6199: Generated servlet error: string:///login_jsp.java:6: package org.bonitasoft.console.security.server does not exist  PWC6197: An error occurred at line: 21 in the jsp file: /console/login.jsp PWC6199: Generated servlet error:
string:///login_jsp.java:57: cannot find symbol symbol : variable

CredentialsEncryptionServlet location: class org.apache.jsp.console.login_jsp note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.

GlassFish Server Open Source Edition 3.1.1

Well, this error indicates that : your /bonita_applications/web/lib/security-server-5.4.1.jar there is not in your folder : glassfish3/glassfish/domains/domain1/lib/.

So you have to copy all the libs of the folder /bonita_applications2/web/lib/ to the glassfish3/glassfish/domains/domain1/lib/. and after that deploy BonitaUserXp (BUE)

DESPLIEGUE DE BONITA USER XP 5.4.1 EN GLASSFISH 3.1

English Version

Requerimientos previos:
instalación de ant.
Creación de las bases de datos en postgreSQL: journal e history.

1. Exportar desde bonita el userxp y el motor:

Ir al menu de Bonita Studio , Proceso- Exportar Avanzado, Dar clic en Pasar al ultimo paso, Seleccionar Exportar Runtime , verificar ruta: /home/silvia/bonita_applications2, Dar clic en Exportar.
En la carpeta obtenida modificar los archivos, que se encargan de

2. la conexión con las bases de datos journal e history.

/home/silvia/bonita_applications2/conf/bonita/server/default/conf/bonita-history.properties
y en
/home/silvia/bonita_applications2/conf/bonita/server/default/conf/bonita-journal.properties


Teniendo en cuenta para postgreSQL:

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql:localhost:5432/bonita_core
hibernate.connection.shutdown true
hibernate.connection.username postgres
hibernate.connection.password suPostgresPassword

Se configuran los 2 archivos:

##
# POSTGRESQL HISTORY

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.shutdown true

# The following properties must be commented out for deployment using datasource (e.g. when using bundles provided by BonitaSoft)
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/history
hibernate.connection.username postgres
hibernate.connection.password silvia


##
# POSTGRESQL JOURNAL O CORE

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.shutdown true

# The following properties must be commented out for deployment using datasource (e.g. when using bundles provided by BonitaSoft)
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/journal
hibernate.connection.username postgres
hibernate.connection.password silvia


3. copiar en /home/silvia/bonita_applications2/runtime/lib/server/ el driver de la bd : postgresql-8.4-702.jdbc4.jar

4. Conexión BD, mediante built.xml
Ubicarse en la carpeta runtime e ingresar en terminal consola el comando: ant init-db

root@silvia-desktop:/home/silvia/bonita_applications/runtime# ant init-db

Buildfile: /home/silvia/bonita_applications/runtime/build.xml
init-db:
[input]
[input] Which domain to you want to use (press enter without nothing to use default)?
[input] [default]

dar ENTER: DEFAULT
[input] Where is your BONITA_HOME folder?
[input]
/home/silvia/bonita_applications2/conf/bonita/ : ruta BONITA_HOME
[input]
[input] Which hibernate configuration to use to generate database (press enter without nothing to use default)?
[input] Default is 'hibernate-configuration:core hibernate-configuration:history' to init both databases
[input] [hibernate-configuration:core hibernate-configuration:history]
hibernate-configuration:history primera vez
hibernate-configuration:core segunda vez
4. GENERAR BONITA.EAR
Ingresar el comando ant ear.ejb3 desde runtime.

root@silvia-desktop:/home/silvia/bonita_applications2/runtime# ant ear.ejb3
Buildfile: /home/silvia/bonita_applications2/runtime/build.xml
ear.ejb3:
ear:
[mkdir] Created dir: /home/silvia/bonita_applications2/runtime/ear/tmp
[mkdir] Created dir: /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 1 file to /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 4 files to /home/silvia/bonita_applications2/runtime/ear/tmp/META-INF
[copy] Copying 1 file to /home/silvia/bonita_applications2/runtime/ear/ejb3
[jar] Updating jar: /home/silvia/bonita_applications2/runtime/ear/ejb3/bonita-ejbjar.jar
[delete] Deleting directory /home/silvia/bonita_applications2/runtime/ear/tmp
[copy] Copying 49 files to /home/silvia/bonita_applications2/runtime/ear/lib
[ear] Building ear: /home/silvia/bonita_applications2/runtime/ear/ejb3/bonita.ear
[echo] EJB3 ear has been generated in ear/ejb3 directory.
[echo] You can use it in the easybeans container, jonas 5 and jboss 5 application server.
BUILD SUCCESSFUL
Total time: 3 seconds

Lo anterior generará el archivo bonita.ear en el directorio: bonita_applications2/runtime/ear/ejb3, y este es el archivo que podemos desplegar en nuestro servidor de aplicaciones.

Se puede verificar que se creo el .ear, y que tiene sun-ejb-jar.xml dentro de este.
/home/silvia/bonita_applications2/runtime/ear/ejb3/glassfish/sun-ejb-jar.xml
Desplegar archivo bonita.ear en Glassfish.


5. copiar el contenido de las carpetas q se encuentran en: /runtime/server/lib: las librerias del motor de bonita, y /web/lib: librerias del cliente (Bonita User XP).

6. Configurar ruta del BONITA_HOME en JVM.


-DBONITA_HOME=${com.sun.aas.installRoot}/bonita


7. Configurar la seguridad de Bonita User XP(Auth) y el motor de bonita: BonitaStore

login.conf : agregar el contenido de jaas-standard.cfg

BonitaAuth {
org.ow2.bonita.identity.auth.BonitaIdentityLoginModule required;
};
BonitaStore {
org.ow2.bonita.identity.auth.LocalStorageLoginModule required;
};

8. Desplegar el bonita.war en el servidor que se encuentra en la carpeta bonita_applications2/web/bonita.war :D