# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
(C) Copyright 2009-2010 The Apache Software Foundation.
----------------------------------------------------------------------
These are instructions for building and using daytrader with JBoss 5 standard configuration:
1. Create a JMS definition file "daytrader-jboss5-destinations-service.xml", and copy to
$JBOSS_INST_HOME/server/standard/deploy/ directory. The file has the fiollowing contents:
jboss.messaging:service=ServerPeer
jboss.messaging:service=PostOffice
TradeStreamerTopic
jboss.messaging:service=ServerPeer
jboss.messaging:service=PostOffice
TradeBrokerQueue
2. Create a datasource for daytrader.
For example, If using MySQL, create a mysql database called tradedb and load it with
the derby.sql. Create a user named daytrader and grant the proper privileges as follows:
grant all on tradedb.* to daytrader identified by 'daytrader';
grant all on tradedb.* to daytrader@localhost identified by 'daytrader';
Then create a JBoss mysql datasource file "daytrader-jboss5-mysql-ds.xml" with the following contents:
jdbc/TradeDataSource
jdbc:mysql://localhost:3306/tradedb
com.mysql.jdbc.Driver
daytrader
daytrader
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
mySQL
then copy to $JBOSS_INST_HOME/server/standard/deploy/ directory.
Sample of DB2 datasource:
jdbc/TradeDataSource
false
jdbc:db2://localhost:50000/tradedb
com.ibm.db2.jcc.DB2Driver
trade
trade
select * from sysibm.tables
DB2
Sample of Oracle datasource:
jdbc/TradeDataSource
jdbc:oracle:thin:@localhost:1521:tradedb
oracle.jdbc.driver.OracleDriver
trade
trade
org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
Oracle10g
3. Rename these files manually:
# $DAYTRADER_SRC_HOME/modules/ejb3/src/main/resources/META-INF/persistence.xml
--> $DAYTRADER_SRC_HOME/modules/ejb3/src/main/resources/META-INF/persistence.xml.bak
# $DAYTRADER_SRC_HOME/modules/ear/src/main/resources/META-INF/persistence.xml.jboss5
--> $DAYTRADER_SRC_HOME/modules/ear/src/main/resources/META-INF/persistence.xml
4. Use proper datasource jndi name according to your database vendor. Modify these files:
$DAYTRADER_SRC_HOME/modules/ear/src/main/resources/META-INF/persistence.xml
$DAYTRADER_SRC_HOME/modules/ejb/src/main/resources/META-INF/jboss.xml
$DAYTRADER_SRC_HOME/modules/web/src/main/webapp/WEB-INF/jboss-web.xml
5. Modify $DAYTRADER_SRC_HOME/modules/ear/pom.xml to comment out daytrader streamer client module
Since not figure out how to make it work in jboss 5 :-/
6. Build it to ear ball:
mvn clean install
7. Finally, copy the $DAYTRADER_SRC_HOME/assemblies/javaee/daytrader-ear/target/daytrader-ear-.ear
to your $JBOSS_INST_HOME/server/standard/deploy/ directory.
Good luck!