Thursday, August 28, 2008

I was trying to install Documentum 6.0 SP1 default Web-Publisher as a J2EE application on Apache Tomcat 5.X.

The problem is that by default, Apache Tomcat 5.x implements and enables JSP Tag Pooling. And Documentum 6.0 SP1 web Pulisher doesn't support tag pooling.

I did the following steps to install Web Publisher (WP) on Apache Tomcat 5.0
BTW, you can get Tomcat's most versions (even not listed on downloads page) from the URL:
http://archive.apache.org/dist/tomcat/

I installed 5.0.28 version from the URL:
http://archive.apache.org/dist/tomcat/tomcat-5/v5.0.28/bin/

I have my WP packaged as a WAR file (wp.war) and I just dumped it in the webapps directory, and restarted the server. Since the war file is quite big (~200 MB), uncompressing it takes good 10-15 mins on my system. After you stop seeing the hard-disk icon flashing, you need to navigate to http://localhost:8080/manager/html and make sure that wp appears as an application and it is started (if not, start it manually).

When you navigate to http://localhost:8080/wp/ you see an error page:

com.documentum.web.form.control.TagPoolingEnabledException: JSP tag pooling is not supported. Please refer to the product deployment guide for instructions on turning off tag pooling for the application server.

So how to disable JSP tag-pooling? The tomcat Wiki mentions how to do that, but for a beginner, things may not be so clear, so I took the pain of writing this post.

It worked for me after editing the file: $TOMCAT-HOME/conf/web.xml,
going to two servlet declarations: default and jsp
---------------------------------------------------------------------------------------
The file is uploaded here for convenience:
http://kundan.burnwal.googlepages.com/web.xml
---------------------------------------------------------------------------------------

The portion in red shows what extra has been added and where! That should be enough.
Now, to be on the safer side, go to $TOMCAT-HOME/work/Catalina/localhost and delete the folder: "wp" and "_" and Re-start the server. Clear the browser cache (Ctrl+R should do in Firefox) and navigate to http://localhost:8080/wp/ and hurray! things should work for you!

At least it works for me!!!!

Feel free to get back to me in case you have any problems doing this!

Friday, May 30, 2008

Using BSNL DataOne Type-2/4 Modem with Airtel Broadband

I had a tough time configuring my BSNL provided type-2 Modem with Wi-Fi, to use it with Airtel Broadband. So I'm posting it here, so that others don't have to go through the pain.

All these settings should work with Model No. WA3002G4, Dataone Modem, manufactured by UTStarcom.

The key is in setting the WAN setting correctly.

VPI/VCI Con. ID Category Service Interface Protocol Igmp QoS State Remove Edit
1/32 1 UBR Airtel ppp_1_32_1 PPPoE Disabled Disabled Enabled

The summary of this section is as below:

WAN Setup - Summary

Make sure that the settings below match the settings provided by your ISP.

VPI / VCI: 1 / 32
Connection Type: PPPoE
Service Name: Airtel
Service Category: UBR
IP Address: Automatically Assigned
Service State: Enabled
NAT: Enabled
Firewall: Enabled
IGMP Multicast: Disabled
Quality Of Service: Disabled

Make sure your username and password are correctly specified correctly.

The ADSL State:

Device Info

BoardID: 96338W
Software Version: 1132_061507-3.08L.BSNL_02.
BoardID: 96338W
Software Version: 1132_061507-3.08L.BSNL_02.
Bootloader (CFE) Version: 1.0.37-8.7
Firmware Version: WA3002G4-0021.01
Hardware Version: WA3002G4 1.0
Model Name: WA3002G4
Wireless Driver Version: 3.131.35.6.cpe2.0a.s
Wireless Driver Version: 3.131.35.6.cpe2.0a.s

This information reflects the current status of your DSL connection.

Line Rate - Upstream (Kbps):1024
Line Rate - Downstream (Kbps):2560
Line Rate - Upstream (Kbps): 1024
Line Rate - Downstream (Kbps): 2560
LAN IP Address: 192.168.1.127
MAC Address: 00-1b-57-fc-ff-03
Default Gateway: 122.167.64.1 122.167.64.1
Primary DNS Server: 125.22.47.125
Secondary DNS Server: 202.56.250.5

I'm attaching the conf file, which you can directly use, if you're using the same modem model no. and Modem. Use this at your own risk. Settings File in XML Like Format

This will set the password of Username: admin as admin. and the IP Address of Modem to be: 192.168.1.127

You need to change the Username & Password in PPP section, as well as change the Wireless SSID and WEP Password

SQL Server Merge Replication

I had run into tonnes of problems installing & configuring Merge Replication mention between MS SQL Server and SQL Server Mobile, but finally got everything working. So thought of writing this article which would help many of the newbies trying to do this. If you're not a newbie, this is probably not the right place for you!

