Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
styledecimal

Introduction

Once you have created your project, you can start adapting it to your own needs and requirements.

...

For example, you can create directories as follows:

Code Block

$ mkdir /opt/syncope
$ mkdir /opt/syncope/bundles
$ mkdir /opt/syncope/log

...

as indicated in the following.

PostgreSQL

Code Block

jpa.driverClassName=org.postgresql.Driver
jpa.url=jdbc:postgresql://localhost:5432/syncope
jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.PostgresDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
quartz.sql=tables_postgres.sql
logback.sql=postgresql.sql

...

Code Block
syncope

MySQL

Code Block

jpa.driverClassName=com.mysql.jdbc.Driver
jpa.url=jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8
jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.MySQLDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
quartz.sql=tables_mysql_innodb.sql
logback.sql=mysql.sql

...

Code Block
quartz.sql=tables_mysql.sql

...

Oracle

Code Block

jpa.driverClassName=oracle.jdbc.OracleDriver
jpa.url=jdbc:oracle:thin:@localhost:1521:orcl
jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.OracleDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
quartz.sql=tables_oracle.sql
logback.sql=oracle.sql
database.schema=SYNCOPE

...

Code Block
syncope

You will also need to

  1. create directory

    Code Block
    core/src/main/resources/META-INF
  2. download Oracle mapping file for the version you are building (1.1.X, 1.0.X)
  3. rename it to

    Code Block
    orm.xml

    and copy it under the directory created above

Microsoft SQL Server

Code Block

jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa.url=jdbc:sqlserver://localhost:1344;database=syncope;selectMethod=cursor;sendStringParametersAsUnicode=false
jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate
quartz.sql=tables_sqlServer.sql
logback.sql=sqlserver.sql

...

Code Block
syncope

You will also need to

  1. create directory

    Code Block
    core/src/main/resources/META-INF
  2. download MS SQL Server mapping file for the version you are building (1.1.X, 1.0.X)
  3. rename it to

    Code Block
    orm.xml

    and copy it under the directory created above

JEE container

Apache Tomcat 7

...

Optionally, define a datasource for internal storage (following example is for MySQL): please check that the connection parameters are same as configured above.

Code Block

<Resource name="jdbc/syncopeDataSource" auth="Container" type="javax.sql.DataSource"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true"
          testOnBorrow="true" testOnReturn="true" validationQuery="SELECT 1" validationInterval="30000"
          maxActive="100" minIdle="2" maxWait="10000" initialSize="2" removeAbandonedTimeout="20000"
          removeAbandoned="true" logAbandoned="true" suspectTimeout="20000"
          timeBetweenEvictionRunsMillis="5000" minEvictableIdleTimeMillis="5000"
          jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
          username="syncope" password="syncope" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8"/>

...

Glassfish 3.1

Add JVM option

Code Block

-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext

...

When using a datasource for internal storage, be sure to add

Code Block

  <resource-ref>
    <res-ref-name>jdbc/syncopeDataSource</res-ref-name>
    <jndi-name>jdbc/syncopeDataSource</jndi-name>
  </resource-ref>

...

Code Block
core/src/main/resources/

and replace

Code Block

<entry key="openjpa.MetaDataFactory" value="org.apache.syncope.core.persistence.openjpa.JBossPersistenceMappingFactory(URLs=vfs:${project.build.directory}/cargo/configurations/jboss71x/deployments/${project.build.finalName}.war/WEB-INF/classes/, Resources=META-INF/orm.xml)"/>

with

Code Block

<entry key="openjpa.MetaDataFactory" value="org.apache.syncope.core.persistence.openjpa.JBossPersistenceMappingFactory(URLs=vfs:/content/${project.build.finalName}.war/WEB-INF/classes/, Resources=META-INF/orm.xml)"/>

...

Code Block
core/src/main/resources/

and replace

Code Block

<entry key="openjpa.MetaDataFactory" value="jpa(URLs=vfs:${project.build.directory}/cargo/configurations/jboss71x/deployments/${project.build.finalName}.war/WEB-INF/classes/, Resources=META-INF/orm.xml)"/>

with

Code Block

<entry key="openjpa.MetaDataFactory" value="jpa(URLs=vfs:/content/${project.build.finalName}.war/WEB-INF/classes/, Resources=META-INF/orm.xml)"/>

...

core web.xml

Change

Code Block

  <resource-ref>
    <res-ref-name>jdbc/syncopeDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

to

Code Block

  <resource-ref>
    <res-ref-name>jdbc/syncopeDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <lookup-name>java:/syncopeDataSource</lookup-name>
  </resource-ref>

...

When using a datasource for internal storage, be sure to add

Code Block

  <resource-description>
    <jndi-name>syncopeDataSource</jndi-name>
    <res-ref-name>jdbc/syncopeDataSource</res-ref-name>
  </resource-description>

...

For example, when running your JEE container on port 9080, you should have

Code Block

scheme=http
host=localhost
port=9080
path=/syncope/rest/

...

Once you are ready to deploy, you might like to get rid of Wicket debug features provided by the console. Edit console/src/main/webapp/WEB-INF/web.xml, and change development to deployment as in the following configuration fragment (from 1.1 onwards you will have to explicitly add this):

Code Block

<context-param>
     <param-name>configuration</param-name>
     <param-value>deployment</param-value>
</context-param>

...

Assuming that you have created the two deployment directories defined above, just run

Code Block

mvn clean package -Dbundles.directory=/opt/syncope/bundles -Dlog.directory=/opt/syncope/log

...