Category Archives: General

wsimport to jar

>wsimport -clientjar service.jar http://myhost:myport/ws/service?wsdl


NP++ pattern


for matching

/* 1: */

MS Font for J2EE Web application Deploying in Linux

Add this dependency to your projects POM






Red Hat Linux 6.6 configuring firewall

Found a superb command for configuring firewall in redhat linux



Postgresql 9.5 and Red Hat Enterprise Linux 7.0

I used to use Postgresql 9.5 with Red Hat Enterprise Linux 6.6.

As quite a long time passed using them, I had change my server configuration. So, I tried to start using Postgresql 9.5 and Red Hat Enterprise Linux 7.0 . When started installing them, I found out that these completely new command set.  Here it goes,

rpm -ivh pgdg-redhat95-9.5-3.noarch.rpm
yum install postgresql95-server.x86_64

Read more of this post

JSF : Check Version

JSF : Check Version

String version = FacesContext.class.getPackage().getImplementationVersion();

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

JDK installation in Redhat Linux

I had OpenJDK installed in my Redhat Linux. That openJDK was 1.6, i wanted to install jdk 1.7 from

So at first I had to uninstall OpenJDK. So,

yum remove java-1.6.0-openjdk.x86_64

Then I downloaded jdk-7u79-linux-x64.rpm from the above link.

I copied the rpm to /usr/java and issued command as root

rpm -ivh jdk-7u79-linux-x64.rpm

after installation I issued

java -version

To check the installation.

The result. hmmmm….

java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Looks like we are cool.

Making an executable jar file


Right click on your Java Project and select Export.

Select Java -> Runnable JAR file -> Next.

Select the Launch Configuration and choose project file as your Main class

Select the Destination folder where you would like to save it and click Finish.


java -jar <jar-file-name>.jar

Why do many software engineers not like Java?

Interesting experience shared.

Answer by Costya Perepelitsa:

Let me answer by telling you about a programming test I evaluated this week. All things considered, it was solid, even succinct Java. The candidate had a ton of industry experience with Java, and it showed.
Bear in mind that none of the examples I'm about to give are what I'd call bad or dumb or unnecessarily complex; these are all, for the most part, what Java and the industry call sensible, standard practice.

Spoiled as I am with inferred typing, every time I see a line like…


…I die a little on the inside. Because to me, that says, "depMap is a map, which is a map."
52 characters just to define a common data structure? Come on. Indentation included — and this kind of definition must be indented at least twice — this kind of crap takes up the majority of my terminal width.
Reading through basic declarations is a minor undertaking in and of itself. And when there's a block of declarations like this, my eyes glaze over and my ADD kicks in, and I suddenly and strongly want to do absolutely anything else with my time.
I would honestly rather read overly-clever and terse Perl, because I would rather put my brain to use figuring something out than push it through this kind of mind-numbing tautological filler.

And for anything even slightly more complicated, especially APIs written by card-carrying members of the Cult of Design Patterns, you see things like this:

private static final 
Logger LOGGER 

This initializes a very basic logger from SLF4J: the Simple Logging Facade for Java.
Did you catch that word "simple"? This 73-character (69 plus the length of your class' name) monstrosity, in which the word "logger" appears no fewer than four times, is how you do simple logging in Java. It's all uphill from there.

This submission also followed the standard Java package naming convention of stress-testing my filesystem with entirely too many nested directories, most of which contained only the next nested directory:


7 directories deep, that code is. That's the number of times I had to press tab in my


command just to get to the code.
And this is just for a simple one-off program; it gets all the deeper with each small step of complexity. I have seen, in my career, upwards of 20 nested directories that could not reasonably have been shortened.
With most languages, an IDE is a useful tool for managing a sufficiently complicated project; with Java, an IDE is a necessity for navigating an unavoidable labyrinth created by even the simplest of projects.

Since it used third-party libraries, as most any Java program in the industry is bound to do, my choices for compiling what was otherwise an extremely basic program were:

  • download all JARs myself and write classpaths in my compile and run commands that stretched several lines in my terminal
  • use Ant
  • use Maven

And after briefly reliving the utter insanity that come with those latter two, the first option ended up being the least painful.

The candidate was nice enough to include a


, so I naturally tried Maven first. Since I hadn't used it in a while, I first ran


and desperately hoped it would Do The Right Thing. But after downloading roughly half of the Internet, not to mention flooding my terminal with literally hundreds of lines describing each step it was taking, Maven informed me that I needed to specify one of its entirely too many (30, by my count) ambiguously named "goals". I spotted at least four or five that could plausibly have meant "just compile the fucking thing," but I got very sick, very quickly, of watching Maven download the same half of the Internet it had already downloaded, every single time it ran, even when it could easily have stopped early with an error message when I gave it invalid input, as I iterated through that list of possible goals. It didn't help that the output was so criminally long with each run that I lost track of where it had dumped that mega-list of goals; if my terminal continued out the top of my monitor, I'm willing to bet that list would be in outer space. I wasn't feeling like scrolling into outer space that day, and I definitely didn't feel like running


with no arguments again just to print another copy, so I looked into my other options in the vain hope that they'd be simpler.

Skimming through the Apache Ant manual revealed that I'd have to write XML to use it. I honestly believe I saved myself an aneurysm by proclaiming, "fuck that noise," and closing the browser tab.
(PROTIP: The key is hearing yourself say it out loud. Otherwise, your brain might still suspect that you're willing to try writing XML just to compile a single-file, <200 line Java program and try to end its own existence before being forced to comply.)

And thusly did I find myself Googling class names in compilation errors to find the projects that had the source to make the JARs to give the compiler to build the fucking program.
And it gave me much less of a headache than Maven did, because I at least felt like I was making progress.

This happens pretty much every time I try to do something with Java.
Writing it is a tedious, painful exercise in patience.
Reading it is a tedious, painful exercise in patience.
Compiling it is, you guessed it, a tedious and painful exercise in patience.
And even running it is somehow precisely as painful and tedious as compiling it.

Every task in Java — every task — is like filling out endless tax forms.
And I know, and you know, and Java knows, that it doesn't have to be this way, because you can some-crazy-how accomplish exactly what you can in Java using other languages that are just as portable, performant, and commonly known, but considerably less of a Byzantine clusterfuck.
And yet these problems persist.
And so I continue to keep my distance.

Why do many software engineers not like Java?