Thanks to Phil for all the help!

Please note that this article is only a supplement to the following article:

http://msdn2.microsoft.com/en-us/library/ms171908.aspx

First of all, Merge Replication is about two-way synchronization between data (tables. Does it synchronize anything else?) across two SQL Servers. I'm going to mention the synchronization in SQL Server on Desktop and SQL server Mobile or SQL Server CE (as Microsoft calls the newer versions of it). I've done it only using SQL Server Management Studio, plus also tested it on real Windows Mobile Device (WM6, HTC Touch) with .Net Compact Framework 2.0 installed, using C# code for initiating Synchronization from device, though in this article, the process is described only using SQL Server Management Studio.

What do you need?

  1. SQL Server Standard Edition or higher: Please note, that you should either install MS-SQL Server Standard Edition or Developer Edition. You cannot create a publication using SQL Server Express Edition. Although I guess it can act as a subscriber (I'm not very sure). Enterprise Edition definitely supports all of these, plus publication using Oracle Database as well, being a super-set of other editions, but be careful! The Enterprise Edition cannot be installed on Windows XP Professional SP2. It needs Windows Server 2003 SP1 as the minimum OS. On the other hand, Microsoft does allow the Evaluation Version of the Enterprise Edition to be installed on Windows XP SP2. For more details, refer to the Installation requirements of SQL Server Enterprise Edition. It mentions that the Enterprise Edition doesn't support all the platforms which the Evaluation Edition Supports! (I spent nearly a day figuring that out why was the Enterprise Edition not installing on my Laptop running Windows XP Pro SP2!). I've personally tested it on both Standard Edition as well as Evaluation Edition (Enterprise)
Microsoft recently released SP1 for SQL Server 2005 (possibly all editions). I've not installed that and instead used the default one available on the web-link given in "Installing MS-SQL Servet" section below.

  1. IIS: that's easy.. to be done from Add Remove Windows Components from appwiz.cpl (Add Remove Programs in Control Panel)
  2. SQL Server Mobile or SQL Server CE with corresponding version of Server Tools. E.g. if you have installed SQL Server CE 3.5, then you must also have installed SQL Server CE Server Tools 3.5. Please note that the names are not accurate. For me it worked for SQL Server CE 3.5 & corresponding Server Tools
  3. Windows XP Pro SP2 with administrative log-on access

Installing MS SQL Server

If you're a newbie, consider downloading the evaluation version from Microsoft Technet or MSDN. I did it from Technet, without understanding the real difference :)

http://www.microsoft.com/sql/downloads/trial-software.mspx

You can try downloading the Self-Extracting Executable and run it. It asks for location to Extract the files. For this article, lets assume you extracted it to c:\SQLEVAL\

You need to launch c:\SQLEVAL\Servers\default.hta and click on the Install: Database, SDK etc link. It should launch the set up.

Warning: If you already have any other version of SQL Server Installed, you must do this way:

Open command prompt. Change directory to C:\SQLEVAL\Servers\ and then run

C:\SQLEVAL\Server> setup.exe SKUUPGRADE=1

Also, if you already have SQL Server Express Management Studio with very limited capabilities, that might interfere with MSSQL Server Management Studio which is a part of the Installation Tools package. If you cannot access the full management studio, I would suggest to try and remove the workstation components or SQLEXPRESS completely before installing this.

For only replication usage, the following components need to be installed: Database Engine, Integration Services & Workstation Components. You need not install Analysis and Reporting Services.

While installing, make sure that all three Services run automatically. Also, when it asks which account to use for running the following: (1) MSSQLSERVER (2) SQL Agent (3) Integration Services etc, all the services should be run by the user: LocalSystem (builtin account). At least for me, it mattered! It can be done later as well Strictly from SQL Server Configuration Manager. Please don't change the logon account for these services from Microsoft Services (services.msc), else you'll run into problems. Microsoft has already mentioned this in its knowledge base which I came across whileI ran into this problem :)

If you're running the above services as any other account, go to Programs -> SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager -> SQL Server 2005 Services. On the right pane, whatever services you see, all of them should be using LocalService account. I'm not sure of the reason. Make sure that each of the services are restarted to reflect the change in logon account.

For authentication options, I checked to use Windows authentication during installation, and not SQL Server Authentication.


There isn't much where you might go wrong in installing IIS or SQL Server Mobile or its tools, so I'm skipping that portion.

Replication Configuration
After you've installed everything,just launch SQL Server Management Studio from Programs -> SQL Server 2005 -> SQL Server Management Studio

Depending upon what services are installed, it may give lots of server options. Depending upon what it shows, you may either choose Database Engine or name of the MSSQLServer, which you might have specified during installation. I guess it is usually the same as the network name of the machine on which you've installed it. In this I'm assuming my machine name to be KUNDAN-LAPTOP, and so is the name of the database server.

