Monday, September 14, 2015

What are new changes in java 8 for Date API?

Java8 Introduced new classes , easy to use

java.time.LocalDate;
java.time.LocalTime;
java.time.LocalDateTime;

Use the above Date Time classes with below arguments for specific need
java.time.Month;
java.time.ZoneId;
java.time.LocalTime;
java.time.ZoneOffset;

java.time.Instant; Obtains the current instant from the system clock.
java.time.Duration;  Obtains a Duration representing a number of standard 24 hour days.


Sunday, September 13, 2015

Problem with commiting new code to SVN ?

You have created a new project and added to version control, but at while commiting to SVN is  pointed to different SVN URL, which is not actual svn url


To solve such problem, detele the .svn hidden folder.

This solves the problem and point you to right SVN URL after svn synch


Saturday, September 12, 2015

What are hibernate.hbm2ddl.auto values?

validate | update | create | create-drop
  • validate- existing schema
  • update- only update your schema once created
  • create- create schema every time
hibernate.hbm2ddl.auto Automatically validates or exports schema
DDL to the database when the
SessionFactory is created. With create-drop,
the database schema will be dropped
when the SessionFactory is closed explicitly.
e.g. validate | update | create | createdrop

An internal error occurred during: "reload maven project". java.lang.NullPointerException

My Eclipse  failed to update some maven deps. and not responding, killed the  eclipse.exe procees

I have got this error when launching eclipse after the crash

An internal error occurred during: "reload maven project". java.lang.NullPointerException

 remove this file .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

problem solved!!

Friday, September 11, 2015

An internal error occurred during: "Starting Tomcat v8.0 Server at localhost". Could not initialize class java.net.SocksSocketImpl

Got this error at server start up:

An internal error occurred during: "Starting Tomcat v8.0 Server at localhost".
Could not initialize class java.net.SocksSocketImpl

Possible reason : issue with default HTTP port 8080

Solution : Change the HTTP port to some other value like 8087, and restart the server

This might solve the problem

Example Server configuration file :

F:\Eclipse-wks\Servers\Tomcat v8.0 Server at localhost-config\server.xml (if you are using Eclipse IDE )

F:\WebAppServers\apache-tomcat-8.0.24\conf\server.xml

   <Connector connectionTimeout="20000" port="8087" protocol="HTTP/1.1" redirectPort="8443"/>

Thursday, September 10, 2015

Tuesday, September 8, 2015

How to create and apply patch file in svn?

Creating a patch :
Suppose you have modified the project code and want to know the lines you changed.
You can export all you code changes to a file and  reviewed with you manager

Use svn diff command to export changes into a file.
Eg: <projectDir>$svn diff > myPatch.diff

Applying a patch :
Similarly you want to import others code changes in the form of patch file.
command to import / apply all changes is
<projectDir>$svn patch <patchfile> <projectDir>
Eg: svn patch xyz_changes.diff  /home/xxx/workspace/projectX

You can do these tasks in GUI mode as well in eclipse.
Right click on project:
Team --> Create Patch
Team --> Apply Patch