Changed the database from HypersonicSQL to PostgreSQL(=DefaultDS) as follows.

=== Environment:
- Linux(Red Hat Professional Workstation, Kernel 2.4.21)
- J2SE 1.4.2_04
- Eclipse 2.1.2
- JBoss 3.2.1_Tomcat 4.1.24
- Lomboz 2.1.3
- PostgreSQL 7.4.2
- Axis 1.1

= Step 1: Download and install PostgreSQL(see ?INSTALL? in 
?postgresql-7.4.2.tar.gz? etc. for details)
  | - The directory is ?/usr/local/pgsql?.
  | - Compile PostgreSQL with ?--with-java? option in ?configure? command to 
produce the JDBC file ?postgresql.jar?.
  | - Add a user name ?postgres? with no password.
  | - Set up classpath.
  | 
  | = Step 2: Make a database in PostgreSQL
  | - Initialize PostgreSQL and create a new database named ?MyStoreDbPgSQL? 
for the tutorial.
  | - Make the tables and the data using ?myStoreSchema.script? and 
myStoreSchema.data?(+?myStoreSchemaDrop.script).
  |   e.g.
  |     a. Change the user in a console, i.e. ?su? then ?su postgres?. Start 
PostgreSQL with ?pg_ctl -w start?.
  |     b. Open a session with ?psql MyStoreDbPgSQL?.
  |     c. Copy and paste each SQL code in *.script and *.data files 
above.(add?;?to each SQL code)
  |     d. Keep ?PostgreSQL? running.
  | 
  | = Step 3: Add a directory as a new server option
  | - Copy the complete directory of ?all? under ?/JBoss-3.2.1/server? and name 
it ?postgres?.
  |     /JBoss-3.2.1/server
  |                         |- /all
  |                         |- /default
  |                         |- /minimal
  |                         |- /postgres
  | 
  | - Keep the directories ?all?, ?default? & ?minimal? un-touched.
  | - Delete all sub-directories and files under ?/server/postgres/log? and 
?/temp?.
  |   (adjust access mode if any troubles during start-up of JBoss (Step 12))
  | 
  | = Step 4: Install JDBC driver for PostgreSQL
  | - Delete ?hsqldb.jar? and ?hsqldb-plugin.jar? in ?/server/postgres/lib?.
  | - Copy ?postgrsql.jar? from ?/usr/local/pgsql/share/java? to 
?/server/postgres/lib?.
  | 
  | = Step 5: Copy and modify the Server Definition File for Lomboz
  | - Make a copy of ?jboss321all.server? in 
?/opt/eclipse/plugins/com.objectlearn.jdt.j2ee/servers? as 
?jboss321allpgsql.server?.
  | - Add ?.bak? to all ?*.server? files in the directory except for 
?jboss321allpgsql.server?.
  | - In ?jboss321allpgsql.server?,
  |   a. change name=?JBOSS 3.2.1 ALL? in <serverDefinition> to name=?JBOSS 
3.2.1 ALL PGSQL?
  |   b. change <startProgramArguments>-c all</startProgramArguments> to 
<startProgramArguments>-c postgres</startProgramArguments>
  |   c. change all of ?.../server/all/...? to ?.../server/postgres/...?
  |   d. delete following two lines in <serverClassPath>
  |          <jar 
type=?variable?>${classPathVariableName}/server/postgres/lib/hsqldb.jar</jar>
  |          <jar 
type=?variable?>${classPathVariableName}/server/postgres/lib/hsqldb-plugin.jar</jar>
  |      and add
  |          <jar 
type=?variable?>${classPathVariableName}/server/postgres/lib/postgresql.jar</jar>
  | 
  | = Step 6: Prepare the Service Description File
  | - Delete ?/server/postgres/deploy/hsqldb-ds.xml? or add ?.bak? to disable.
  | - Copy ?postgres-ds.xml? in ?/jboss-3.2.1/docs/examples/jca? to 
?/server/postgres/deploy?
  | - In ?postgres-ds.xml?, the contents of <local-tx-datasource> are as 
