Posts

Continuous Integration - Maven

Properties for Maven You can  reference a property value in pom.xml  using ${propertyName} notation.  The value can either be passed in command line as "mvn clean install -DpropertyName=value   or can be defined inside pom.xml  inside <properties><propertyName>value</propertyName></properties>  node. If you are using Jenkins for CI, then you can also define properties either via Global Properties -> Environment Variables or by specifying settings.xml  under "Maven Configuration". These configurations are  available under "Manage Jenkins"  menu option. How to reference dependencies from Parent project The dependencies in parent project don't automatically get included in child project. You need to at least include <groupId> and <artifactId>  in the child project's pom file <dependency> element. settings.xml  The <localRepository>  value in settings.xml is very ...

Apache Directory Studio JVM Path

I was having issue launching Apache Directory Studio. It was complaining that there was no JVM found in a given path. But I did not know where that path was set.  Finally I figured that there is "Apache Directory Studio.ini" file which had the jvm path it was looking for.

Windows

Image
  Admin privileges At times your account esp. on office laptops directly don't have admin privileges. So you can not do lots of tasks which are restricted to admins, esp the configuration settings like editing hosts file, changing proxy settings etc.. But there will be a way to launch application( notepad, browser)  as an administrator and then you can do the restricted activities.   Click Windows(Left Bottom Corner of Screen ) Icon  -> Search Programs and Files -> Type the app name and you will see one option of running the app as Administrator ( if you were assigned that  privilege ) How to find what is running at a port netstat - o -b -a   ( you will need to run command as admin , you can always run the cmd.exe as Administrator , provided you given that privilege )  WinSCP batch scripts You can write winscp script to run in non-interactive mode.  There are two good articles on this topic. http://www.robvanderwoude.com/ft...

Java

1)The runtime system guarantees that static initialization blocks are called in the order that they appear in the source code. 2) To debug Java XML Parsers set jaxp.debug system property to 1 or true. It will print lots of messages regrading which parser classes/properties JAXP is picking up etc. 3)  JTDS/SQL Server While querying a IMAGE type column, if you are expecting getObject() to return byte[], pass useLOBs=false in the JDBC url. 4) static import Use it if you want unqualified access to static member of a  type without inheriting from the type. import static  x.y.z.StaticMemeber; .... access StaticMember  here without qualifying it .... real life example of this is importing the Matchers in junit. import static org.hamcrest.CoreMatchers.is; or: import static org.hamcrest.CoreMatchers.*; and then you can call is() as if it is a function defined in same class where it is being used. 5) FTPClient I was using FTPClient to uplo...

Eclipse

Dynamic Web Project Make sure the files listed under are under webContent folder. When you publish the content to any embeded server, it only publishes content from webContent folder. So any resource under the top level project folder, but not under webContent folder will not be published to the server. If you are using web.xml web-app descriptor 2.5, then use Tomcat 6.x/ java ee 1.6 combination because Tomcat 5.x/java ee 1.5 combination may not work with it. This is what I have seen. Running Unit Tests inside Eclipse At times I have seen different results based on how you run the unit test. This may simply be the configuration issue. So If I am in the unit test class , right mouse click and do Run As =>Junit  Test, it runs fine. If I select the file from left navigation inside Package Explorer and click Run from top  "Run" menu, I see the result is different and at times tests fail.  Now If go and run the same test using maven command line, it is most stric...

NoSQL

NoSQL Data Stores MongoDB ( C++) - document database CouchDB - document database(key/value ) Cassandra - Column based , no single point of failure(Dynamo Architecture), Data modeling is based on Google Big Table. Hbase ( Java )  - Google BigTable based architecture, Column Oriented distributed database on top of HDFS ( non distributed version works on local filesystem also , but distributed is only supported on HDFS).  See  cassandra-vs-hbase  for differences between Cassandra vs. Hbase.  High availability(No single point of failure-almost 100% uptime) , high number of reads/writes and if read/write consistency is not big issue Cassandra is wins. If Read/Write consistency is important and also if you need to query(read) large amount of data and extract small amount of result out of it Hbase wins.  Cassandra includes data storage and management both while Hbase is only for data management. For most of other activities, it relies on external services l...

Git / BitBucket / SourceTree

 Reverting Commits --------------------- I am new to git but had to do some branching and merging etc. recently.   SourceTree as a git client works quite well. A few things though, at times the changes in repository don't reflect immediately in the SourceTree UI.  Let us say there is a commit from other team member, you may not see it in UI right away but when you do pull from UI, the window which pops up, does show all the changes in remote branches. There is a very good article for git starters. http://git-scm.com/book/en/v2/Git-Branching-Basc-Branching-and-Merging In source tree, you can open the command window by Actions->Open In Terminal.  It will open the Git shell for the selected project. There you can directly execute any command. I had a situation where I had to revert few commits into one branch. One of the commit was a merge from another branch also. A----AC1---C2(Merge from A)-----------AC3 B----BC1----(Merge into A)---------------...