vendredi 16 décembre 2016

Caused by: java.lang.RuntimeException: Could not find conduit initiator for address:

Caused by: java.lang.RuntimeException: Could not find conduit initiator for address: 

This problme can be caused by the absence of  this jar :cxf-rt-transports-http-3.0.0.jar.

jeudi 15 décembre 2016

org.apache.cxf.Messages != org.apache.cxf.APIMessages

java.lang.IllegalArgumentException: org.apache.cxf.Messages != org.apache.cxf.APIMessages

This exeption can occur when we use web service with cxf.
Here,we have a problem of jar between server side and client side.
for example on server we have this version cxf-core-3.0.0.jar  wich  contains org.apache.cxf.Messages


But on client we find this version cxf-bundle-20.10 wich  contains org.apache.cxf.APIMessages.

To resolve this exception we have just to change cxf-bundle-20.10 by  cxf-bundle-3.0.0-milestone2.zip  wich  contains org.apache.cxf.Messages.

I hope this help you :)




error on mapping with @EmbeddedId

Eclipse error on mapping with @EmbeddedId.

this error occurs when you use composite id on JPA project 
To resove it you must do like this :
Preferences -> Java Persistence -> JPA -> Errors/Warnings -> Attribute -> Embedded ID classes should not contain relationship mappings: (Ignore)


dimanche 16 octobre 2016

failed to create the java virtual machine

failed to create the java virtual machine


This problem appears when you launch eclipse.

To resolve it you must open the file eclipse.ini . and change the value of -Xmx1024m to -Xmx512m


the final file you obtain is like this;


-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

dimanche 4 septembre 2016

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in


to resolve this deprecated warning you can add   "@" operator before function name like

 @mysql_connect("localhost","root","");

or add this function

 error_reporting(E_ALL ^ E_DEPRECATED)

in fact:
To not display the E_DEPRECATED errors (for example) without changing the rest of the configuration :
error_reporting(error_reporting() & (-1 ^ E_DEPRECATED));

http://www.php.net/manual/fr/function.error-reporting.php

error in http connection org.apache.http.conn.HttpHostConnectException: Connection to

Error in http connection org.apache.http.conn.HttpHostConnectException: Connection to http://192.168.1.72:80 refused


This exception occured when you connect to server and is not started .you must verify the server wamp or easyphp for example is started or no.

samedi 3 septembre 2016

Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value:

Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: persistance.Client.prenom
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)


This exception occurs because you have a column named prenom wich is not nullable , and you forgot to set it's value.

So to resolve this issue you must add a valuet to this property .

lundi 29 août 2016

org.hibernate.LazyInitializationException: could not initialize proxy - no Session

org.hibernate.LazyInitializationException: could not initialize proxy - no Session
 org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
 org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
 org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)


This problem occurs when you have a relation between tow tables.
Your objects are lazy initialized. That's mean, they are initializing only on demand on non-closed session. 
To resolve this exception add laze=false  into you mapping file or  change FetchType.LAZY to FetchType.EAGER
if you use annotation.

In fact,the EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first accessed.

vendredi 26 août 2016

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program

finished with non-zero exit value 2

To resolve this issue you must go to your build.gradle on your module
and add:
 multiDexEnabled true

