Friday 13 November 2015

Painful Eclipse Gotchas

1. Validation on Startup

Validation happens on startup. With a lot of xml files in the project like ours, this can take minutes as it downloads Schema etc.

It would be better if this was disabled by default.

2. Update SVN Cache

Interestingly, this is a painful one where the eclipse locks up when opening up an existing workspace. If it doesn't crash it sits there at 99% forever (reports say it comes back after 30min)

The workaround is the delete the .project file of your Servers project. You will have to recreate your server however this is much less pain than waiting for it to finish.

3. Maven import doesn't create Java Projects

The Maven import imports the project but the classpath doesn't get set. What seemed to fix this is make the maven-compiler-plugin and maven-jar-plugin the same version (at least I think this is was solved the issue)

4. Server Deployment Location

Normally I set up the TCServer (tomcat) on my local machine and have multiple instances etc. The problem is I like to deploy to my server location rather than the .metadata folder. Imagine traversing to the location in the metadata folder, its difficult to remember (okay a right-click "Open Deployment Location" may work).  I think this should be a default, especially if one works in multiple workspaces.




Tuesday 17 March 2015

Slow Network Connection Setup on Linux

Background

This is really a last resort article, when you've tried everything else, try this.

I'm running Fedora Linux 20 on my dev machine, and experienced slow JDBC connection setup from my application as well as from my Eclipse IDE. Applications like JBoss started up unusually slow. My colleagues running Windows did not have the same problem, so I was assuming it was a Linux issue. It turns out it was just a small configuration issue.

Symptoms


1. Connection to an HP Tandem SQLMX database was slow.
2. JBOSS Startup was very slow, it used to hang at something like "15:10:00,555 INFO  [Server] Core system initialized" and I used to wait for about 20 seconds before it continued.
3. My Corba application which also made use of these connections was painfully slow at startup.

Attempted Solutions


I tried switching off the IPV6 stack but this didn't help.
Decreased the number of connections in my application's connection pool, which did help but stuff was still slow.


 Solution

 Eventually it turned out that the localhost entry in my /etc/hosts entry was incomplete.

Before

              127.0.0.1    localhost                                  

After

127.0.0.1    localhost.localdomain localhost

The localhost.localdomain is the fully-qualified domain name (FQDN). It looks like this is supposedly prevent DNS lookups. On a production server, I would think that this is an important setting to have as well.

Conclusion


After adding this, my system was back to normal! This may seem a trivial fix, however this took a lot of time to find the solution, which isn't that obvious.