GeeCON Prague 2014*
The moose likes Web Services and the fly likes Rampart Axis2 passwordCallback method  - Urgent Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Rampart Axis2 passwordCallback method  - Urgent Please" Watch "Rampart Axis2 passwordCallback method  - Urgent Please" New topic
Author

Rampart Axis2 passwordCallback method - Urgent Please

UdayK Kumar
Greenhorn

Joined: Aug 05, 2009
Posts: 26
Hi friends,

I am using axis2 1.4.1 and rampart 1.4 for web service security. For authentication I am using handlers. when I place database connection code in handler method I got the below exception. If I didn't put database connection it works fine.


my serverside handler code is


public PWCBHandler(){
System.out.println("Constructor of Handler class");
Connection connection = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection(URL, UID, PWD);
stmt = connection.createStatement();
rs = stmt.executeQuery("SELECT * FROM WEB_SERVICES_USERS");
Map users = new HashMap();
while(rs.next()){
String userId = rs.getString(1);
String encPwd = rs.getString(2);
users.put(userId, encPwd);
}
rs.close();
stmt.close();
connection.close();
System.out.println("No of Users = " + users.size());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e1) {
e1.printStackTrace();
}
}




Exception I am getting is:




[java] id = bob
[java] Exception in thread "main" org.apache.axis2.AxisFault: Read timed out
[java] at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
[java] at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
[java] at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
[java] at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommon
s(CommonsHTTPTransportSender.java:371)
[java] at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTran
sportSender.java:209)
[java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
[java] at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.jav
a:401)
[java] at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperat
ion.java:228)
[java] at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
[java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
[java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
[java] at com.tm.webservices.client.Client.main(Unknown Source)
[java] Caused by: java.net.SocketTimeoutException: Read timed out
[java] at java.net.SocketInputStream.socketRead0(Native Method)
[java] at java.net.SocketInputStream.read(SocketInputStream.java:129)
[java] at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
[java] at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
[java] at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
[java] at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
[java] at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
[java] at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAd
apter.readLine(MultiThreadedHttpConnectionManager.java:1413)
[java] at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1
973)
[java] at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:173
5)
[java] at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
[java] at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirec
tor.java:398)
[java] at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector
.java:171)
[java] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
[java] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
[java] at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSend
er.java:542)
[java] at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
[java] ... 10 more
[java] Java Result: 1


Please help me to resolve the above error.

uday
 
GeeCON Prague 2014
 
subject: Rampart Axis2 passwordCallback method - Urgent Please