Pages

Showing posts with label OSX 10.9 (mavericks). Show all posts
Showing posts with label OSX 10.9 (mavericks). Show all posts

Friday, May 1, 2015

Progress state: NS_ERROR_FAILURE in Vagrant

I got the following error when trying to start Vagrant instance.

There was an error while executing `VBoxManage`, a CLI used by Vagrant

for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...

Progress state: NS_ERROR_FAILURE

VBoxManage: error: Failed to create the host-only adapter

VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface

VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 68 of file VBoxManageHostonly.cpp

I could get this resolved by following action.

I have set up Vagrant cluster and there was one VM that is not running on Vagrant opened and running in VirtualBox. Issue might be due to that as well.

Restart Virtualbox using the following command:

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

Tuesday, March 10, 2015

Issues with Vi editor

  1. Create .vimrc in your home directory
  2. Insert the following content and save:
set nocompatible
set backspace=2

If you use,
sudo vi filename,  above option won't work.

Then you should use,
sudoedit filename

VBoxManage: error: Failed to create the host-only adapter VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open

After configuring some network settings as given below, I got the following error. I have mentioned how I resolved it here.

master.vm.network :private_network, ip: "33.33.33.10"
Vagrant up or Vagrant reload command

Error:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 68 of file VBoxManageHostonly.cpp

Solution:

  1. First power off all the VMs running in virtual box
  2. Then run the following command: (For Mac)
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
  1. Then start required VMs

Friday, July 25, 2014

Apache Tomcat 7 displays blank page Mac OSX 10.9

After installing Apache Tomcat 7 using the following excellent tutorial,
http://wolfpaulus.com/jounal/mac/tomcat7/, the default page in http://localhost:8080 returned a blank page.

There can be several reasons that is causing this issue, and mine got fixed when I changed the default Tomcat port from 8080 to 8081 (It can be any available port) following http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/

To check the availability of ports and verify Tomcat is running in 8081, use the following command:
netstat -anf inet

The required change to change the port (In /conf/server.xml) in given below:

  port="8181" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

Monday, April 14, 2014

How to show Sinhala characters in Mac OS X Terminal?

 
UTF-7 is the character encoding that represents Sinhala text.

    • Terminal > Preferences > Settings > Advanced 
    • International
    • Set Character encoding as Unicode (UTF-7)

    Thursday, March 13, 2014

    package java.nio.file does not exist in Mac OSX

    This is new addition in java 1.7, so if by default JDK is set as older version, this exception will be given. However, when I check java -version and it says java version "1.7.0_45".

    If you have java version specific code in your maven application add the following section in your pom.xml
               

        

       
       










    Still it will give the following error:
    [ERROR] Failed to execute goal X.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project X: Compilation failure
    [ERROR] Failure executing javac, but could not parse the error:
    [ERROR] javac: invalid target release: 1.7
    [ERROR] Usage: javac
    [ERROR] use -help for a list of possible options


    To solve this issue, set the JAVA_HOME variable to the following using any of the following methods:

    // Set JAVA_HOME for one session
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

    OR

    // Set JAVA_HOME for permanently
    vim ~/.bash_profile
    export JAVA_HOME=$(/usr/libexec/java_home)
    source .bash_profile
    echo $JAVA_HOME

    Now compile the application

    For those who are curious...

    When deciding which JVM to consider for compiling, path specified in JAVA_HOME is used. Here's how to check that.
    echo $JAVA_HOME

    If it is not specified in JAVA_HOME, using  the following command, you can see where JDK is located in your machine:
    which java

    It will give something like this: /usr/bin/java

    Try this to find where this command is heading to.
    ls -l /usr/bin/java

    This is a symbolic link to the path /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands

    Now try the following command:
    cd /System/Library/Frameworks/JavaVM.framework/Versions
    ls

    Check where "CurrentJDK" version is linked to. (Right click > Get info)
    Mine it was  /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents.

    Version specified as the "currentJDK" will determine which JVM should be used from the available JVMs.

    So, this is why I got the "package java.nio.file does not exist" at the first place, as the default referenced JDK is older than 1.7.

    How to point Current JDK to correct version?

    cd /System/Library/Frameworks/JavaVM.framework/Versions
    sudo rm CurrentJDK
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/ CurrentJDK

    Additional info...

    Also, use the following command to verify from where the Java -version is read. (for fun!.. :))
    sudo dtrace -n 'syscall::posix_spawn:entry { trace(copyinstr(arg1)); }' -c "/usr/bin/java -version"

    It will output something like this:
    dtrace: description 'syscall::posix_spawn:entry ' matched 1 probe
    dtrace: pid 7584 has exited
    CPU     ID                    FUNCTION:NAME
      2    629                posix_spawn:entry   /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java



    Wednesday, January 29, 2014

    Eclipse F5, F6 keyboard shortcuts do not work in Mac OSX?

    Option 1
    Use F5, F6 with fn key

    Option 2
    Mac > System Preferences > Keyboard > Keyboard > check "Use all F1, F2 etc. keys as standard function keys


    Friday, January 24, 2014

    How to synchronize Mac notes with Google/ Yahoo email account?

    •  Launch Mac notes application

    • Notes > Add account


    • Give email information


    • Select Notes

    • Click done.  You can move your notes to different sections to synchronize them with email accounts.
    • Now login to email account and check the "Notes" section (Lable in Google accounts).




    How to open two Eclipse instances in Mac


    Tuesday, December 17, 2013

    Preview not responding in Mavericks

    To resolve the issue do the following:
    1. Force quit the non responding preview application
    2. In Finder, Go > Go to folder
    3. Type the following path in Go to the folder: ~/Library/
    4. Check com.apple.Preview. * folders/ files in the following folders and move to trash if any:
      1. Cache
      2. Containers
      3. Preferences
      4. Saved Application State
    5. Then, restart the computer

    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

    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.

    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