java ee, glassfish et mysql
Bonjour chers développeurs.
Je commence à peine à coder et voilà ce que j'ai:
Je suis en train de concevoir une application web avec java.
J'utilise jdk 8u91, netbeans 8.0.2 et mysql 5.6.31.
Voici les différents codes:
persistence:
Code:
1 2 3 4 5 6 7 8
| <?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ProjetSout-ejbPU" transaction-type="JTA">
<jta-data-source>jdbc/aibef</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence> |
ejb:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| @Stateless
@LocalBean
public class ClientBean {
@PersistenceContext(unitName = "ProjetSout-ejbPU")
private EntityManager em;
public Client creerClient(Client clt){
em.persist(clt);
return clt;
}
public List<Client> getAllClients() {
Query query = em.createNamedQuery("Client.findAll");
return query.getResultList();
}
public void persist(Object object) {
em.persist(object);
}
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
} |
Après le déploiement et l'exécution de l'application je reçois ceci:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Infos: visiting unvisited references
Infos: visiting unvisited references
Infos: visiting unvisited references
Infos: visiting unvisited references
Infos: jpa.Clinique actually got transformed
Infos: jpa.Soins actually got transformed
Infos: jpa.Consultation actually got transformed
Infos: jpa.Methode actually got transformed
Infos: jpa.Client actually got transformed
Infos: jpa.Rendezvous actually got transformed
Infos: jpa.IecCcc actually got transformed
Infos: jpa.Antenne actually got transformed
Infos: jpa.Produit actually got transformed
Infos: jpa.Counseling actually got transformed
Infos: jpa.Personnel actually got transformed
Infos: EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
Infos: file:/C:/Users/M.Kouassi/Documents/NetBeansProjects/ProjetSout/dist/gfdeploy/ProjetSout/ProjetSout-ejb_jar/_ProjetSout-ejbPU login successful
Infos: Portable JNDI names for EJB ClientBean: [java:global/ProjetSout/ProjetSout-ejb/ClientBean, java:global/ProjetSout/ProjetSout-ejb/ClientBean!ejb.ClientBean]
Infos: Portable JNDI names for EJB ConsultationBean: [java:global/ProjetSout/ProjetSout-ejb/ConsultationBean, java:global/ProjetSout/ProjetSout-ejb/ConsultationBean!ejb.ConsultationBean]
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Infos: Initialisation de Mojarra 2.2.7 ( 20140610-1547 <a href="https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362" target="_blank">https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362</a>) pour le contexte «/ProjetSout-war»
Infos: Running on PrimeFaces 5.3
Infos: Loading application [ProjetSout#ProjetSout-war.war] at [ProjetSout-war]
Infos: ProjetSout was successfully deployed in 8*989 milliseconds.
Avertissement: Context path from ServletContext: /ProjetSout-war differs from path from bundle: ProjetSout-war |
et j'arrive pas à insérer les données en base.
Je ne sais pas si c'est server glassfish ou netbeans.
Merci de bien vouloir m'aider.