Category Archives: Programming

Java Error – Unresolved Compilation Problem: Unhandled Exception Type FileNotFoundException

A typical issue when working with files in Java is a FileNotFoundException during program compilation, even though the program has not yet tried to find the file.  You may see some of the following symptoms:

Unresolved Compilation Problem given when trying to run the program through the Java compiler.

Or the following, as seen in the Eclipse Development Environment:

Eclipse shows Unhandled Exception Type FileNotFoundException

The reason for these errors is that you need to handle the possible exception, in case a value is passed into the constructor for FileInputStream that is not a valid file.  A good way to handle this exception is by adding a throw condition on the function declaration as seen below:

Adding a “throws” statement to the function declaration allows the function to handle potential exceptions properly.

Another way, and probably the best way to handle this is to add a catch to your try statement.  Then, you can handle the exception with any follow up logic that is needed and allow the function to handle it internally instead of throwing the exception.

Using a catch statement with our try block instead of throwing the exception at the function level.

Happy Coding!

Talend Open Studio – java.sql.SQLException – Native SSPI Library not Loaded

There is a bug in Talend Open Studio for Data Integration version 5.0.2 when trying to connect to SQL Server without passing a user name and password.  Java requires libraries for single signon for this to occur, specifically the ntlmauth.dll file for the system.  However, in Talend Open Studio 5.0.2, having this file does not allow single sign on to Microsoft SQL Server.  This is confirmed on Microsoft SQL Server 2008 R2 64-bit.

When attempting to connect without supplying a username and password, the following error is received:

This issue is fixed in production release 5.1.1 of Talend Open Studio.  A workaround in version 5.0.2 is not available at this time.

Error Adding DB Connection in Talend Open Studio 5.1.1

There is a bug in Talend Open Studio for Data Integration version 5.1.1 when adding a database connection.  It has to do with the jdts component used for Microsoft SQL Server connections.  When adding a new connection you may get one of the following errors:

java.lang.ClassCastException: net.sourceforge.jdts.jdbc.CnnectionJDBC3 cannot be cast to net.sourceforge.jdts.jdbc.CnnectionJDBC2

The above error usually appears the first time you hit the button to “Check” the connection.  The second and subsequent attempts will produce a different error message as follows:

Impossible to initialize the connection !

This is a bug in Talend Open Studio for Data Integration that has a fix already implemented in the future 5.1.2 version.

See details of this bug at:  TDI-21382 SQL Server Connexion Fail

Update on 3/5/2013: The Impossible to Initialize the Connection error has been corrected in a future version.  Check out Talend Impossible to Initialize the Connection.

Should I Learn PHP?

There are a lot of web programming languages available.  It’s often dificult to choose one, but among web programming one sticks out beyond all the others.  It is PHP (originally and acronym for “Personal Home Page”).

The reasons that PHP make a great language to learn include the following:

  • It runs on web servers that are free to install and run
  • The web servers available run on many different operating systems
  • It is very powerful, like many web programming languages
  • There are great, free development environments available
  • PHP is the backbone to many popular content systems, including WordPress Blogging
Why choose web languages that requires expensive development environments and high licensing costs?  Put your time into learning a language that is free to develop and run, comes with no licensing headaches, and is still powerful.