follows;
  |      <jndi-name>DefaultDS</jndi-name>
  |      
<connection-url>jdbc:postgresql://localhost/MyStoreDbPgSQL</connection-url>
  |      <driver-class>org.postgresql.Driver</driver-class>
  |      <username>postgres</username>
  |      <password></password>
  | 
  | = Step 7: Modify the Login Config File
  | - In ?/server/postgres/conf/login-config.xml?, the <application-policy> is 
as follows;
  |      <application-policy name = ?PostgresDbRealm?>
  |        <authentication>
  |           <login-module code = 
?org.jboss.resource.security.ConfiguredIdentityLoginModule?
  |              flag = ?required?>
  |              <module-option name = ?principal?></module-option>
  |              <module-option name = ?userName?>postgres</module-option>
  |              <module-option name = ?password?></module-option>
  |              <module-option name = 
?managedConnectionFactoryName?>jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
  |           </login-module>
  |        </authentication>
  |      </application-policy>
  | 
  | = Step 8: Modify ?standardjaws.xml?
  | - In ?/server/postgres/conf/standardjaws.xml?, the top parts of <jaws> are 
as follows;
  |      <jaws>
  |         <datasource>java:/DefaultDS</datasource>
  |         <type-mapping>PostgreSQL</type-mapping>
  |         <debag>false</debug>
  |         <default-entity>
  |          :
  | 
  | = Step 9: Modify ?standardjbosscmp-jdbc.xml?
  | - In ?/server/postgres/conf/standardjbosscmp-jdbc.xml?, the top parts are 
as follows;
  |      <jbosscmp-jdbc>
  |       <defaults>
  |         <datasource>java:/DefaultDS</datasource>
  |         <datasource-mapping>PostgreSQL</datasource-mapping>
  |         <create-table>true</create-table>
  |          :
  | 
  | = Step 10: Modify ?jbossmq-service.xml? (for Chapter 7 and after)
  | - In ?/server/postgres/deploy/jms/jbossmq-service.xml?, the jdbc2 
Persistence Manager is as follows;
  |          :
  |      <depends 
optional-attribute-name=?ConnectionManager?>jboss.jca:service=LocalTxCM,name=DefaultDS</depends>
  |      <attribute name=?SqlProperties?>
  |        BLOB_TYPE=BYTES_BLOB
  |        INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
  |          :
  |          :
  |        CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES (MESSAGEID INTEGER 
NOT NULL, \
  |            DESTINATION VARCHAR(150) NOT NULL, TXID INTEGER, TXOP CHAR(1), \
  |            MESSAGEBLOB BYTEA, PRIMARY KEY (MESSAGEID, DESTINATION) )
  |        CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS (TXID INTEGER)
  |        CREATE_TABLES_ON_STARTUP = true
  |     </attribute>
  |          :
  | 
  | *** Start Eclipse and build a new project as MyStorePgSQL.
  | 
  | = Step 11: Confirm ?xdoclet.xml? is with PostgreSQL
  | - In ?/MyStorePgSQL/MyStoreMgr/META-INF/xdoclet.xml?, the JBoss part is as 
follows;
  |      <jboss
  |         :
  |        datasource=?java:/DefaultDS?
  |        datasourcemapping=?PostgreSQL?
  |        preferredrelationmapping=?foreign-key?
  |      />
  |         :
  | = Step 12: Start JBoss from ?Lomboz J2EE View?
  | - If any failure/error messages such as ?XAConnectionFactory not bound? 
appear during start-up process,
  |   stop JBoss (keep PostgreSQL running) and check the tables in the database.
  |   a. $ psql MyStoreDbPgSQL
  |   b. =# \dt
  |   - if the tables ?jms_messages? and ?jms_transactions? exist, drop both of 
them.
  |   c. =# DROP TABLE jms_messages;
  |   d. =# DROP TABLE jms_transactions;
  | - Re-start JBoss
jbosszone


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868920#3868920

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868920


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to