Wednesday, June 30, 2010

SqlJdbcDriver 3.0 + ERDAS APOLLO 2010.1 + SQL Server 2008

By default, ERDAS Apollo 2010.1 uses SqlJdbcDriver 2.0, where the jar files are:
1 .../jboss/server/default/lib/jdbc-driver-2.0.jar and sqljdbc.jar
2 .../erdas-apollo.ear/lib/jdbc-driver-2.0.jar

Hence if the new sqljdbc_xa.dll is installed in the SQLServer Binn directory, it should be backward compatible with the jdbc-driver-2.0.jar

The .../erdas-apollo.ear/lib/jdbc-driver-2.0.jar is required for the DataManager application to function.

To upgrade Apollo2010.1 to use SqlJdbcDriver3.0, some manual copy and paste have to be done.
1. Download the SqlJdbcDriver 2.0 from microsoft website http://www.microsoft.com/downloads/details.aspx?FamilyID=%20a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en

2. Shutdown jboss.

3. Extract the files and copy sqljdbc.jar into
- .../jboss/server/default/lib/ (overwrite the existing one, if any)
- and .../erdas-apollo.ear/lib/

4. Delete the existing
- .../jboss/server/default/lib/jdbc-driver-2.0.jar and
- .../erdas-apollo.ear/lib/jdbc-driver-2.0.jar

5. Start Jboss.

6. Verify users can login from Datamanager and erdas-apollo can connect to the database by looking at the jboss server.log

Tuesday, June 29, 2010

ERDAS Apollo 2010 + SQL Server 2008 Express

- Download SQL Server 2008 Express from http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=58ce885d-508b-45c8-9fd3-118edd8e6fff and then install it.

- Enable tcp/ip port (I use port 1433) in "SQL Server Configuration Manager" -> "SQL Server Network Configuration" -> Protocols for SQLEXPRESS => TCP/IP : {enabled, Right-Click/Properties: TCP Port: 1433}.
Test with: "telnet localhost 1433" or change localhost to server's ip address

- Create database for apollo

create database apollo on
(name = apollo_dat, FILENAME = 'E:\work\apollo.mdf', size = 200MB, FILEGROW
TH=5)
LOG ON (name='apollo_log', FILENAME = 'E:\work\apollo_log.ldf', size=200MB, FILEGROWTH=5)
GO

- Supply the params to APOLLO installer.

- If you get

javax.transaction.xa.XAException, refer to my previous post:

http://lydonchandra.blogspot.com/2010/06/javaxtransactionxaxaexception.html

@@

javax.transaction.xa.XAException

Issue:

javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to create the XA control connection. Error: "Could not find stored procedure 'master..xp_sqljdbc_xa_init_ex'."

Resolution:

1. Ensure Microsoft Distributed Transaction Coordinator is installed and running on every SQL Server machine that will participate in distributed transactions.

a. From Control Panel, open Administrative Tools, and then open Component Services. You can also click the Start button, click Run, type dcomcnfg in the Open box, and then press OK to open Component Services.

b. Expand Component Services, Computers and right-click My Computer, and then select Properties.

c. Click the MSDTC tab, and then click Security Configuration.

d. Select the Enable XA Transactions check box, and then click OK. This will cause a MS DTC service restart.

e. Click OK again to close the Properties dialog box, and then close Component Services.

f. Stop and then restart SQL Server to ensure that it syncs up with the MS DTC changes

2. Install the Microsoft SQL Server JDBC driver 2.0 from the url in the reference section.

3. Copy the sqljdbc_xa.dll from this directory to the Binn directory of every SQL Server machine that will participate in distributed transactions.

4. Execute the database script xa_install.sql on every SQL Server machine that will participate in distributed transactions.


5. Check that apollo db user has execute permission to the "master" database because xa_install.sql installs procedures in the master database.


Reference:

http://msdn.microsoft.com/en-us/library/aa342335.aspx
http://www.microsoft.com/downloads/details.aspx?FamilyID=99B21B65-E98F-4A61-B811-19912601FDC9&displaylang=en

Tuesday, June 8, 2010

Erdas Apollo 2010 Change server name

Recently I changed the computer name that hosts Erdas Apollo 2010, and services stop working.
So I basically did
1. search and replace on the *.xml, *.fac, *.txt that refer to old-computer-name and replace them with new-computer-name
2. search and replace on apollo-client.war
Because this is effectively a zip file, I had to unzip it, did search and replace, zip it again, and place it in \APOLLO2010\jboss\server\default\deploy directory

Monday, June 7, 2010

FAZ position

Entry price: ~15.50 to $16.00 (Currently quite far from MA)
Target1: $20
Target2: $25
Stop: $13.98
Reward2RiskRatio: 4/2

US Stockmarket 1 year view

My uneducated guess for SPY in a year time (Jun 2011)
- It will be sitting ard $85 to $95, which is just the trading range in April-June 2009 before it broke out of resistance.
- It is a bearish view because:
- The governments around the world are running out of stimulus money
- Austerity programs in Europe will take place
- BRIC (Brazil, Russia, India, and China) are tightening their economy to control inflation (especially property prices in China)
- Very high level of debt among developed countries ( as detailed in http://www.debtdeflation.com/blogs/)
- refer to Nouriel Roubini http://www.youtube.com/watch?v=f7RjqfdRQDQ

Sunday, June 6, 2010

Erjang on OSX 10.6.x

A few obstacles I was having when trying to setup Erjang on OSX 10.6.x
1. Perl version
Erjang requires perl 5.10.0, and the default perl on the system is 5.8.x.
Perl 5.10.x is installed on the system however, so all I have to do is to modify build.xml,
replacing executable="perl" with executable="perl5.10.0"
2. Erlang environment vars
To make it easy, I add a soft link /sw that points to /opt/local

Then I can just do
./erl.sh -pa ./src/main/erl -noshell -s ring main