Pages

Thursday, November 28, 2013

Issues with using Huawei Model E1550 with Mac OSX 10.9

Use the following guide, if you are having problems using Huawei HSDPA dongle in OSX 10.9 Mavericks.

Download Mobile Partner for Mac OSX using the link below: (File name: MOBILE_CONNECT.ISO)
http://huaweifirmwares.com/download/mobile-partner-for-mac-os-x/

Double click on the MOBILE_CONNECT.ISO, and installation process will start. (P.S. Mac OS X supports ISO files natively without the need for any third-party software.)

Complete the installation process. A detailed step by step guide can be found here:
http://www.modemunlock.com/huawei-mobile-partner-for-mac-download.html

Now if you plug in the USB modem and try to connect using Mobile Partner, you will get the following error and program will crash:
Connection Terminated!

To resolve that, follow the steps given below:

Open the terminal
Type the following command:
 cd /etc/ppp

Point-to-Point Protocol (PPP) is a method of connecting a computer to the Internet. Working in the data link layer of the OSI model, PPP sends the computer's TCP/IP packets to a server that puts them onto the Internet.
(Ref: http://www.webopedia.com/TERM/P/PPP.html)

you are inside the ppp folder now. type ls -l command. you should see the file named "options". Make sure the user has the required rights to edit the file. If not, use the following command to grant rights. (you need to provide admin credentials)
sudo chown options
Then edit the file using the following command:
vi options

go to 'insert' mode and type the following in that file:
+pap
-chap

+pap = Force PAP authentication (This immediately connects an incoming call to pppd, and then uses PAP (Password Authentication Protocol) to authenticate the client.)

Then click esc and save the file using :wq.

Restart the OS.

Then try again to connect using Mobile Partner.

Bluetooth file recieving failure in OSX 10.9 from other devices

To solve the issue, do the following:
System Preferences > View > Sharing > Check "Bluetooth Sharing": On

Install Maven Integration plugin (m2eclipse) for eclipse

  • Open Eclipse
  • Go to Help > Install New Software
  • Under available software, give the following URL as Work with: site
  • http://download.eclipse.org/technology/m2e/releases
  • Hit Enter

Application can't be opened because it is from an unidentified developer

Apple menu > System Preferences > Security and Privacy > General > Allow apps downloaded from > "Anywhere"

Monday, November 25, 2013

How to troubleshoot "Missing artifacts" issues in Maven

Check whether the artifacts given in the pom.xml file matches with the artifacts installed in the local repository (.m2/repositories).

I encountered this error once due to last update date appending to the artifact name as given below:

org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.jar
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.jar.sha1
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.pom
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.pom.sha1
org.apache.stanbol.enhancer.servicesapi-0.11.0-SNAPSHOT.jar
org.apache.stanbol.enhancer.servicesapi-0.11.0-SNAPSHOT.pom

Where as pom.xml expected a different set of dependancies as given below:

   
      org.apache.stanbol
      org.apache.stanbol.enhancer.servicesapi
      0.11.0-SNAPSHOT
   


To resolve the issue, delete all the files in the local repository for the .jar file in question using following command.
rm /*

Then install the artifacts again using the goal clean install.
E.g, in Eclipse right click on the project > Run as > Maven build... > Goal "clean install" > Run

active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use xcode-select to change

Try the following command:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

If the above command works, do not read further :)

If you get the following error,
error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'

Copy the XCode.dmg to Applications directory and double click it. Then copy the XCode to Applications directory and try the above command again.

Friday, November 22, 2013

Error: JAVA_HOME is not set.

Following command will output the java installation directory
which java

Mine is,  /usr/bin/java (OSX 10.9)

Then set the class path using the command given below:
export JAVA_HOME=/usr/bin/java

Thursday, November 21, 2013

Install Maven in Mac OSX 10.9 (Mavericks)

OSX 10.9 (mavericks), maven is not installed by default. So, here's how to do that.

If you haven't install homebrew, install that first unsing the following command:

Install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

Then, install Maven.
brew install maven

Type the below command to verify that Maven is installed successfully.
mvn -version

Friday, November 8, 2013

Create a patch using SVN for newly added file

I submitted my first svn patch as a contributor to Apache. :) Here's how I did that.

Go to the correct directory where you have done the changes.

Add the file to the repository:
svn add {filename} 
     E.g., svn add file1.java

First check the differences:
svn diff

Create the patch file:
svn diff > {patch name}.patch
     E.g., svn diff > patchforissue01.patch

Wednesday, November 6, 2013

How to fix java.net.ConnectException: Connection refused?

A "connection refused" error happens when you attempt to open a TCP connection to an IP address / port where there is nothing currently listening for connections. Check whether the IP and the port connected is correct.

E.g., Connection to http://localhost:8765 refused

Debug Java Applications using JPDA in Eclipse

JVM tools interface defines that program being debugged should provide VM for debugging.

IDEs such as Eclipse, implement JDI (Java Debug Interface). JDI is a high level interface to define information related to remote debug requests.

-Xdebug - Enables debugging information

JDWP (Java Debug Wire protocol): format of debug information and requests (communication channel)
Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Xrunjdwp -
Loads JDWP in the target VM (communicate with debugger application)

transport -
The socket being used

server-
y - yes for target application to listen to a debugger to attach

address -
transport address for the connection

suspend -
n - no  for target VM to be suspended until debugger application connects

Remote debugging in Eclipse 

Run > Debug Configurations > Remote Java Application > Create new debug configuration and specify the port (address given above)





java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET in Apache Stanbol Integration Tests

Check for multiple versions of httpcore .jar in the class path and remove if any. If there are duplicates, it reads the one which appears first in your classpath.

- Check classpath in Eclipse: Run > Run Configurations > Classpath

- Leave only project dependencies: Select the project > Edit > Edit Runtime classpath > check "Only include exported entries" > Ok > Run

Monday, November 4, 2013

Fixing java.lang.OutOfMemoryError: PermGen space error in Apache Stanbol

If you get the above error when launching the full launcher in debug mode use the following command to overcome the issue:

java -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m  -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -jar org.apache.stanbol.launchers.full-0.10.0-SNAPSHOT.jar -p 8080

Some more info. on the Java PermGen space for those who want to go beyond fixing the issue :).

This memory slot is reserved for long term objects which are not garbage collected by default. And if there is a memory leak in PermGen space,  setting -Xmx won't help as this is not stored in general heap. Reason for OutOfMemory issue in PermGen is a memory leak in the Class loader.