After long time later, I am writing my programming blog again. Today, I downloaded glassfish-3.1.2.2-unix.sh. I am running Fedora 16. After successful installation of the glassfish, I was getting error when I ran the the following command: asadmin>start-domain "There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server. Command start-domain failed." Then I checked my hostname of the machine: hostname I got my hostname is nix-domain Now, nix-domain is not listed in the /etc/hosts file. Therefore, I added nix-domain in the file. 127.0.0.1 localhost nix-domain Now, I tried to run the start-domain again. It started perfectly without any error. Therefore, I understood that my machine assigned hostname 'nix-domain' is not listed in the hosts file, glassfish generated the error. I am hoping, it is not only the solution, there must be...
Homebrew setup guide This guide describes how to install Homebrew and few ferequently used Homebrew commands. Using Homebrew you can install software very easily. It is like linux "yum" command. Install Homebrew (The missing package manager for OS X): $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $brew doctor (You should see "Your system is ready to brew." on the console output. Do not move forward unless you see this.) Common commands: Check version of brew: $brew --version Search Homebrew repo: $brew search %app name% (i.e: I want to check "wget" is available or not. $brew search wget) Check app information: $brew info %app name% (i.e: $brew info wget) Install software package: $brew install %app name% (brew install tree) Uninstall software package: $brew uninstall %app name% (brew uninstall tree) Check installed packages in your system: $brew list Ins...
Sometime we need to convert Output Stream to Input Stream. We can perform the conversion multiple ways. The following two approaches are most popular: 1. ByteArrayOutputStream to ByteArrayInputStream 2. PipedOutputStream to PipedInputStream Complete example code is available in the [ Github ]. Approach 1: ByteArrayOutputStream/ByteArrayInputStream The ByteArrayOutputStream/ByteArrayInputStream is the easiest way to convert OutputStream to InputStream. Code snippet: TextWriter textWriterBins = new TextWriter(); ByteArrayOutputStream bouts = new ByteArrayOutputStream(); textWriterBins.write(bouts); ByteArrayInputStream bins = new ByteArrayInputStream(bouts.toByteArray()); TextReader textReader = new TextReader(bins); textReader.print(); Here, TextWriter is a class which writes some text in the OutputStream and TextReader is a class which reads data from InputStream and print on the console. In the above code snippet, the TextWriter.write method writes the da...
Comments
Post a Comment