JBoss Identity SVN: r551 - in idm/trunk: integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5 and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-02 01:29:57 -0400 (Tue, 02 Jun 2009)
New Revision: 551
Modified:
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java
Log:
* Update the hibernate configuration, using the XA JTA Transaction.(removing session_context_class)
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml 2009-06-01 07:44:08 UTC (rev 550)
+++ idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml 2009-06-02 05:29:57 UTC (rev 551)
@@ -28,11 +28,6 @@
<hibernate-configuration>
<session-factory>
- <property name="show_sql">false</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property name="current_session_context_class">thread</property>
<!-- ask hibernate to do the schema population -->
<!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml 2009-06-01 07:44:08 UTC (rev 550)
+++ idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml 2009-06-02 05:29:57 UTC (rev 551)
@@ -28,11 +28,6 @@
<hibernate-configuration>
<session-factory>
- <property name="show_sql">false</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property name="current_session_context_class">thread</property>
<!-- ask hibernate to do the schema population -->
<!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-06-01 07:44:08 UTC (rev 550)
+++ idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-06-02 05:29:57 UTC (rev 551)
@@ -28,11 +28,6 @@
<hibernate-configuration>
<session-factory>
- <property name="show_sql">false</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property name="current_session_context_class">thread</property>
<!-- ask hibernate to do the schema population -->
<!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml 2009-06-01 07:44:08 UTC (rev 550)
+++ idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml 2009-06-02 05:29:57 UTC (rev 551)
@@ -28,11 +28,6 @@
<hibernate-configuration>
<session-factory>
- <property name="show_sql">false</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property name="current_session_context_class">thread</property>
<!-- ask hibernate to do the schema population -->
<!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
Modified: idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java
===================================================================
--- idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java 2009-06-01 07:44:08 UTC (rev 550)
+++ idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java 2009-06-02 05:29:57 UTC (rev 551)
@@ -11,6 +11,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.InitialContext;
@@ -71,28 +72,34 @@
}
}
- private void executeSql(String resource, Connection conn) throws Exception
+ private void executeSql(String resource, Connection conn)
{
URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
- String sql = new String(readStream(url.openStream()) , "UTF-8");
- sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all commented lines
- final String[] statements ;
- statements = sql.split(";");
-
- for (String statement : statements)
- {
- if ((statement == null) || ("".equals(statement.trim()))) {
- } else {
- Statement sqlStatement = conn.createStatement();
- try
- {
- sqlStatement.executeUpdate(statement);
- }
- finally
- {
- sqlStatement.close();
- }
+ try {
+ String sql = new String(readStream(url.openStream()) , "UTF-8");
+ sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all commented lines
+ final String[] statements ;
+ statements = sql.split(";");
+
+ for (String statement : statements)
+ {
+ if ((statement == null) || ("".equals(statement.trim()))) {
+ } else {
+ Statement sqlStatement = conn.createStatement();
+ try
+ {
+ sqlStatement.executeUpdate(statement);
+ } catch (Exception e) {
+ logger.log(Level.WARNING, "Exception in executing :" + statement, e);
+ }
+ finally
+ {
+ sqlStatement.close();
+ }
+ }
}
+ } catch (Exception e) {
+ logger.log(Level.WARNING, "Exception in populating :" + resource, e);
}
}
17 years, 1 month
JBoss Identity SVN: r550 - idm/trunk/assembly/src/main/files/jboss/datasources.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-01 03:44:08 -0400 (Mon, 01 Jun 2009)
New Revision: 550
Modified:
idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-oracle-ds.xml
Log:
* Remove the mbean registration from the ds.
Modified: idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-oracle-ds.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-oracle-ds.xml 2009-06-01 06:22:01 UTC (rev 549)
+++ idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-oracle-ds.xml 2009-06-01 07:44:08 UTC (rev 550)
@@ -36,9 +36,4 @@
</metadata>
</xa-datasource>
- <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
- name="jboss.jca:service=OracleXAExceptionFormatter">
- <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
- </mbean>
-
</datasources>
17 years, 1 month
JBoss Identity SVN: r549 - in idm/trunk: assembly/scripts and 9 other directories.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-01 02:22:01 -0400 (Mon, 01 Jun 2009)
New Revision: 549
Added:
idm/trunk/assembly/src/main/config/mssql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/db/hibernate.cfg/mssql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/db/jdbc/mssql.properties
idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-mssql-jboss-beans.xml
idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-postgresql-jboss-beans.xml
idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-sybase-jboss-beans.xml
idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-mssql-ds.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml
Modified:
idm/trunk/assembly/pom.xml
idm/trunk/assembly/scripts/antrun-schema.xml
idm/trunk/assembly/scripts/assembly-distro.xml
idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties
idm/trunk/assembly/src/main/files/db/jdbc/oracle.properties
idm/trunk/assembly/src/main/files/db/jdbc/postgresql.properties
idm/trunk/assembly/src/main/files/db/jdbc/sybase.properties
idm/trunk/assembly/src/main/files/jboss/build.xml
idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-sybase-ds.xml
idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java
idm/trunk/idm-cache/pom.xml
Log:
* Add the mssql, sybase db configuration.
* Using the deployer solution in the jboss deployment, instead of MBean as it was.
Modified: idm/trunk/assembly/pom.xml
===================================================================
--- idm/trunk/assembly/pom.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/pom.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -75,6 +75,22 @@
<version>${idm.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.identity.idm.integration</groupId>
+ <artifactId>idm-jboss5-deployer</artifactId>
+ <classifier>config</classifier>
+ <type>zip</type>
+ <version>${idm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm.integration</groupId>
+ <artifactId>idm-jboss5-deployer</artifactId>
+ <classifier>deployer</classifier>
+ <type>zip</type>
+ <version>${idm.version}</version>
+ </dependency>
+
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>${hibernate-commons-annotations}</version>
Modified: idm/trunk/assembly/scripts/antrun-schema.xml
===================================================================
--- idm/trunk/assembly/scripts/antrun-schema.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/scripts/antrun-schema.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -41,7 +41,13 @@
<!-- PostgreSQL -->
<create-ddl db="postgresql"/>
+
+ <!-- Sybase -->
+ <create-ddl db="sybase" />
+ <!-- MSSQL -->
+ <create-ddl db="mssql" />
+
</target>
<!--
Modified: idm/trunk/assembly/scripts/assembly-distro.xml
===================================================================
--- idm/trunk/assembly/scripts/assembly-distro.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/scripts/assembly-distro.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -18,7 +18,7 @@
<!-- useStrictFiltering>true</useStrictFiltering -->
<unpack>false</unpack>
<scope>test</scope>
- <excludes>
+ <!-- excludes>
<exclude>org.jboss.identity.idm.integration:idm-jboss5</exclude>
<exclude>org.jboss.identity.idm:idm-cache</exclude>
<exclude>org.jboss.identity.idm:idm-ldap</exclude>
@@ -28,20 +28,27 @@
<exclude>org.jboss.identity.idm:idm-common</exclude>
<exclude>org.jboss.identity.idm:idm-spi</exclude>
<exclude>org.jboss.identity.idm:idm-assembly</exclude>
- </excludes>
+ </excludes-->
<outputDirectory>lib</outputDirectory>
</dependencySet>
- <!-- modules -->
+ <!-- modules -->
<dependencySet>
<outputDirectory>modules</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<includes>
- <include>org.jboss.identity.idm.integration:idm-jboss5:zip:config</include>
+ <include>org.jboss.identity.idm.integration:idm-jboss5-deployer:zip:deployer</include>
</includes>
<unpack>true</unpack>
</dependencySet>
-
+ <dependencySet>
+ <outputDirectory>modules</outputDirectory>
+ <useStrictFiltering>true</useStrictFiltering>
+ <includes>
+ <include>org.jboss.identity.idm.integration:idm-jboss5-deployer:zip:config</include>
+ </includes>
+ <unpack>true</unpack>
+ </dependencySet>
</dependencySets>
<fileSets>
Added: idm/trunk/assembly/src/main/config/mssql.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/config/mssql.hibernate.cfg.xml (rev 0)
+++ idm/trunk/assembly/src/main/config/mssql.hibernate.cfg.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,52 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <!-- Mapping classes -->
+ <!-- all nessesary mappings are added programatically to the configuration in the store-->
+ <!-- this is for manual SF creation-->
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>
+
+
+ </session-factory>
+</hibernate-configuration>
Added: idm/trunk/assembly/src/main/files/db/hibernate.cfg/mssql.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/db/hibernate.cfg/mssql.hibernate.cfg.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/db/hibernate.cfg/mssql.hibernate.cfg.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,63 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">false</property>
+
+ <property name="current_session_context_class">thread</property>
+ <!-- ask hibernate to do the schema population -->
+ <!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
+
+ <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
+ <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+ <property name="hibernate.connection.url">@jdbc.url@</property>
+ <property name="hibernate.connection.username">@jdbc.username@</property>
+ <property name="hibernate.connection.password">@jdbc.password@</property>
+
+ <!-- Mapping classes -->
+ <!-- all nessesary mappings are added programatically to the configuration in the store-->
+ <!-- this is for manual SF creation-->
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>
+
+
+ </session-factory>
+</hibernate-configuration>
Added: idm/trunk/assembly/src/main/files/db/jdbc/mssql.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/mssql.properties (rev 0)
+++ idm/trunk/assembly/src/main/files/db/jdbc/mssql.properties 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,4 @@
+jdbc.driver=net.sourceforge.jtds.jdbc.Driver
+jdbc.url=jdbc:jtds:sqlserver://dev30.qa.atl.jboss.com:3918/portal
+jdbc.username=portal
+jdbc.password=password
Modified: idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties 2009-06-01 06:22:01 UTC (rev 549)
@@ -1,4 +1,4 @@
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/jbossidm
-jdbc.username=jbossidm
+jdbc.username=root
jdbc.password=
Modified: idm/trunk/assembly/src/main/files/db/jdbc/oracle.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/oracle.properties 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/db/jdbc/oracle.properties 2009-06-01 06:22:01 UTC (rev 549)
@@ -1,4 +1,4 @@
jdbc.driver=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@localhost:1521:jbossidm
-jdbc.username=jbossidm
-jdbc.password=jbossidm
+jdbc.url=jdbc:oracle:thin:@dev20.qa.atl.jboss.com:1521:qa
+jdbc.username=portal
+jdbc.password=password
Modified: idm/trunk/assembly/src/main/files/db/jdbc/postgresql.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/postgresql.properties 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/db/jdbc/postgresql.properties 2009-06-01 06:22:01 UTC (rev 549)
@@ -1,7 +1,7 @@
jdbc.driver=org.postgresql.Driver
jdbc.port=5432
-jdbc.server=localhost
-jdbc.databasename=jbossidm
-jdbc.url=jdbc:postgresql://localhost:5432/jbossidm
-jdbc.username=jbossidm
-jdbc.password=jbossidm
+jdbc.server=dev01.qa.atl.jboss.com
+jdbc.databasename=portal
+jdbc.url=jdbc:postgresql://dev01.qa.atl.jboss.com:5432:portal
+jdbc.username=portal
+jdbc.password=password
Modified: idm/trunk/assembly/src/main/files/db/jdbc/sybase.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/sybase.properties 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/db/jdbc/sybase.properties 2009-06-01 06:22:01 UTC (rev 549)
@@ -1,5 +1,5 @@
jdbc.driver=net.sourceforge.jtds.jdbc.Driver
# jdbc.driver=com.sybase.jdbc3.jdbc.SybDriver
-jdbc.url=jdbc:sybase:Tds:localhost:5000/jbossidm
-jdbc.username=jbossidm
-jdbc.password=jbossidm
+jdbc.url=jdbc:jtds:sybase://dev77.qa.atl2.redhat.com:4100/jbidentity
+jdbc.username=jbidentity
+jdbc.password=jbidentity
Modified: idm/trunk/assembly/src/main/files/jboss/build.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/build.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/jboss/build.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -27,26 +27,39 @@
<antcall target="internal.install.jbossidm.into.jboss5" />
<antcall target="internal.install.jbossidm.into.jboss.db.${database}" />
</target>
+
+ <target name="uninstall.jbossidm" description="uninstall jbossidm from jboss">
+ <delete dir="${jboss.server.config.dir}/deploy/idm" />
+ <delete dir="${jboss.server.config.dir}/deployers/idm-deployer" />
+ </target>
<!-- ### THE JBOSS GENERIC PART ######################################### -->
<target name="internal.install.jbossidm.into.jboss5">
- <copy todir="${jboss.server.config.dir}/deploy/idm" overwrite="true">
- <fileset dir="${jbossidm.home}/modules/" />
+ <copy todir="${jboss.server.config.dir}/deploy/idm/idm-service.sar" overwrite="true">
+ <fileset dir="${jbossidm.home}/modules/idm-service.sar" />
</copy>
+ <!-- ### Update the default-jboss-idm.xml #### -->
+ <copy file="${jbossidm.home}/modules/idm-service.sar/META-INF/default-jboss-idm.xml"
+ toFile="${jboss.server.config.dir}/deploy/idm/idm-service.sar/META-INF/default-jboss-idm.xml"
+ overwrite="true">
+ <filterset>
+ <filter token="database" value="${database}"/>
+ </filterset>
+ </copy>
+
+ <copy todir="${jboss.server.config.dir}/deployers/idm-deployer" overwrite="true">
+ <fileset dir="${jbossidm.home}/modules/idm-deployer" />
+ </copy>
+
<!-- copy the sql scripts -->
<copy todir="${jboss.server.config.dir}/deploy/idm/idm-service.sar/idm-sql">
<fileset dir="${jbossidm.home}/db/schema.scripts">
<include name="*.sql"/>
</fileset>
- </copy>
+ </copy>
- <!-- copy the right jboss-bean deployment file -->
- <copy file="${jbossidm.home}/jboss/config.jboss5/deploy/idm-service/idm-service-${database}-jboss-beans.xml"
- tofile="${jboss.server.config.dir}/deploy/idm/idm-service.sar/META-INF/idm-service-jboss-beans.xml"
- overwrite="true" />
-
<!-- copy the right hibernate configuration file -->
<copy file="${jbossidm.home}/jboss/hibernate.cfg/${database}.hibernate.cfg.xml"
tofile="${jboss.server.config.dir}/deploy/idm/idm-service.sar/jboss.idm.hibernate.cfg.xml"
@@ -88,6 +101,17 @@
<copy file="${jbossidm.home}/lib/postgresql.jar"
todir="${jboss.server.config.dir}/deploy/idm/idm-service.sar" />
</target>
+
+ <!--### THE SYBASE SPECIFIC PART ######################################## -->
+ <target name="internal.install.jbossidm.into.jboss.db.sybase">
+ <copy file="${jbossidm.home}/lib/jtds.jar"
+ todir="${jboss.server.config.dir}/deploy/idm/idm-service.sar" />
+ </target>
+ <!--### THE MSSQL SPECIFIC PART ######################################## -->
+ <target name="internal.install.jbossidm.into.jboss.db.mssql">
+ <copy file="${jbossidm.home}/lib/jtds.jar"
+ todir="${jboss.server.config.dir}/deploy/idm/idm-service.sar" />
+ </target>
</project>
Added: idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-mssql-jboss-beans.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-mssql-jboss-beans.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-mssql-jboss-beans.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ IDM Service
+ -->
+ <bean name="jboss.identity.IDMService"
+ class="org.jboss.identity.idm.integration.jboss5.IDMService">
+ <constructor>
+ <parameter>jboss.idm.cfg.xml</parameter>
+ <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+ </constructor>
+ <property name="idmSessionFactoryJNDI">java:/IdentitySessionFactory</property>
+ <property name="SQLScript">idm-sql/jboss.idm.mssql.create.sql</property>
+ <property name="datasource">java:jbossidmDS</property>
+ <property name="exitSQL">select * from jbid_io</property>
+ <depends>jboss.jca:service=DataSourceBinding,name=jbossidmDS</depends>
+ </bean>
+
+</deployment>
\ No newline at end of file
Added: idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-postgresql-jboss-beans.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-postgresql-jboss-beans.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-postgresql-jboss-beans.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ IDM Service
+ -->
+ <bean name="jboss.identity.IDMService"
+ class="org.jboss.identity.idm.integration.jboss5.IDMService">
+ <constructor>
+ <parameter>jboss.idm.cfg.xml</parameter>
+ <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+ </constructor>
+ <property name="idmSessionFactoryJNDI">java:/IdentitySessionFactory</property>
+ <property name="SQLScript">idm-sql/jboss.idm.postgresql.create.sql</property>
+ <property name="datasource">java:jbossidmDS</property>
+ <property name="exitSQL">select * from jbid_io</property>
+ <depends>jboss.jca:service=DataSourceBinding,name=jbossidmDS</depends>
+ </bean>
+
+</deployment>
\ No newline at end of file
Added: idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-sybase-jboss-beans.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-sybase-jboss-beans.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/jboss/config.jboss5/deploy/idm-service/idm-service-sybase-jboss-beans.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ IDM Service
+ -->
+ <bean name="jboss.identity.IDMService"
+ class="org.jboss.identity.idm.integration.jboss5.IDMService">
+ <constructor>
+ <parameter>jboss.idm.cfg.xml</parameter>
+ <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+ </constructor>
+ <property name="idmSessionFactoryJNDI">java:/IdentitySessionFactory</property>
+ <property name="SQLScript">idm-sql/jboss.idm.sybase.create.sql</property>
+ <property name="datasource">java:jbossidmDS</property>
+ <property name="exitSQL">select * from jbid_io</property>
+ <depends>jboss.jca:service=DataSourceBinding,name=jbossidmDS</depends>
+ </bean>
+
+</deployment>
\ No newline at end of file
Added: idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-mssql-ds.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-mssql-ds.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-mssql-ds.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>jbossidmDS</jndi-name>
+ <connection-url>@jdbc.url@</connection-url>
+ <driver-class>@jdbc.driver@</driver-class>
+ <user-name>@jdbc.username@</user-name>
+ <password>@jdbc.password@</password>
+
+ <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+ <metadata>
+ <type-mapping>MS SQLSERVER2000</type-mapping>
+ </metadata>
+ </local-tx-datasource>
+
+</datasources>
Modified: idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-sybase-ds.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-sybase-ds.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/assembly/src/main/files/jboss/datasources/jbidm-sybase-ds.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -1,27 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
-
- <xa-datasource>
+ <local-tx-datasource>
<jndi-name>jbossidmDS</jndi-name>
-
- <xa-datasource-class>@jdbc.sybase.datasource@</xa-datasource-class>
- <xa-datasource-property name="URL">@jdbc.url@</xa-datasource-property>
+ <connection-url>@jdbc.url@</connection-url>
+ <driver-class>@jdbc.driver@</driver-class>
<user-name>@jdbc.username@</user-name>
<password>@jdbc.password@</password>
+ <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
+ <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+ <metadata>
+ <type-mapping>Sybase</type-mapping>
+ </metadata>
+ </local-tx-datasource>
- <!-- disable transaction interleaving -->
- <track-connection-by-tx />
-
- <exception-sorter-class-name>
- org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter
- </exception-sorter-class-name>
-
- <!-- corresponding type-mapping in conf/standardjbosscmp-jdbc.xml -->
- <metadata>
- <type-mapping>Sybase</type-mapping>
- </metadata>
- </xa-datasource>
-
</datasources>
+
Added: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml
===================================================================
--- idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml (rev 0)
+++ idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -0,0 +1,64 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">false</property>
+
+ <property name="current_session_context_class">thread</property>
+ <!-- ask hibernate to do the schema population -->
+ <!-- property name="hibernate.hbm2ddl.auto">create-drop</property-->
+
+ <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
+ <property name="hibernate.connection.datasource">java:jbossidmDS</property>
+ <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+ <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property name="jta.UserTransaction">UserTransaction</property>
+
+ <!-- Mapping classes -->
+ <!-- all nessesary mappings are added programatically to the configuration in the store-->
+ <!-- this is for manual SF creation-->
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>
+ <mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>
+
+
+ </session-factory>
+</hibernate-configuration>
+
Modified: idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java
===================================================================
--- idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java 2009-06-01 06:22:01 UTC (rev 549)
@@ -70,7 +70,7 @@
public void testInjectSessionFactory() throws Exception
{
IdentityConfiguration identityConfiguration = new IdentityConfigurationImpl().
- configure(new File("src/test/resources/example-db-config.xml"));
+ configure(new File("src/test/resources/example-db-inject-sf-config.xml"));
SessionFactory hibernateSessionFactory = new AnnotationConfiguration().configure("hibernate-jboss-identity-classes.cfg.xml")
.buildSessionFactory();
@@ -164,8 +164,10 @@
identitySession.getTransaction().commit();
identitySession.close();
+
+
+ System.out.println("Done");
-
}
}
Modified: idm/trunk/idm-cache/pom.xml
===================================================================
--- idm/trunk/idm-cache/pom.xml 2009-06-01 05:56:51 UTC (rev 548)
+++ idm/trunk/idm-cache/pom.xml 2009-06-01 06:22:01 UTC (rev 549)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>idm-cache</artifactId>
<packaging>jar</packaging>
- <name>JBoss Identity IDM Cachen</name>
+ <name>JBoss Identity IDM Cache</name>
<url>http://labs.jboss.org/portal/jbosssecurity/</url>
<description>JBoss Identity IDM Cache</description>
<licenses>
17 years, 1 month
JBoss Identity SVN: r548 - in idm/trunk/integration: deployer/src/main/java/org/jboss/identity/idm/integration/jboss5 and 2 other directories.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-01 01:56:51 -0400 (Mon, 01 Jun 2009)
New Revision: 548
Modified:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java
idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml
idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml
idm/trunk/integration/pom.xml
Log:
* Update deployer.
Modified: idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java
===================================================================
--- idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java 2009-05-31 23:25:59 UTC (rev 547)
+++ idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java 2009-06-01 05:56:51 UTC (rev 548)
@@ -7,6 +7,8 @@
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.InitialContext;
@@ -177,23 +179,30 @@
}
- private void checkTargetDB(String datasource) throws Exception{
- DataSource ds = (DataSource)new InitialContext().lookup(datasource);
+ private void checkTargetDB(String datasource) {
+
Connection conn = null;
Dialect dialectName = null;
try
{
+ DataSource ds = (DataSource)new InitialContext().lookup(datasource);
conn = ds.getConnection();
DatabaseMetaData meta = conn.getMetaData();
String databaseName = meta.getDatabaseProductName();
int databaseMajorVersion = getDatabaseMajorVersion(meta);
dialectName = DialectFactory.determineDialect(databaseName, databaseMajorVersion);
logger.fine("Detected dialect " + dialectName + ", database is (" + databaseName + "," + databaseMajorVersion + ")");
+ } catch (Exception e) {
+ logger.warning(e.getMessage());
}
finally
{
if (conn != null) {
- conn.close();
+ try {
+ conn.close();
+ } catch (SQLException e) {
+ logger.log(Level.SEVERE, "error in closing the connection", e);
+ }
}
}
}
Modified: idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml 2009-05-31 23:25:59 UTC (rev 547)
+++ idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml 2009-06-01 05:56:51 UTC (rev 548)
@@ -8,4 +8,11 @@
<hibernateConfiguration>jboss.idm.hibernate.cfg.xml</hibernateConfiguration>
<hibernateSessionFactoryJNDIName>java:/IDMHibernateSessionFactory</hibernateSessionFactoryJNDIName>
</hibernateDeployer>
+ <initializers>
+ <datasource>java:/jbossidmDS</datasource>
+ <sqlInitializer>
+ <sqlFile>idm-sql/jboss.idm.@database@.create.sql</sqlFile>
+ <exitSQL>select * from jbid_io</exitSQL>
+ </sqlInitializer>
+ </initializers>
</jboss-idm-deployer>
Modified: idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml 2009-05-31 23:25:59 UTC (rev 547)
+++ idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml 2009-06-01 05:56:51 UTC (rev 548)
@@ -86,6 +86,26 @@
<attributes/>
<options/>
</identity-object-type>
+ <identity-object-type>
+ <name>unit</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>unit</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
</supported-identity-object-types>
<options>
<option>
Modified: idm/trunk/integration/pom.xml
===================================================================
--- idm/trunk/integration/pom.xml 2009-05-31 23:25:59 UTC (rev 547)
+++ idm/trunk/integration/pom.xml 2009-06-01 05:56:51 UTC (rev 548)
@@ -19,6 +19,7 @@
<modules>
<module>jboss5</module>
+ <module>deployer</module>
</modules>
<!-- Plugins -->
17 years, 1 month