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

Wildfly/JBoss Java Discussion :

Connexion à une DB Oracle avec DataSource


Sujet :

Wildfly/JBoss Java

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2007
    Messages : 96
    Points : 39
    Points
    39
    Par défaut Connexion à une DB Oracle avec DataSource
    Bonjour,

    Je dois actuellement créer un projet en utilisant une DB Oracle avec des DataSources tout cela avec le serveur d'application JBOSS (version 4.2.2. GA).

    Dans le dossier de Jboss, j'ai donc créer un serveur default et j'ai rajouter dans le dossier deploy le oracle-ds.xml, et le driver ojdbc14.jar dans le dossier lib.

    Le fichier oracle-ds.xml est configuré comme ceci :
    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
    <datasources>
      <local-tx-datasource>
        <jndi-name>OracleDS</jndi-name>
        <connection-url>jdbc:oracle:thin:@192.168.0.112:1521:mysid</connection-url>
    	<!--
    		See on WIKI page below how to use Oracle's thin JDBC driver to connect with enterprise RAC.
    	 -->
    	<!--
    		Here are a couple of the possible OCI configurations.
    		For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
     
    	<connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
    		or
    	<connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
     
    		Clearly, its better to have TNS set up properly.
    	 -->
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>sysman</user-name>
        <password>xxx</password>
     
        <min-pool-size>5</min-pool-size>
        <max-pool-size>100</max-pool-size>
     
        <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
        <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
        <!-- Checks the Oracle error codes and messages for fatal errors -->
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
            <!-- sql to call when connection is created
            <new-connection-sql>some arbitrary sql</new-connection-sql>
            -->
     
            <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
            <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
            -->
     
          <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
          <metadata>
             <type-mapping>Oracle9i</type-mapping>
          </metadata>
      </local-tx-datasource>
     
    </datasources>
    Les données de la datasource se trouve dans un fichier properties dont voici le contenu :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    datasource.name=mysid
    datasource.schemaname=sysman
    datasource.userid=sysman
    datasource.password=xxx
    J'ai créer une classe pour rechercher les données du fichier properties avec les méthodes que 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
    public class ApplicationProperties {
     
    	// détermine le fichier de Configuration
    	private static PropertyResourceBundle properties = (PropertyResourceBundle)PropertyResourceBundle.getBundle("parlement.application");
    	// échantillonne les données
    	public static String datasourceJndiName = properties.getString("datasource.name");
    	public static String datasourceSchemaName =	properties.getString("datasource.schemaname");
    	public static String datasourceUserId = properties.getString("datasource.userid");
    	public static String datasourcePassword = properties.getString("datasource.password");
     
    	public static String getDatasourceJndiName() {
    		return datasourceJndiName;
    	}
    	public static String getDatasourceSchemaName() {
    		return datasourceSchemaName;
    	}
    	public static String getDatasourceUserId() {
    		return datasourceUserId;
    	}
    	public static String getDatasourcePassword() {
    		return datasourcePassword;
    	}
    }
    Maintenant le code java pour se connecter à la DB :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    public static DataSource getDataSource() {
    		try{
    			InitialContext context = new InitialContext();
    			System.out.println("context = "+context);
    			ds = (DataSource)context.lookup(ApplicationProperties.getDatasourceJndiName());
    			//recherche de l’objet DataSource dans l’annuaire JNDI
    		} 
    		catch (javax.naming.NamingException ne) {
    			System.out.println("erreur de nom : "+ ne);
    			ne.printStackTrace();
    		}
    		return ds;
    	}
    L'erreur est au niveau de la méthode lookup où j'obtiens ceci comme exception dans la console :
    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
    10:12:56,041 INFO  [STDOUT] erreur de nom : javax.naming.NameNotFoundException: mysid not bound
    10:12:56,041 ERROR [STDERR] javax.naming.NameNotFoundException: mysid not bound
    10:12:56,042 ERROR [STDERR] 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    10:12:56,042 ERROR [STDERR] 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    10:12:56,043 ERROR [STDERR] 	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    10:12:56,043 ERROR [STDERR] 	at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
    10:12:56,043 ERROR [STDERR] 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
    10:12:56,043 ERROR [STDERR] 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
    10:12:56,043 ERROR [STDERR] 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
    10:12:56,043 ERROR [STDERR] 	at parlement.connection.OracleConnexion.getDataSource(OracleConnexion.java:26)
    10:12:56,043 ERROR [STDERR] 	at parlement.connection.OracleConnexion.<clinit>(OracleConnexion.java:19)
    10:12:56,043 ERROR [STDERR] 	at parlement.connection.InitDB.init(InitDB.java:19)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4071)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4375)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
    10:12:56,043 ERROR [STDERR] 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
    10:12:56,043 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10:12:56,044 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10:12:56,044 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,044 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,044 ERROR [STDERR] 	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    10:12:56,044 ERROR [STDERR] 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    10:12:56,044 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,044 ERROR [STDERR] 	at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
    10:12:56,044 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10:12:56,044 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10:12:56,044 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,044 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,044 ERROR [STDERR] 	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    10:12:56,044 ERROR [STDERR] 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    10:12:56,044 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.web.WebModule.startModule(WebModule.java:83)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.web.WebModule.startService(WebModule.java:61)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    10:12:56,045 ERROR [STDERR] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    10:12:56,045 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,045 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,045 ERROR [STDERR] 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    10:12:56,045 ERROR [STDERR] 	at $Proxy0.start(Unknown Source)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.system.ServiceController.start(ServiceController.java:417)
    10:12:56,046 ERROR [STDERR] 	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    10:12:56,046 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,046 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    10:12:56,046 ERROR [STDERR] 	at $Proxy44.start(Unknown Source)
    10:12:56,046 ERROR [STDERR] 	at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
    10:12:56,046 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10:12:56,047 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10:12:56,047 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,047 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    10:12:56,047 ERROR [STDERR] 	at $Proxy45.start(Unknown Source)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    10:12:56,047 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    10:12:56,048 ERROR [STDERR] 	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    10:12:56,048 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,048 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    10:12:56,048 ERROR [STDERR] 	at $Proxy9.deploy(Unknown Source)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
    10:12:56,048 ERROR [STDERR] 	at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    10:12:56,049 ERROR [STDERR] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    10:12:56,049 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,049 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    10:12:56,049 ERROR [STDERR] 	at $Proxy0.start(Unknown Source)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.system.ServiceController.start(ServiceController.java:417)
    10:12:56,049 ERROR [STDERR] 	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    10:12:56,049 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,049 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    10:12:56,049 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    10:12:56,050 ERROR [STDERR] 	at $Proxy4.start(Unknown Source)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
    10:12:56,050 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10:12:56,050 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10:12:56,050 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10:12:56,050 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    10:12:56,050 ERROR [STDERR] 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    10:12:56,051 ERROR [STDERR] 	at $Proxy5.deploy(Unknown Source)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.Main.boot(Main.java:200)
    10:12:56,051 ERROR [STDERR] 	at org.jboss.Main$1.run(Main.java:508)
    10:12:56,051 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:619)
    Est ce que c'est une erreur dans le code ou dans la configuration du serveur ? J'ai déjà regarder les forums pour des problèmes similaires, mais ça ne m'a pas vraiment aider.

    Merci d'avance pour ceux qui m'aideront à régler ce problème

  2. #2
    Expert confirmé
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 274
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 274
    Points : 4 141
    Points
    4 141
    Par défaut
    Ton datasource comme il est déclaré dans ton fichier oracle-ds.xml s'appelle : OracleDS et pas mysid.
    Change le nom dans ton .properties.

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2007
    Messages : 96
    Points : 39
    Points
    39
    Par défaut
    Merci pour ta réponse mais dans mon fichier properties, datasource.name c'est le nom de ma DB en fait, donc je ne pense pas que ça soit.

    Mais j'ai quand même essayé et ça n'a rien changé, il me met encore une fois la même exception mais au lieu de mettre mysid, il me met OracleDS.

    Une autre solution ?

    Dasson

  4. #4
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2007
    Messages : 96
    Points : 39
    Points
    39
    Par défaut
    Ha c'est bon j'ai trouvé, j'ai modifié mon fichier properties comme ceci, et maintenant j'arrive à me connecter ^^
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    datasource.name=java:OracleDS
    datasource.schemaname=mysid
    datasource.userid=SYSMAN
    datasource.password=europe
    En fait tu avais raison fr1man au sujet du nom, il fallait juste rajouter java: devant, à partir de là j'avais une tentative de connexion, mais ça foirait à nouveau alors j'ai modifier le schemaname ou en fait ça correspond au nom de la DB.

    Je dormirai moins con ce soir ^^

    Merci bien de ton aide.

  5. #5
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    47
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations forums :
    Inscription : Octobre 2005
    Messages : 47
    Points : 46
    Points
    46
    Par défaut
    Bonjour,

    Pour poursuivre dans ce thème, même si la réponse a été donnée, j'ai une autre question :

    Est-ce vraiment sécurisé de stocker les propriétés de connexion (login, mdp) dans un fichier properties comme ci dessus?

    J'ai vu aussi que les serveur tels que Tomcat et companie permettaient de créer des pools de datasource. Les données sont stockées dans le fichier server.xml ci je ne me trompe?

    Si c'est bien ca, ce fichier est-il protégé?

    Mes questions peuvent paraître bête, mais j'ai du mal à cerner comment on peut sécuriser un accès à une base de données

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    39
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2008
    Messages : 39
    Points : 42
    Points
    42
    Par défaut Fichier properties
    J'aimerais juste savoir à quel endroit tu dépose le fichier properties ?

    Merci.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Probleme de connexion a une base oracle avec un connecteur ODBC
    Par benito16 dans le forum Connexions aux bases de données
    Réponses: 5
    Dernier message: 19/05/2011, 18h01
  2. Problème de connexion à une base oracle avec SQL PLUS en mode graphique
    Par Bayfall dans le forum Connexions aux bases de données
    Réponses: 0
    Dernier message: 24/01/2010, 17h34
  3. Connexion à une base Oracle distante avec C#
    Par scorpion06 dans le forum Accès aux données
    Réponses: 3
    Dernier message: 30/12/2007, 22h18
  4. Réponses: 4
    Dernier message: 02/01/2006, 16h58

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