Friday, January 29, 2016

Eclipse: Solution Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

Problem: Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

Solution:

Remove the possible Breakpoint that presents conflicts
Open the "Debug View" /  Tab "Breakpoints", search them and uncheck them


Other possible solution: Change Start time in Server

Open the "Servers View" / Open Tomcat (or other) / "Tab Timeout" / Change Start tim




Wednesday, January 27, 2016

Java: Validate String null, equals(), isEmpty()


You can use this information for validate String in Java

== null,  "".equals(),   isEmpty(),   .equals()
Example:
 
        String s1 = null;

        if ("".equals(s1)) {
            System.out.println("empty 1 do not need the check null");
        } else if (s1 == null || s1.isEmpty()) {
            System.out.println("empty 2 only java 6+");
        } else if (s1 == null || "".equals(s1)) {
            System.out.println("Empty 3");
        } else {
            System.out.println("NO empty ");
        }


More info: http://stackoverflow.com/questions/3321526/should-i-use-string-isempty-or-equalsstring