Bonjour à tous
j'ai crée un service web sous netbeans qui se connecte à une BD mysql mais je suis pas arrivé à le déployer, glassfish server 3 m'affiche le message suivantvoila le code su service
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException
Merci d'avance
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 /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package me.org; import com.mysql.jdbc.Statement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import java.util.*; /** * * @author mahmoud */ @WebService() public class SchoolByCountryWS { String url="jdbc:mysql://localhost/relation"; String login="root"; String pwd=""; ResultSet rs=null; Connection cn=null; Statement st=null; List<SchoolByCountryOutputRow> outputs=new ArrayList<SchoolByCountryOutputRow>(); /** * Web service operation */ @WebMethod(operationName = "SchoolByCountryWS") public List<SchoolByCountryOutputRow> SchoolByCountryWS(@WebParam(name = "Country") String Country) throws ClassNotFoundException, SQLException { try { Class.forName("com.mysql.jdbc.Driver"); cn=DriverManager.getConnection(url,login,pwd); st= (Statement) cn.createStatement(); String sql="SELECT * from school where country='"+Country+"';"; rs=st.executeQuery(sql); while(rs.next()){ // if (Dataa.School[i].getCountry().equals(Country)){ SchoolByCountryOutputRow row= new SchoolByCountryOutputRow(); // row.setSSN(SSN); row.setCode(rs.getString("code")); row.setTuitionFees(rs.getString("tuitionfees")); row.setReputation(rs.getString("reputation")); row.setAddress(rs.getString("adr")); row.setCountry(rs.getString("country")); row.setProb(rs.getString("prob")); //row.setCountry(Country); //int aux=Integer.parseInt(Data.School[i][2]); //float val=(aux-5000)/(25000-5000); //row.setRanking(String.valueOf(val)); outputs.add(row); } } catch (Exception e) { System.out.println("error: " + e.toString()); } return outputs; } }
Partager