Précédent   Forum des professionnels en informatique > Java > Serveurs, conteneurs, et Java EE > JBoss
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
Vieux 11/02/2008, 10h49   #1
Futur Membre du Club
 
Inscription : décembre 2007
Messages : 92
Détails du profil
Informations forums :
Inscription : décembre 2007
Messages : 92
Points : 16
Points : 16
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 :
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 :
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 :
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 :
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 :
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

Dernière modification par Dasson ; 11/02/2008 à 12h50.
Dasson est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/02/2008, 16h36   #2
Modérateur
 
Inscription : août 2006
Messages : 2 766
Détails du profil
Informations forums :
Inscription : août 2006
Messages : 2 766
Points : 2 843
Points : 2 843
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.
fr1man est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/02/2008, 16h48   #3
Futur Membre du Club
 
Inscription : décembre 2007
Messages : 92
Détails du profil
Informations forums :
Inscription : décembre 2007
Messages : 92
Points : 16
Points : 16
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
Dasson est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/02/2008, 16h54   #4
Futur Membre du Club
 
Inscription : décembre 2007
Messages : 92
Détails du profil
Informations forums :
Inscription : décembre 2007
Messages : 92
Points : 16
Points : 16
Ha c'est bon j'ai trouvé, j'ai modifié mon fichier properties comme ceci, et maintenant j'arrive à me connecter ^^
Code :
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.
Dasson est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/02/2008, 19h28   #5
Futur Membre du Club
 
Inscription : octobre 2005
Messages : 43
Détails du profil
Informations personnelles :
Âge : 26

Informations forums :
Inscription : octobre 2005
Messages : 43
Points : 18
Points : 18
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
wariom est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/11/2008, 10h37   #6
Candidat au titre de Membre du Club
 
Christophe Suzzoni
Inscription : mai 2008
Messages : 37
Détails du profil
Informations personnelles :
Nom : Christophe Suzzoni
Âge : 24
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations forums :
Inscription : mai 2008
Messages : 37
Points : 11
Points : 11
Par défaut Fichier properties

J'aimerais juste savoir à quel endroit tu dépose le fichier properties ?

Merci.
suzchr est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +1. Il est actuellement 17h42.


 
 
 
 
Partenaires

Hébergement Web