Bonjour,
j'ai un petit soucie avec les DataSources.
j'utilise le serveur d'appli JOnAS 4 et struts 1.2.7.
voici la declaration de mon DataSource :
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 <data-sources> <data-source type="org.apache.commons.dbcp.BasicDataSource" key="UpdateDataSource"> <set-property property="driverClassName" value="org.mysql.jdbc.Driver"/> <set-property property="url" value="jdbc:mysql://xxxxx/bd1"/> <set-property property="username" value=""/> <set-property property="password" value=""/> <set-property property="maxActive" value="10"/> <set-property property="maxWait" value="5000"/> <set-property property="defaultAutoCommit" value="true"/> <set-property property="defaultReadOnly" value="false"/> </data-source> <data-source type="org.apache.commons.dbcp.BasicDataSource" key="SelectDataSource"> <set-property property="driverClassName" value="org.mysql.jdbc.Driver"/> <set-property property="url" value="jdbc:mysql://xxxxx/bd2"/> <set-property property="username" value=""/> <set-property property="password" value=""/> <set-property property="maxActive" value="10"/> <set-property property="maxWait" value="5000"/> <set-property property="defaultAutoCommit" value="false"/> <set-property property="defaultReadOnly" value="true"/> </data-source> </data-sources>
Quand je lance le serveur j'ai l'erreur suivante :
merci d'avance pour votre aide
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 org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver' at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:1134) at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:808) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1133) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.objectweb.jonas.web.catalina55.JOnASStandardContext.start(JOnASStandardContext.java:255) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:122) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:144) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:738) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.doRegisterWar(CatalinaJWebContainerServiceImpl.java:570) at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWar(AbsJWebContainerServiceImpl.java:969) at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWarMBean(AbsJWebContainerServiceImpl.java:1053) at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.registerWarMBean(CatalinaJWebContainerServiceImpl.java:1156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.objectweb.jonas.web.wrapper.catalina55.CatalinaJWebContainerServiceWrapper.invoke(CatalinaJWebContainerServiceWrapper.java:158) at org.objectweb.jonas.web.wrapper.catalina55.CatalinaJWebContainerServiceWrapper.registerWarMBean(CatalinaJWebContainerServiceWrapper.java:269) at org.objectweb.jonas.server.J2EEServer.deployWar(J2EEServer.java:534) at org.objectweb.jonas.server.J2EEServerMBean.deployWar(J2EEServerMBean.java:166) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:455) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410) at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) at sun.rmi.transport.Transport$1.run(Transport.java:153) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.ClassNotFoundException: org.mysql.jdbc.Driver at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209) at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420) ... 60 more 2010-04-07 13:24:14,074 : ApplicationContext.log : Marking servlet action as unavailable 2010-04-07 13:24:14,074 : StandardContext.loadOnStartup : Servlet /Dimtonic threw load() exception javax.servlet.UnavailableException: Initializing application data source SelectDataSource at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:812) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1133) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.objectweb.jonas.web.catalina55.JOnASStandardContext.start(JOnASStandardContext.java:255) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:122) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:144) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:738) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.doRegisterWar(CatalinaJWebContainerServiceImpl.java:570) at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWar(AbsJWebContainerServiceImpl.java:969) at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWarMBean(AbsJWebContainerServiceImpl.java:1053) at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.registerWarMBean(CatalinaJWebContainerServiceImpl.java:1156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.objectweb.jonas.web.wrapper.catalina55.CatalinaJWebContainerServiceWrapper.invoke(CatalinaJWebContainerServiceWrapper.java:158) at org.objectweb.jonas.web.wrapper.catalina55.CatalinaJWebContainerServiceWrapper.registerWarMBean(CatalinaJWebContainerServiceWrapper.java:269) at org.objectweb.jonas.server.J2EEServer.deployWar(J2EEServer.java:534) at org.objectweb.jonas.server.J2EEServerMBean.deployWar(J2EEServerMBean.java:166) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:455) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410) at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) at sun.rmi.transport.Transport$1.run(Transport.java:153) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) at java.lang.Thread.run(Thread.java:595)
Partager