Make sure you create a snapshot share (\\KUNDAN-LAPTOP\snapshot), create two user-accounts: snapshot_agent and IUSR_Machine-Name(IUSR_KUNDAN-LAPTOP) with appropriate permissions as in the main article:

http://msdn2.microsoft.com/en-us/library/ms171908.aspx

Create a new database, say ReplTestDB with say one table named tblIDName with two fields: ID & name. Pump in some data in the table(say 3 rows for now). Right Click on this database-> Properties->Permissions->The two users: snapshot_agent and IUSR_Machine-Name should have access to the following role: Connect & Connect Replication. I’m not sure if it would be really required for IUSR account to have connect replication role, but for the snapshot_agent account, it definitely makes sense!

In the object explorer -> Security -> Logins -. right click to create two logins one after the other snapshot_agent & IUSR_Machine-Name and for each login, select the database: ReplTestDB, and give db_owner and public role.

Then go ahead and create a publication as mentioned in the main article above. Let us name the Publication: ReplTestPub. You should right-click on the publication and go to properties->publication access list->Click on Add. You should be able to see two accounts to add: snapshot_agent & IUSR_Machine-Name. Select both and add.

Now, its the time to run snapshot_agent. Right click on the publication -> view snapshot status -> start. You shouldn't be seeing any error (hopefully!). If you see, then refer to Object Explorer->SQL Server Agent->Error Logs->Current.

If you see errors after running the snapshot agent, the best deal would be to Add "snapshot_agent" account to "administrators" group. I don't know why this should do the trick, but it worked for me on two different machines, even though the "snapshot_agent" account was added to "publication access list" in the properties of the publication

If it worked fine up to here for you, then chances are it won't give any problem from here onwards.


Now go ahead and configure web-synchronization wizard as mentioned in the main article.

Next, create an SQL Mobile Subscription by creating an SQL mobile Database, and configuring the subscription as mentioned in the main article. After doing this, you can just right click on the subscription -> Synchronize now. I should work! (hopefully). The result should be that the table should be created with the same row values as the table in the Server Database

To verify it indeed works, you can open a new query window and execute an insert query in the SQL Mobile Database, and then synchronize the publication again as above. Now you should be able to see the new rows just inserted in the table in the SQL Server Database! This would prove that synchronization worked in the direction from Mobile to Server.

To verify the synchronization from Server to Mobile, add a row in that table in the server database, run the snapshot agent again (by right clicking on the publication -> view snapshot status -> start), and then right click on the subscription in SQL Mobile Database -> Synchronize. Then in the Query, you can do a Select * from table-name query to see that the new rows are updated in the SQL Mobile database as well!


Well! thats about it!!

Troubleshooting

The overall process of Setting up replication is at least cumbersome. There are a couple of things that can go wrong. Some of these are as follows:

  • Your installation of SQL Server 2005 may not be right. Please note that the free version of SQL Server (which is SQL server 2005 Express Edition) does not support publication. It can only be a subscriber which can synchronize with a SQL Server Standard/Developer/Enterprise Edition Publication, but you cannot create a publication in SQL Server Express for a SQL Server CE/Mobile or any other to subscriber to synchronize with it! So be ready to either shell off few 100 odd bucks, or better, for trail purposes, use the 90-days fully functional evaluation version.
  • If the Server is indeed running, and installed correctly, you should be able to see the following in the SQL Server Configuration Manager (Programs-> SQL Server 2005->Configuration Tools->SQL Server Configuration manager): MSSQLSERVER, SQL Server Agent, SQL Server Integration Services. Make sure all of these services are running as the user: Local Service. If not, please change the logon account associated with these process one after the other. If you want to completely play safe, you may want to restart your computer and make sure these process are running before you even attempt to try replication.
  • After you create a snapshot share on your computer, make sure the user: snapshot_agent and the user: IUSR_Machine-Name are able to browse the network-share \\machine-name\snapshot_share. Usually, that would mean that even if the snapshot is a local share, you must be connected on the workgroup-network/domain. So if you're in a company, make sure you're at least able to connect other workgroup/domain computers.
  • After you create the database which you want to publish, make sure you add the users: snapshot_agent and IUSR_Machine-Name to the logins in SQL Server Management Studio
  • After you create the publication, make sure you add these two users to Publication Access List (in Publication Properties), give these users the dbowner permission, and permission to "connect" and "connect and replicate"
  • For starting the snapshot_agent, don't get disappointed by the initial error message, if any, by right-clicking on the publication->view snapshot-agent status. The chances are all high that initially the Publication access list is not setup correctly. After you do this rihgt, then click on "Start" and then it should work fine.