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

Eclipse Java Discussion :

[Tomcat]Hibernate eclipse et TOMCAT


Sujet :

Eclipse Java

  1. #1
    Pck
    Pck est déconnecté
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 3
    Points : 1
    Points
    1
    Par défaut [Tomcat]Hibernate eclipse et TOMCAT
    Bonjour Julien Defaut,

    D'abord merci pour tous les articles que tu rediges sur developpez.com car ils me sont d'une grande aide pour mon perfectionnement sous java....

    Je viens de lire ton tutoriel "Debuter Hibernate sous eclipse" .... tous se passe tres bien .. il n'y rien a redire ...

    maintenant je cherche a faire la meme chose mais au lieu de partir d'un "java project" je souhaite partir d'un projet TOMCAT sous eclipse (apres installation du pluging TOMCAT pour eclipse) ..... et la ca va deja beaucoup moins bien ...

    pourtant je suis parti de ton tutoriel mais que j'ai cherche a adapter a la carateristique du projet TOMCAT sous eclipse

    Peux tu m'apporter un peu d'aide stp ?????

    voici ce que j'ai fait ...

    1) Creation d'un projet java TOMCAT
    2) Sous l'explorateur windows dezipe du package libs_tuto.zip dans le repertoire Workspace\HibernateTestTomcat\WEB-INF\lib
    3) Sous eclipse sur le projet HibernateTestTomcat .... Refresh .... les Jars apparaissent bien sous le repertoire WEB-INF\lib
    4) Comme pour le projet JAVA, je fait en sorte que les jars se retrouve directement sous le nom de projet avec les manip sur les librairies du Java Build path
    5) ensuite je cree mon fichier hibernate.cfg.xml (malheureusement le nom du serveur d'application TOMCAT n'apparait pas dans la listBox de l'ecran de parametrage .. je laisse N/A) .. le fichier se cree et je ne fais aucune modification contrairement a ta doc car je veux utilise un serveur d'application !!!
    6) Ensuite j'effectue scrupuleusement comme tu l'expliques toutes les etapes du tutoriel
    7) et je lance l'insertion de deux lignes dans ma table

    Voici ci dessous le resultat sur la console

    Apparement j'ai un probleme pour travaille avec mon serveur d'application ... qu'est ce qui ne va pas ... et que dois je ajouter ou modifier

    D'avance merci

    Pierrick
    Code : 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
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
     
    12 oct. 2005 11:00:24 net.sf.hibernate.cfg.Environment <clinit>
     
    INFO: Hibernate 2.1.6
     
    12 oct. 2005 11:00:24 net.sf.hibernate.cfg.Environment <clinit>
     
    INFO: hibernate.properties not found
     
    12 oct. 2005 11:00:24 net.sf.hibernate.cfg.Environment <clinit>
     
    INFO: using CGLIB reflection optimizer
     
    12 oct. 2005 11:00:24 net.sf.hibernate.cfg.Configuration configure
     
    INFO: configuring from resource: /hibernate.cfg.xml
     
    12 oct. 2005 11:00:24 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
     
    INFO: Configuration resource: /hibernate.cfg.xml
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration addResource
     
    INFO: Mapping resource: TContact.hbm
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Binder bindRootClass
     
    INFO: Mapping class: com.minosis.hibernate.TContact -> t_contact
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration doConfigure
     
    INFO: Configured SessionFactory: null
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration secondPassCompile
     
    INFO: processing one-to-many association mappings
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration secondPassCompile
     
    INFO: processing one-to-one association property references
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration secondPassCompile
     
    INFO: processing foreign key constraints
     
    12 oct. 2005 11:00:25 net.sf.hibernate.dialect.Dialect <init>
     
    INFO: Using dialect: net.sf.hibernate.dialect.SQLServerDialect
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: Use outer join fetching: true
     
    12 oct. 2005 11:00:25 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
     
    INFO: Using Hibernate built-in connection pool (not for production use!)
     
    12 oct. 2005 11:00:25 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
     
    INFO: Hibernate connection pool size: 20
     
    12 oct. 2005 11:00:25 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
     
    INFO: using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://192.168.200.39:1433/TestPck
     
    12 oct. 2005 11:00:25 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
     
    INFO: connection properties: {user=Pierrick, password=password}
     
    12 oct. 2005 11:00:25 net.sf.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
     
    INFO: Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
     
    12 oct. 2005 11:00:25 net.sf.hibernate.util.NamingHelper getInitialContext
     
    INFO: JNDI InitialContext properties:{}
     
    12 oct. 2005 11:00:25 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
     
    INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
     
    12 oct. 2005 11:00:25 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
     
    INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: Use scrollable result sets: true
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: Use JDBC3 getGeneratedKeys(): true
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: Optimize cache for minimal puts: false
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: Query language substitutions: {}
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.SettingsFactory buildSettings
     
    INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
     
    12 oct. 2005 11:00:25 net.sf.hibernate.cfg.Configuration configureCaches
     
    INFO: instantiating and configuring caches
     
    12 oct. 2005 11:00:25 net.sf.hibernate.impl.SessionFactoryImpl <init>
     
    INFO: building session factory
     
    12 oct. 2005 11:00:26 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
     
    INFO: Not binding factory to JNDI, no JNDI name configured
     
    12 oct. 2005 11:00:26 net.sf.hibernate.transaction.JTATransaction begin
     
    GRAVE: Could not find UserTransaction in JNDI
     
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
     
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
     
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
     
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
     
    at javax.naming.InitialContext.lookup(Unknown Source)
     
    at net.sf.hibernate.transaction.JTATransaction.begin(JTATransaction.java:133)
     
    at net.sf.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:58)
     
    at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2231)
     
    at Test.main(Test.java:12)
     
    Exception in thread "main" net.sf.hibernate.TransactionException: Could not find UserTransaction in JNDI: 
     
    at net.sf.hibernate.transaction.JTATransaction.begin(JTATransaction.java:137)
     
    at net.sf.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:58)
     
    at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2231)
     
    at Test.main(Test.java:12)
     
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
     
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
     
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
     
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
     
    at javax.naming.InitialContext.lookup(Unknown Source)
     
    at net.sf.hibernate.transaction.JTATransaction.begin(JTATransaction.java:133)
     
    ... 3 more
    [ Modéré par SEMPERE Benjamin ]
    Ajout des balises code
    Les Règles du Forum

  2. #2
    Pck
    Pck est déconnecté
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 3
    Points : 1
    Points
    1
    Par défaut
    Rebonjour,

    J'ai oublie de preciser que je suis

    1) sous windows XP
    2) Eclipse 3.1
    3) TOMCAT 5.0.28
    4) et le plugin TOMCAT sous eclipse est com.sysdeo.eclipse.tomcat_3.1.0

    j'espere que je n'ai rien oublie d'autres

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    Bonjour Pck,

    Dommage qu'il n'y ait pas encore de réponse à ton post parce que j'ai suivi la même démarche que toi et je suis confronté au même problème.

    Le problème vient peut-être du fait que Tomcat n'est pas véritablement un serveur d'applications mais un serveur Web.
    Peut-être est-on obligé de rajouter un serveur d'applications de type Jonas ou Jboss?

    A suivre...

  4. #4
    Candidat au Club
    Inscrit en
    Octobre 2005
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 2
    Points : 2
    Points
    2
    Par défaut salut
    Je crois qu'il s'agit de la configuration du serveur d'appli, les paramétres par défaut du service JNDI sont mal renseignés. le service JNDI sert a localiser une ressource grace a un nom commun que tu vas utilisé dans ton programme et qui correspondra a cette ressource (une classe par exemple)

    mais tu peus passer ces paramétres directement dans ton code source.
    J'ai vu des forum a ce sujet, fait une rcherche dans google avec ce message d'erreur

    regarde dans la doc de ton serveur d'appli

    javax.naming.NoInitialContextException:Need to specify class name in environment or system property, or as an appletparameter, or in an application resource file: java.naming.factory.initial

    je ne peux pas t'aider plus je suis un newbies en matiére d'EJB

  5. #5
    Pck
    Pck est déconnecté
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 3
    Points : 1
    Points
    1
    Par défaut


    Super sur tes conseils j'ai recherche dans Google et ca av mieux .. ca marche .. c'est effectivement un pb de config du serveur JNDI sous Tomcat .... maintenant c'est regle .....

    En fait en passant par l'interface graphique de l'administration tomcat ca tout formate nickel le server.xml ainsi que les fichiers de contexte applicatif avec leur resspurcelink qui vont bien ...

    Merci

Discussions similaires

  1. [Tomcat 7 / Eclipse Juno] Tomcat ne veut plus démarrer
    Par Harmonic dans le forum Eclipse Java
    Réponses: 27
    Dernier message: 28/12/2012, 22h13
  2. Réponses: 8
    Dernier message: 08/01/2009, 10h19
  3. [Tomcat]Quand je démarre tomcat sous Eclipse
    Par Bignon dans le forum Eclipse Java
    Réponses: 4
    Dernier message: 29/06/2007, 14h46
  4. [Tomcat]pb lancement de tomcat depuis eclipse
    Par sebos63 dans le forum Eclipse Java
    Réponses: 11
    Dernier message: 02/11/2006, 23h36
  5. [Tomcat]Appli dev sous TOMCAT 5.5 --> revenir à TOMCAT 4.
    Par danyboy85 dans le forum Tomcat et TomEE
    Réponses: 5
    Dernier message: 11/01/2006, 15h07

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