20 Aralık 2013 Cuma

Hibernate - JSF Project Error : JavaReflectionManager cannot be cast to MetadataProviderInjector

During working on Hibernate-JSF project on Eclipse, I got such errors;
java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.JavaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.MetadataProviderInjector
java.lang.NoSuchFieldError: INSTANCE
For this situation, two annotation modules are detected in library files that are already added into the project for Hibernate processes. It causes conflict. Since "hibernateX.jar - hibernate core library" can perform annotation task without other dependency, you should delete both "hibernate-annotations.jar" and "hibernate-commons-annotations.jar" files to solve these kinds of problems.

12 Kasım 2013 Salı

Referenced file contains errors (jar:file:/.../plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd)

When I create new JavaServer Faces v2.2 project on Eclipse Kepler, I get an error in faces-config.xml file such as; 

"Referenced file contains errors (jar:file:/.../plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd)."

faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">

</faces-config>

It is obvious that http://xmlns.jcp.org/xml/ns/javaee is generated twice. To handle this error, one of them should be removed. Matching library versions with the XSD version is important, that's why removing first appearance is more proper action.

26 Şubat 2013 Salı

Weka GUI - OutOfMemory

"Not enough memory. Please load a smaller dataset or use a larger heap size."

Weka sometimes gives this error, if you use large datasets. To handle it, specify a larger heap size by changing the RunWeka.ini configuration file. The file is in the Weka folder of your Program Files directory on Windows. You should increment the value of the variable which regulates maximum heap size, such as "maxheap=1024m".

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space

While using eclipse to run Java program, I was faced with the error below;
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Reason;
Eclipse uses default value of memory, if you don't change it. While using large data in your program, this default value is not enough.
Solution;
Eclipse>Windows> Preferences> Java> Installed JREs> Select the JRE> Click edit> Write in the Default VM Arguments: -Xmx1024M or any other amount of memory ...