after defaultConfig {

and  add:
 compile 'com.android.support:multidex:1.0.0'

on dependencies {
   

mercredi 24 août 2016

org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net

 org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
  hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
    org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
    hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net


This error happens only whenyou work  offline. hibernate try to read the DTD when parsing the config.

Hibernate can resolve the DTDs locally.

To solve this issue:

instead of:

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
use:

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  

      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> 



if the excpetion persist try to change


<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">


by this code:




!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">


the difference between them "www". 


lundi 22 août 2016

you don't have permission to access / on this server. wamp

you don't have permission to access / on this server. wamp

to resolve this exceptions you go to httpd.conf on your wamp and  change Require local by  Require all granted


    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    # Online --> Require all granted
    
    #   onlineoffline tag - don't remove
    
    Require local

</Directory>



will change to




    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    # Online --> Require all granted
    
    #   onlineoffline tag - don't remove
    
   Require all granted

</Directory>

Duplicate files copied in APK META-INF/DEPENDENCIES

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES.


To resolve  this exception you must add this code to your  build.gradle,just before buildTypes


packagingOptions{
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
    }
 symbol  : class HttpServletRequest

This exception occurs when you build a maven project .



To resolve it just put this dependency on your pom.xml.

 <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

lundi 20 juin 2016

GRAVE: java.lang.IllegalStateException: Cannot get a numeric value from a text cell

GRAVE: java.lang.IllegalStateException: Cannot get a numeric value from a text cell

just make this to resolve that problem:


cell.setCellType(Cell.CELL_TYPE_STRING);

jeudi 5 mai 2016

error: package org.hibernate.annotations does not exist

error: package org.hibernate.annotations does not exist maven


This error appears when i do built to a maven project using hibernate.
to resolve this problem just add this dependecy to your pom.xml

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.0-Final</version>
</dependency>

lundi 2 mai 2016

java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.JtaPlatform.spi.JtaPla

java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.JtaPlatform.spi.JtaPlatform

Since Hibernate 4.3.x, the JtaPlatform class is refactored to a new package. To resolve this exception downgrade Hibernate to 4.2.x or older, or upgrade the Spring framework.

Modify your Pom.xml and add theses dependencies:


jeudi 28 avril 2016

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded;charset=UTF-8

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded;charset=UTF-8

This exception  appears when you want to make upload on your from.

To resolve this problem you must add in your commnadbutton this attribute ajax="false".


and enctype="multipart/form-data" on your form.
Like this:
<h:form enctype="multipart/form-data">


gradle dsl method not found 'android()'

gradle dsl method not found 'android()':
This error appears if you run your project with anthoer Android studio. 

In fact Android Studio incorrectly adds the android() method in the top-level build.gradle file.

So to resolve this problem you have just to delete this code and make rebuild to this your project.

dimanche 24 avril 2016

rg.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update

rg.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: 
Batch update returned unexpected row count from update

This problem appears if we use hibernate and we want to add an object on 
the database.
This exception occurs,when we want to add the value of a primary key and we
 make the column on the table autoincrement.

So to get rid of this exception we must remove autoincrement from the database at 
this column or we have to remove the addition of this value 
 from the code or from the form.

vendredi 15 avril 2016

org.apache.http.conn.HttpHostConnectException: Connection to http://10.0.2.2:80 refused

 org.apache.http.conn.HttpHostConnectException: Connection to http://10.0.2.2:80 refused

This exception occurs when you want to invoke from your emulator an url from apache ,using for example wamp or easyphp.
To resolve it you must add 10.0.2.2 to be allowed on the file of configuration of apache server.
So go to Apache httpd.conf (located in Apache folder): and search for
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
and check if the second line is Deny, if it is then change it to:
Allow from all


jeudi 7 avril 2016

FailOnMissingWebXml

FailOnMissingWebXml error when validating pom.xml in Eclipse

this exception occurs on a maven project .
To resolve it you must add this :

  <properties>
 <failOnMissingWebXml>false</failOnMissingWebXml>

  </properties>

on your pom.xml

vendredi 18 mars 2016

Etat HTTP 500 - Could not write JSON: failed to lazily initialize a collection of

Etat HTTP 500 - Could not write JSON: failed to lazily initialize a collection of

This exception occurs for example when you invoke with json an entity with has a relation with another
 (@ManyToOne).

To resolve this problem you must add @JsonIgnore before   (@ManyToOne), above  the getter of the property, and add @JsonProperty above the setter of the property.

mercredi 17 février 2016

com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID

com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 

This exception occurs when you want to add an attribute

vendredi 8 janvier 2016

com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java

com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)

and another exception :

Caused by: java.net.UnknownHostException: www.springframework.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)


To resolve this problem you must

reeplace http://www.springframework.org/schema/tx/spring-tx-4.0.xsd on your spring configuration file by
 http://www.springframework.org/schema/tx/spring-tx.xsd and you'll be fine .you must  modify the context import as well.

java.nio.file.AccessDeniedException:

java.nio.file.AccessDeniedException:

org.hibernate.PersistentObjectException: detached entity passed to persist:

org.hibernate.PersistentObjectException: detached entity passed to persist:



you get this exception when want to add an object with JPA. 
The first time  everything goes fine and Object is inserted in the database. 
The second time,  it fails and you have this exception.
To resolve this do:
em.merge(user);
instead of
em.persist(user);




mercredi 6 janvier 2016

org.ksoap2.serialization.SoapPrimitive cannot be cast to org.ksoap2.serialization.SoapObject

org.ksoap2.serialization.SoapPrimitive cannot be cast to org.ksoap2.serialization.SoapObject

This  exceptions is generally due to invalid returned value from a method.

you have on your code:

SoapObject   soapObject = (SoapObject) envelope.getResponse();

you must correct it by using bodyIn not getResponse().

your code must be like this:


SoapObject   soapObject = (SoapObject) envelope.bodyIn ;





mardi 5 janvier 2016

java.sql.SQLException: Index de colonne non valide

Exception:java.sql.SQLException: Index de colonne non valide
this problem occurs when we work with jdbc and want to know the value of a column that the index is worng for example we do:

ResultSet rs= stm.executeQuery(SQL);
long id=0;
while (rs.next()) {
id=rs.getLong(0);
}

to resolve this exception we must change  id=rs.getLong(0); by  id=rs.getLong(1);  you must be sur  that the index exist.

java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64

The exception "java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64" means that the class Base64 is not found on your classpath.

you must add a jar that contain this class and add it to your classpath.
This is the name of the jar :commons-codec-1.6.jar
if you work with maven,this is the dependency:

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.2</version>
</dependency>






webservice-from-android-using-ksoap2-parameters-are-null

The problem occured when we use jax-ws webservice.
This is not due to android code . 
You must  add annotations @WebMethod ,@WebParam  and not forget  targetNamespace .




lundi 4 janvier 2016

java.io.IOException: invalid SHA1 signature file digest

java.io.IOException: invalid SHA1 signature file digest 

This exception occurs when we user jarsigner.

This error can happen when the jar is signed twice.
it can be resolved if you open the jar that you  want to sign and "unsign" it.

 to unsign a jar , you must delete *.SF, *.DSA, *.RSA files from the jar's META-INF and then sign the jar again.










CANADA JOB