sabato 3 maggio 2014

WindowBuilder supports only SmartGWT versions 2.4, 2.5. But 4.1p found

To fix this error substitute file com.google.gdt.eclipse.designer.SmartGWT_3.1.2.r43x201307151456.jar under eclipse/plugin white these (free com.google.gdt.eclipse.designer.SmartGWT_3.1.2.r43x201307151456.jar
Confirm to work with SmartGWT 4.1p + eclipse 4.3(kepler) + gwt-designer 3.1.2. Below modification code details changed on file linked
Daniele
Index: src/com/google/gdt/eclipse/designer/smart/parser/ClassLoaderValidator.java
===================================================================
src/com/google/gdt/eclipse/designer/smart/parser/ClassLoaderValidator.java (working copy)

 import org.eclipse.jdt.core.IJavaProject;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;

 /**
  * {@link IClassLoaderValidator} for SmartGWT.
  * 

  * @coverage SmartGWT
  */
 public final class ClassLoaderValidator implements IClassLoaderValidator {

  private static final Pattern VERSIONS_PATTERN = Pattern.compile("^(\\d+\\.\\d+)[dp]?$");
  private static final String[] VALID_VERSIONS = {"2.4", "2.5", "3.0", "3.1", "4.0", "4.1", "5.0"};
  private static final String VALID_VERSIONS_STRING = StringUtils.join(VALID_VERSIONS, ", ");
 
   ////////////////////////////////////////////////////////////////////////////
   //

       public String runObject() throws Exception {
         Class classVersion = classLoader.loadClass("com.smartgwt.client.Version");
         String version = (String) ReflectionUtils.invokeMethod(classVersion, "getVersion()");
         Matcher matcher = VERSIONS_PATTERN.matcher(version);
         if (matcher.matches() && ArrayUtils.contains(VALID_VERSIONS, matcher.group(1))) {
           initializeSmartGWT(classLoader);
           return null;
         }

lunedì 7 aprile 2014

MysqlException Number Code List

When we catch exception using, for example, mysql net connector we can go deep and find out error.
We can discover error code, checking property Number of class MySqlException.



try
{
 connection.Open();
}
catch (MysqlException ex)
{
 switch (ex.Number)
                {

                    case 0:
                        return "Cannot connect to server";
                        break;

                    case 1045:
                        return "Invalid username/password, please try again";
                        break;                  

                 }
}

For a complete errors number list plaese referrer to http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html and in the share/errmsg.txt file

lunedì 10 marzo 2014

Cenots set Fully Qualified Domain Name Glasshfish problem

How to configure fqdn on centos for your linux box on private lan
Remeber that domain must be always full qualified,  domain + extension  (local + .com)

Example data:
Server Name ----------------------------------- gffp01t
Static ip ----------------------------------------- 192.168.1.191
Local domain (for your lan example) ------ local.com 

1 Edit Hosts File
$ sudo vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 gffp01t.local.com gffp01t
192.168.1.191 gffp01t.local.com gffp01t
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 
::1 gffp01t.local.com gffp01t

2 Edit network $ sudo vim  /etc/sysconfig/network HOSTNAME=gffp01t.local.com

.....
Reboot system  
.....

4 Verify
$ hostname
(output) gffp01t.local.com
$ hostname -f
(output) gffp01t.local.com