jeudi 21 décembre 2017

org.hibernate.cfg.jdbcbinderexception duplicate class name generated for

org.hibernate.cfg.jdbcbinderexception duplicate class name generated for


To resolve this problem you have to add this property to hibernate.cfg.xml, 
and add the value of shema in uppercase.

  <property name="hibernate.default_schema">DEV</property>

vendredi 27 octobre 2017

canno't start tomcat on netbeans

Thes problem is that if you want to start tomcat on netbeans ,it fails.

To resolve this must do like this:




and uncheck proxy:



lundi 11 septembre 2017

is not mapped as an embeddable

Is not mapped as an embeddable.

To resolve this problem you must disable JPA validation for builds.

To do this: you must:

1-Right-click on the project
2-select properties.
3-Select Validation
4-check Enable project specific settings.

5-Uncheck JPA Validator. Clean the project





mercredi 30 août 2017

org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [java/lang/annotation/Target.class]

org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [java/lang/annotation/Target.class]


To resolve this problem you must use Spring 4 is  for java 8 to . if you use   Spring version: 3.2.5.RELEASE, you must use java 7.

dimanche 30 juillet 2017

Error:Failed to find Build Tools revision 24.0.2

Error:Failed to find Build Tools revision 24.0.2


To resolve this error you must add Android SDK Build-tools like this:



mardi 11 avril 2017

Caused by: java.lang.IllegalArgumentException: Illegal pattern character 'Y'

Caused by: java.lang.IllegalArgumentException: Illegal pattern character 'Y'


This exceptions can occur, if you want to parse to a date for example and you put the patter of year wrong

on SimpleDateFormat like this:

SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-YYYY");

whereas ,it must be  like this :


SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");

jeudi 2 février 2017

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

This exception appears when you use a maven project.
to resolve it you must follow these steps:





mercredi 1 février 2017

List Java contains doesn't work as expected

List Java contains doesn't work as expected

I have this code not working as expexted:

import java.util.Arrays;
import java.util.List;

public class Test {
static int[] listm = { 2,3,5 };

public static void main(String[] args) {

contains(listm, 2);
}

public static boolean contains(int[] array, int key) {

List l = Arrays.asList(array);
boolean contain = l.contains(key);
System.out.println("" + contain);
return contain;
}

}

it returns  false,even the item 2 is found on the collection listm .

To resolve this problem,we must change the generic value of the collection to Integer.

The code become like this.


public class Test {
static Integer[] listm = { 2,3,5 };

public static void main(String[] args) {

contains(listm, 2);
}

public static boolean contains(Integer[] array, int key) {

List<Integer> l = Arrays.asList(array);
boolean contain = l.contains(key);
System.out.println("" + contain);
return contain;
}

}








it works :)