Popular Posts

Thursday, September 4, 2014

Uninstall network-manager in Ubuntu 14

To uninstall Network Manager Completely please execute following commands:
1. Check the status of network-manager first:
sudo service network-manager status
If network-manager is running then you need to stop it first. Please execute following command to stop it.
2. Stop network-manager
sudo service network-manager stop
3. Remove network-manager completely
 sudo apt-get autoremove network-manager-gnome network-manager
You can use 'remove' or 'purge' also instead of 'autoremove'  here. The benefit of 'autoremove' is it will uninstall the dependency library also.

Tuesday, December 10, 2013

Android debugging launch fails in Eclipse: Can’t bind to local 8600 for debugger

Today I have started with my first android application by following the android official documentation. While running the application I encountered an error saying "Can't bind to local 8615 for debugger".
To solve this problem, I did the below steps and it started working:

1. Went to Eclipse ->Window -> Preferences
2. Choose Android from the left Menu.
3. Select DDMS
4. Select "Use ADBHOST" and put value as  "127.0.0.1"

Hope this might be helpful for those who are also facing the same problem.

Friday, October 4, 2013

Working with Enums in Java

Definition:
Enums are special kind of datatype which we can use in application as constants. 

Where to Use:
 In java application  we have requirements where we need to keep some values that should be constant throughout the application. There we use enums to keep thos values in meaningful way.Why Enums instead of constants:In java Enums are objects. They can have variables, methods etc. like any other objects. But constants are just like some primitive values. 


package com.technobash.enums;

public enum Months {

 JANUARY(1), 
 FEBRUARY(2),
 MARCH(3),
 APRIL(4),
 MAY(5),
 JUNE(6),
 JULY(7),
 AUGUST(8),
 SEPTEMBER(9),
 OCTOBER(10),
 NOVEMBER(11),
 DECEMBER(12);

 // This is a constructor where we pass the integer value to initialize enums
 Months(int x) {
  this.x = x;
 }

 int x;

 public int getValue() {
  return this.x;
 }
}

Here are some useful links about enums:
Enum Tricks
Enum Examples
Enums Documentation





Tuesday, October 1, 2013

Problem faced while configuring Liferay with MySQL

Today, I faced an issue while I started configuring MySQL with Liferay 6.1.
In the logs I started getting following errors:
impossible to write to binary log since BINLOG_FORMAT=STATEMENT and at least one table uses a storage engine limited to row-based logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED
This issue is very common with MySQL version 5.6. because by default, BINLOG_FORMAT=STATEMENT here. I have changed it to ROW and I got rid of this error.

The command to be used :
mysql> SET GLOBAL binlog_format = 'ROW';


Now I have encountered another kind of problem. In logs it is started giving below error.

check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT.

 This error is due to mysql jdbc connector issue. We need to change the jar in {Liferay_home}/{TOMCAT_HOME}/lib/ext folder.

Steps to be followed:
1. Download latest MySQL connector jar from here. It will be an installer.
2. After installing this you will get the jar is stored under <Directory>:\Program Files (x86)\MySQL\MySQL Connector J
3. Take the jar and put that into {Liferay_home}/{TOMCAT_HOME}/lib/ext folder
4. Remove mysql.jar from this directory.
5. Rename the new jar to mysql.jar

The errors are gone.