IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Glassfish et Payara Java Discussion :

java ee, glassfish et mysql


Sujet :

Glassfish et Payara Java

  1. #1
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2013
    Messages : 1
    Points : 1
    Points
    1
    Par défaut 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 XML : Sélectionner tout - Visualiser dans une fenêtre à part
    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 Java : Sélectionner tout - Visualiser dans une fenêtre à part
    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 Console : Sélectionner tout - Visualiser dans une fenêtre à part
    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.

  2. #2
    Modérateur
    Avatar de Gugelhupf
    Homme Profil pro
    Analyste Programmeur
    Inscrit en
    Décembre 2011
    Messages
    1 320
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Analyste Programmeur

    Informations forums :
    Inscription : Décembre 2011
    Messages : 1 320
    Points : 3 741
    Points
    3 741
    Billets dans le blog
    12
    Par défaut
    Bonjour,

    J'ai modifié ton post pour mettre les blocs de code entre les balises CODE (c'est le bouton dièse "#" à coté du bouton de citation).
    Ton fichier XML ne contient pas la configuration de connexion à ta base de données.

    Cordialement,
    N'hésitez pas à consulter la FAQ Java, lire les cours et tutoriels Java, et à poser vos questions sur les forums d'entraide Java

    Ma page Developpez | Mon profil Linkedin | Vous souhaitez me contacter ? Contacter Gokan EKINCI

Discussions similaires

  1. Réponses: 23
    Dernier message: 11/04/2012, 17h00
  2. Serveur java pour communique avec mysql ?
    Par AsmCode dans le forum JDBC
    Réponses: 2
    Dernier message: 15/02/2008, 20h21
  3. Java vers serveur Php/Mysql, quelle solution ?
    Par Mordoum dans le forum Général Java
    Réponses: 7
    Dernier message: 22/01/2008, 11h04
  4. Réponses: 5
    Dernier message: 23/09/2006, 13h18
  5. Sauvegarder une instance d'une classe Java dans une BDD MySQL
    Par malag dans le forum Administration
    Réponses: 1
    Dernier message: 03/09/2006, 19h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo