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

Java Discussion :

[Classique] ORA-12519, TNS:no appropriate service handler found


Sujet :

Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2011
    Messages
    84
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2011
    Messages : 84
    Par défaut [Classique] ORA-12519, TNS:no appropriate service handler found
    Bonjour tous le monde j'ai réalisé une application Java/Swing avec Hibernate et spring ,mais lorsque je lance l'application j'ai cette erreur
    cette application gére les notes des etudiant (les modules les matieres ...)
    mais lorsque je saisie les données à un moment il y a cette jolie erreur qui s'affiche


    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
     
    double-click
    Exception in thread "AWT-EventQueue-0" org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
    	at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:601)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy30.doGetListMatiereFromModule(Unknown Source)
    	at ma.ismp.gpedagogique.application.MatiereServiceFactory.getListMatiere(MatiereServiceFactory.java:63)
    	at ma.ismp.gpedagogique.presentation.ModelNoteMa.<init>(ModelNoteMa.java:48)
    	at ma.ismp.gpedagogique.presentation.FicheNoteMats.<init>(FicheNoteMats.java:64)
    	at ma.ismp.gpedagogique.presentation.FicheNoteMo$Mouselistner.mouseClicked(FicheNoteMo.java:215)
    	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    	at java.awt.Component.processMouseEvent(Component.java:6266)
    	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    	at java.awt.Component.processEvent(Component.java:6028)
    	at java.awt.Container.processEvent(Container.java:2041)
    	at java.awt.Component.dispatchEventImpl(Component.java:4630)
    	at java.awt.Container.dispatchEventImpl(Container.java:2099)
    	at java.awt.Component.dispatchEvent(Component.java:4460)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    	at java.awt.Container.dispatchEventImpl(Container.java:2085)
    	at java.awt.Window.dispatchEventImpl(Window.java:2475)
    	at java.awt.Component.dispatchEvent(Component.java:4460)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
    	at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:559)
    	... 31 more
    Caused by: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS:no appropriate service handler found
    The Connection descriptor used by the client was:
    localhost:1521:XE
     
    	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
    	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
    	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
    	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)
    	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
    	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    	at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
    apres un tour sur le net ,j'ai modifie le fichier init.ora le voici
    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
    ##############################################################################
    # Copyright (c) 1991, 2011, Oracle and/or its affiliates. All rights reserved. 
    ##############################################################################
     
    ###########################################
    # Cursors and Library Cache
    ###########################################
    open_cursors=300
     
    ###########################################
    # Database Identification
    ###########################################
    db_name=XE
     
    ###########################################
    # File Configuration
    ###########################################
    control_files=("C:\oracleXE11g\app\oracle\oradata\XE\control.dbf")
    
    ###############################diagnostic_dest=############
    # Job Queues
    ###########################################
    job_queue_processes=7500
     
    ###########################################
    # Miscellaneous
    ###########################################
    compatible=11.2.0.0.0
    diagnostic_dest=C:\oracleXE11g\app\oracle\.
    memory_target=1024M
    
    
    ###########################################
    # Processes and Sessions
    ###########################################
    sessions=8500
     
     
    ###########################################
    # Security and Auditing
    ###########################################
    audit_file_dest=C:\oracleXE11g\app\oracle\admin\XE\adump
    remote_login_passwordfile=EXCLUSIVE
     
    ###########################################
    # Shared Server
    ###########################################
    dispatchers="(PROTOCOL=TCP) (SERVICE=XEXDB)"
    shared_servers=4 
    
     
    ###########################################
    # System Managed Undo and Rollback Segments
    ###########################################
    undo_management=AUTO
    undo_tablespace=UNDOTBS1
    
    ###########################################
    # Backup and Recovery
    ###########################################
    DB_RECOVERY_FILE_DEST_SIZE = 10G
    DB_RECOVERY_FILE_DEST=C:\oracleXE11g\app\oracle\fast_recovery_area
    est ce qu'il y a d'autres parametres à modifier ,ou bien cette erreur est inevitable !! . Merci d'avance

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    D'abord, faire tourner correctement ton serveur.
    Ensuite, quand tu arrive à t'y connecter avec le client oracle standard (sqldevelopper), tu n'a plus qu'à reprendre les paramètres du client dans sqldevelopper pour les mettre dans ton application.

  3. #3
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2011
    Messages
    84
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2011
    Messages : 84
    Par défaut
    D'abord, faire tourner correctement ton serveur.
    Merci d'abord pour votre réponse ,je précise que je travaille avec Oracle 11g XE
    ,lorsque je lance l'application ça marche je fais des CRUD sans probleme mais à un moment donnée cette erreur ce lance ,et je dois redemarrer l'application

    Ensuite, quand tu arrive à t'y connecter avec le client oracle standard (sqldevelopper), tu n'a plus qu'à reprendre les paramètres du client dans sqldevelopper pour les mettre dans ton application.
    j'aimerais bien avoir quelques explications (je suis débutant en Oracle )
    Merci : )

  4. #4
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par ensemien Voir le message
    Merci d'abord pour votre réponse ,je précise que je travaille avec Oracle 11g XE
    ,lorsque je lance l'application ça marche je fais des CRUD sans probleme mais à un moment donnée cette erreur ce lance ,et je dois redemarrer l'application
    Bizarre, vu que c'est une erreur de configuration, il n'est pas normal que ça marche "parfosi" Ou alors tu as mis plusieurs configurations pour différents services => regarde comment tu as confguré les autres.

    j'aimerais bien avoir quelques explications (je suis débutant en Oracle )
    Merci : )
    Le mieux dans ce cas, c'est de demander à ton administrateur Oracle quels sont les paramètres à utiliser.

    Le format de la configuration coté java, c'est

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     jdbc:oracle:thin:@[HOST][:PORT]:SID
    ou
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE
    ou encre, si tu aime te triturer les méninges (mais personnes n'utilise se format)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=<host>)(PORT=<port>))(CONNECT_DATA=(SERVICE_NAME=<service>)))

  5. #5
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2011
    Messages
    84
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2011
    Messages : 84
    Par défaut
    Merci ,voici la partie base de données de mon fichier Applicatiocontext.xml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
     
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    		<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
    		<property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
    		<property name="username" value="ispm" />
    		<property name="password" value="ispm" />
     
    </bean>
    et voici le fichier dans son integralite

    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:c="http://www.springframework.org/schema/c"
    	xmlns:cache="http://www.springframework.org/schema/cache"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xmlns:jms="http://www.springframework.org/schema/jms"
    	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    	xmlns:lang="http://www.springframework.org/schema/lang"
    	xmlns:mvc="http://www.springframework.org/schema/mvc"
    	xmlns:oxm="http://www.springframework.org/schema/oxm"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:repository="http://www.springframework.org/schema/data/repository"
    	xmlns:security="http://www.springframework.org/schema/security"
    	xmlns:task="http://www.springframework.org/schema/task"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
    		http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
    		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
    		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
    		http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd
    		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd
    		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
    		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
    		http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd
    		http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd
    		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.3.xsd
    		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd
    		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
     
     
     
     
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    		<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
    		<property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
    		<property name="username" value="ispm" />
    		<property name="password" value="ispm" />
     
    </bean>
     
     
     
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="annotatedClasses">
    			<list>
     
    		        <value>ma.ismp.gpedagogique.domain.model.Etudiant</value>
    		        <value>ma.ismp.gpedagogique.domain.model.Module</value>
    		        <value>ma.ismp.gpedagogique.domain.model.Matiere</value>
    		        <value>ma.ismp.gpedagogique.domain.model.Filiere</value>
    		         <value>ma.ismp.gpedagogique.domain.model.AttestationReussite</value>
     
    		   </list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				  <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
    				  <prop key="hibernate.show_sql">true</prop>
    			      <prop key="hibernate.hbm2ddl.auto">update</prop> 
    			      <!--  <prop key="hibernate.jdbc.batch_size">0</prop>   -->
    			</props>
    		</property>
    </bean>
     
     
     
    	<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>
    	<tx:annotation-driven transaction-manager="transactionManager"/>
     
     
    	<context:annotation-config />
            <context:component-scan base-package  = "ma.ismp.*" />
     
     
     
     
    </beans>
    je rappelle que ca marche au debut mais lorsque j'effectue plusieurs CRUD(Create Read Delete) ca donne cette erreur ,normalement j'ai utilisé Hibernate pour sa robustesse ,et pour éviter ce genre de problemes ,sincerement je ne sais pas c'est quoi le probleme.
    Merci pour tous conseil de votre part

  6. #6
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    bizarre ce message d'erreur, normalement ca veux dire que ta config est incorrecte. Donc tu ne devrais pas avoir la possibilité de réussir le moindre CRUD.

    Regarde aussi si tu n'a pas dépassé le nombre max de connexions autorisées par ta licence oracle. Quand tu as ce message, tu arrive toujours à te connecter à ton oracle avec son client sql?

Discussions similaires

  1. Réponses: 1
    Dernier message: 25/11/2009, 23h01
  2. Réponses: 2
    Dernier message: 06/04/2009, 09h16
  3. ORA-12519, TNS:no appropriate service handler found
    Par willoi dans le forum Administration
    Réponses: 16
    Dernier message: 04/09/2007, 13h40
  4. ORA-12162: TNS:net service name is incorrect
    Par gubule dans le forum Oracle
    Réponses: 15
    Dernier message: 11/07/2006, 18h04
  5. Réponses: 11
    Dernier message: 29/06/2005, 11h36

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