title: Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fault occurred while processing
body: <p>I &amp;m trying to expose my data base using a web service , i am using a postgresql data base , ejb 3.1 and , CXF as webservice framework.</p>
  
  <p>This is the entity </p>
  
  <pre><code>package persistance.model;
  
  import java.io.Serializable;
  import java.lang.String;
  import java.util.Date;
  
  import javax.persistence.*;
      /**
   * Entity implementation class for Entity: ENVOI
   *
   */
  @Entity
  @Table(name = "Envoi")
  @NamedQueries({@NamedQuery(name="Envoi.getAll", query="Select e from Envoi e")})
  
  public class Envoi implements Serializable {
  
      @Id
      @Column
      @GeneratedValue(strategy=GenerationType.AUTO)
      private int Id;
      @Column
      private int Numet;
      @Column
      private int Numseq;
      @Column
      private int Valadler;
      @Column
      private String Typemess;
      @Column
      @Temporal(TemporalType.DATE)
      private Date Horodatage;
      @Column
      private String Appli;
      @Column
      private String Versproto;
      @Column
      private String Data;
      @Column
      private String ACK;
  
      private static final long serialVersionUID = 1L;
  
      public Envoi() {
          super();
      }   
      public int getNumet() {
          return this.Numet;
      }
  
      public void setNumet(int Numet) {
          this.Numet = Numet;
      }   
      public int getNumseq() {
          return this.Numseq;
      }
  
      public void setNumseq(int Numseq) {
          this.Numseq = Numseq;
      }   
      public int getValadler() {
          return this.Valadler;
      }
  
      public void setValadler(int Valadler) {
          this.Valadler = Valadler;
      }   
      public String getTypemess() {
          return this.Typemess;
      }
  
      public void setTypemess(String Typemess) {
          this.Typemess = Typemess;
      }   
      public Date getHorodatage() {
          return this.Horodatage;
      }
  
      public void setHorodatage(Date Horodatage) {
          this.Horodatage = Horodatage;
      }   
      public String getAppli() {
          return this.Appli;
      }
  
      public void setAppli(String Appli) {
          this.Appli = Appli;
      }   
      public String getVersproto() {
          return this.Versproto;
      }
  
      public void setVersproto(String Versproto) {
          this.Versproto = Versproto;
      }   
      public int getId() {
          return this.Id;
      }
  
      public void setId(int Id) {
          this.Id = Id;
      }   
      public String getData() {
          return this.Data;
      }
  
      public void setData(String Data) {
          this.Data = Data;
      }   
      public String getACK() {
          return this.ACK;
      }
  
      public void setACK(String ACK) {
          this.ACK = ACK;
      }
  
  }
  </code></pre>
  
  <p>Now here the DAO</p>
  
  <p>this one is generic </p>
  
  <pre><code>package persistance.dao;
  
  import java.util.List;
  import java.util.Map;
  import java.util.Map.Entry;
  
  import javax.persistence.EntityManager;
  import javax.persistence.PersistenceContext;
  import javax.persistence.Query;
  //import javax.persistence.criteria.CriteriaQuery;
  
  public abstract class GenericDAO&lt;T&gt; {
      private final static String UNIT_NAME = "MestaPU";
  
      @PersistenceContext(unitName = UNIT_NAME)
      private EntityManager em;
  
      private Class&lt;T&gt; entityClass;
  
      public GenericDAO(Class&lt;T&gt; entityClass) {
      this.entityClass = entityClass;
      }
  
      public void save(T entity) {
      em.persist(entity);
      }
  
      protected void delete(Object id, Class&lt;T&gt; classe) {
      T entityToBeRemoved = em.getReference(classe, id);
  
      em.remove(entityToBeRemoved);
      }
  
      public T update(T entity) {
      return em.merge(entity);
      }
  
      public T find(int entityID) {
      return em.find(entityClass, entityID);
      }
  
      // Using the unchecked because JPA does not have a
      // em.getCriteriaBuilder().createQuery()&lt;T&gt; method
     /* @SuppressWarnings({ "unchecked", "rawtypes" })
      public List&lt;T&gt; findAll() {
      CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
      cq.select(cq.from(entityClass));
      return em.createQuery(cq).getResultList();
      }*/
  
      // Using the unchecked because JPA does not have a
      // ery.getSingleResult()&lt;T&gt; method
     /* @SuppressWarnings("unchecked")
      protected T findOneResult(String namedQuery, Map&lt;String, Object&gt; parameters) {
      T result = null;
  
      try {
          Query query = em.createNamedQuery(namedQuery);
  
          // Method that will populate parameters if they are passed not null and empty
          if (parameters != null &amp;&amp; !parameters.isEmpty()) {
          populateQueryParameters(query, parameters);
          }
  
          result = (T) query.getSingleResult();
  
      } catch (Exception e) {
          System.out.println("Error while running query: " + e.getMessage());
          e.printStackTrace();
      }
  
      return result;
      }*/
  
    /*  private void populateQueryParameters(Query query, Map&lt;String, Object&gt; parameters) {
  
      for (Entry&lt;String, Object&gt; entry : parameters.entrySet()) {
          query.setParameter(entry.getKey(), entry.getValue());
      }
      }*/
  }
  </code></pre>
  
  <p>this one is spécifique to Envoi entity </p>
  
  <pre><code>package persistance.dao;
  
  import javax.ejb.Stateless;
  
  import persistance.model.*;
  
  @Stateless
  public class EnvoiDAO extends GenericDAO&lt;Envoi&gt; {
  
      public EnvoiDAO() {
      super(Envoi.class);
      }
  
      public void delete(Envoi envoi) {
          super.delete(envoi.getId(), Envoi.class);
      }
  }
  </code></pre>
  
  <p>This is the Facade to expose the ejb </p>
  
  <pre><code>package persistance.facade;
  
  import java.util.List;
  
  import javax.ejb.Local;
  import javax.jws.WebService;
  
  import persistance.model.Envoi;
  
  @WebService
  @Local
  public interface EnvoiFacade {
  
      public abstract void save(Envoi envoi);
  
      public abstract Envoi update(Envoi envoi);
  
      public abstract void delete(Envoi envoi);
  
      public abstract Envoi find(int entityID);
  
      public abstract List&lt;Envoi&gt; findAll();
  }
  
  
  
  package persistance.facade;
  
  import java.util.List;
  
  import javax.ejb.EJB;
  import javax.ejb.Stateless;
  import javax.jws.WebService;
  
  import persistance.dao.EnvoiDAO;
  import persistance.model.Envoi;
  
  @WebService
  @Stateless
  public class EnvoiFacadeImp implements EnvoiFacade {
  
      @EJB
      private EnvoiDAO envoiDAO;
  
      public void save(Envoi envoi) {
          envoiDAO.save(envoi);
      }
  
      public Envoi update(Envoi envoi) {
          return envoiDAO.update(envoi);
      }
  
      public void delete(Envoi envoi) {
          envoiDAO.delete(envoi);
      }
  
      public Envoi find(int entityID) {
          // TODO Auto-generated method stub
          return null;
      }
  
      public List&lt;Envoi&gt; findAll() {
          // TODO Auto-generated method stub
          return null;
      }
  
      /*public Envoi find(int entityID) {
          return envoiDAO.find(entityID);
      }*/
  
      /*public List&lt;Envoi&gt; findAll() {
          return envoiDAO.findAll();
      }*/
  
  
  }
  </code></pre>
  
  <p>Now you will find the spring bean that publishes the service</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"&gt;
  
      &lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt; 
      &lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /&gt;
      &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt; 
  
      &lt;jaxws:endpoint 
        id="orderProcess" 
        implementor="demo.order.OrderProcessImpl" 
        address="/OrderProcess" /&gt;
  
       &lt;jaxws:endpoint 
        id="EnvoiFacade" 
        implementor="persistance.facade.EnvoiFacadeImp" 
        address="/EnvoiFacade" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Now you'll find the client and the bean associated to it </p>
  
  <pre><code>package demo.ejb.client;
  
  
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  import persistance.facade.EnvoiFacade;
  import persistance.model.Envoi;
  
  public final class Client {
  
      public Client() {
      }
  
      public static void main(String args[]) throws Exception {
          ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                  new String[] { "demo/ejb/client/client-beans.xml" });
  
          EnvoiFacade client = (EnvoiFacade) context.getBean("envoiClient");
          Envoi p1 = new Envoi();
          p1.setNumet(3690);
          p1.setNumseq(9990);
  
          client.save(p1);
  
  
  
      }
  }
  
  
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"&gt;
  
      &lt;jaxws:client id="envoiClient" serviceClass="persistance.facade.EnvoiFacade" address="http://localhost:8080/orderapp/EnvoiFacade" &gt;
      &lt;/jaxws:client&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Now my webservice deploy just fin in JBOSS 7.1.0 AS , i created the datasources and included the driver for postgres my sql , the problem is when a run the client i get this error </p>
  
  <pre><code>Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fault occurred while processing.
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:143)
      at $Proxy57.save(Unknown Source)
      at demo.ejb.client.Client.main(Client.java:23)
  Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
  ... 2 more
  </code></pre>