Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Abhishekshri Shrivastava

Ranch Hand
+ Follow
since Jan 13, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhishekshri Shrivastava


I am creating a JDBC connection to MY SQL server Database. DBA has made it windows authenticated.
It's a web application and need to be deployed on a remote server.
I know windows authentication is good because of AD account creation / deletion stuff. We delete the AD account and SQL server account gets deleted.

But I am worried about JDBC connection. It's to be deployed on remote server.
In case of windows authentication either from jdbc or jtds I get error and solutions(on many blogs) say to add a dll in my lib path.

Please suggest me Pros and Cons of both. Which authentication is suggested when a remote db connection is expected(apps is to be deployed on another server)?

Abhishek Shrivastava
I have to execute a batchupdate for sybase in spring java. I am using NamedParameterJdbcTemplate for that.
I have to use a variable in SQL to check return value. e.g. SQL -->

above query works fine for single update but issue come in case of batchupdate. I see below error and it's expected in case of batchupdate for the query. I wanted to know what should be the approach to do such kind of operation for a batch update (how to use a variable).

BatchUpdateException: Error occurred while executing batch statement: The variable name '@r' has already been declared. Variable names must be unique within a query batch or stored procedure.
; nested exception is com.sybase.jdbc3.jdbc.SybBatchUpdateException: JZ0BE: BatchUpdateException: Error occurred while executing batch statement: The variable name '@r' has already been declared. Variable names must be unique within a query batch or stored procedure.
9 years ago
After a lot of Analysis we got that the issue was due to the difference in JVMs of Jboss server and Web service Jboss server. Both were at different location.

The issue could be resolved in two ways-->>

1. Remove proxy setting present in jboss startup config file


2. Add webservice server to non proxy hosts list for Jboss startup config file

I am happy it got resolved :-) Cheers.....!!!
9 years ago

William P O'Sullivan wrote:"A communication error occurred: "Operation timed out"

Talk to your network people. If you're going a VPN, that may also cause serious delays.


I asked network guys they are saying things are ok. We are able to telnet and pong the webservice server on the same port.

Is there any way such that we could increase the timed out interval in axis webservice connection?
9 years ago

I am using axis to call a web service. when I run it on local machine (local jboss server) it works fine.

But after deploying it on development server I see service unavailable error code 503. It gets timed out. I am able to telnet (using wsdl port ) from development server to the server where the web service is deployed.
somewhere I also studied that because of having a lot of response data the webservice call gets timed out and you get service not found.
I tried to attach the .txt , .log file but was unable to attach. I am really concerned about it; as it's running well on local server but not on development server.
Please suggest me the solution.

06:24:16,020 ERROR [STDERR] AxisFault
06:24:16,021 ERROR [STDERR] faultCode: {}HTTP
06:24:16,021 ERROR [STDERR] faultSubcode:
06:24:16,022 ERROR [STDERR] faultString: (503)Service Unavailable

06:24:16,022 ERROR [STDERR] faultActor:
06:24:16,023 ERROR [STDERR] faultNode:
06:24:16,023 ERROR [STDERR] faultDetail:
06:24:16,024 ERROR [STDERR] {}:return code: 503
06:24:16,024 ERROR [STDERR] <HTML><HEAD>
06:24:16,025 ERROR [STDERR] <TITLE>Network Error</TITLE>
06:24:16,025 ERROR [STDERR] </HEAD>
06:24:16,026 ERROR [STDERR] <BODY>
06:24:16,026 ERROR [STDERR] <FONT face="Helvetica">
06:24:16,026 ERROR [STDERR] <big><strong></strong></big><BR>
06:24:16,027 ERROR [STDERR] </FONT>
06:24:16,027 ERROR [STDERR] <blockquote>
06:24:16,028 ERROR [STDERR] <TABLE border=0 cellPadding=1 width="80%">
06:24:16,028 ERROR [STDERR] <TR><TD>
06:24:16,029 ERROR [STDERR] <FONT face="Helvetica">
06:24:16,030 ERROR [STDERR] <big>Network Error (tcp_error)</big>

06:24:16,030 ERROR [STDERR] <BR>
06:24:16,030 ERROR [STDERR] <BR>
06:24:16,031 ERROR [STDERR] </FONT>
06:24:16,031 ERROR [STDERR] </TD></TR>
06:24:16,032 ERROR [STDERR] <TR><TD>
06:24:16,032 ERROR [STDERR] <FONT face="Helvetica">
06:24:16,033 ERROR [STDERR] A communication error occurred: "Operation timed out"
06:24:16,033 ERROR [STDERR] </FONT>
06:24:16,034 ERROR [STDERR] </TD></TR>
06:24:16,033 ERROR [STDERR] </FONT>
06:24:16,034 ERROR [STDERR] </TD></TR>
06:24:16,034 ERROR [STDERR] <TR><TD>
06:24:16,035 ERROR [STDERR] <FONT face="Helvetica">
06:24:16,035 ERROR [STDERR] The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
06:24:16,036 ERROR [STDERR] </FONT>
06:24:16,036 ERROR [STDERR] </TD></TR>
06:24:16,037 ERROR [STDERR] <TR><TD>
06:24:16,037 ERROR [STDERR] <FONT face="Helvetica" SIZE=2>
06:24:16,038 ERROR [STDERR] <BR>
06:24:16,038 ERROR [STDERR] For assistance, contact the Helpdesk.
06:24:16,039 ERROR [STDERR] </FONT>
06:24:16,039 ERROR [STDERR] </TD></TR>
06:24:16,040 ERROR [STDERR] </TABLE>
06:24:16,040 ERROR [STDERR] </blockquote>
06:24:16,041 ERROR [STDERR] </FONT>
06:24:16,041 ERROR [STDERR] </BODY></HTML>
06:24:16,042 ERROR [STDERR]
06:24:16,042 ERROR [STDERR] {}HttpErrorCode:503
06:24:16,043 ERROR [STDERR]
06:24:16,043 ERROR [STDERR] (503)Service Unavailable
06:24:16,044 ERROR [STDERR] at org.apache.axis.transport.http.HTTPSender.readFromSocket(
06:24:16,045 ERROR [STDERR] at org.apache.axis.transport.http.HTTPSender.invoke(
06:24:16,045 ERROR [STDERR] at org.apache.axis.strategies.InvocationStrategy.visit(
06:24:16,046 ERROR [STDERR] at org.apache.axis.SimpleChain.doVisiting(
06:24:16,046 ERROR [STDERR] at org.apache.axis.SimpleChain.invoke(
06:24:16,047 ERROR [STDERR] at org.apache.axis.client.AxisClient.invoke(
06:24:16,047 ERROR [STDERR] at org.apache.axis.client.Call.invokeEngine(
06:24:16,048 ERROR [STDERR] at org.apache.axis.client.Call.invoke(
06:24:16,048 ERROR [STDERR] at org.apache.axis.client.Call.invoke(
06:24:16,049 ERROR [STDERR] at org.apache.axis.client.Call.invoke(
06:24:16,049 ERROR [STDERR] at org.apache.axis.client.Call.invoke(
06:24:16,050 ERROR [STDERR] at com.peregrine.webservice.IncidentManagement_BindingStub.retrieveIncidentList(
06:24:16,050 ERROR [STDERR] at
06:24:16,051 ERROR [STDERR] at
06:24:16,051 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06:24:16,052 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(
06:24:16,052 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
06:24:16,053 ERROR [STDERR] at java.lang.reflect.Method.invoke(
06:24:16,053 ERROR [STDERR] at
06:24:16,054 ERROR [STDERR] at
06:24:16,055 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(
06:24:16,055 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(
06:24:16,056 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(
06:24:16,056 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(
06:24:16,057 ERROR [STDERR] at org.springframework.web.servlet.DispatcherServlet.doDispatch(
06:24:16,057 ERROR [STDERR] at org.springframework.web.servlet.DispatcherServlet.doService(
06:24:16,058 ERROR [STDERR] at org.springframework.web.servlet.FrameworkServlet.processRequest(
06:24:16,058 ERROR [STDERR] at org.springframework.web.servlet.FrameworkServlet.doGet(
06:24:16,059 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(
06:24:16,059 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(
06:24:16,060 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
06:24:16,060 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(
06:24:16,061 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(
06:24:16,061 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(
06:24:16,062 ERROR [STDERR] at
06:24:16,063 ERROR [STDERR] at
06:24:16,063 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(
06:24:16,064 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(
06:24:16,064 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(
06:24:16,065 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(
06:24:16,065 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(
06:24:16,066 ERROR [STDERR] at org.apache.coyote.ajp.AjpProcessor.process(
06:24:16,066 ERROR [STDERR] at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(

Abhishek Shrivastava
9 years ago

Martin Vajsar wrote:Would this page be of any help? (I don't have any experience in the area, this just came out first from my search.)

I tried by changing connection properties in url but it didn't work.

yes.. if I make encrypt=true; then get something different eror here as

Servlet.service() for servlet spring threw exception: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: class configured for TrustManagerFactory:$PKIXFactory not a TrustManagerFactory.
at [:]

even i tried by chnaging jre versions (as got somewhere that jdbc 4 ; jre 1.6.0_29 / 30 doesn't work properly for MS SQL connections.
even that didn't work.

The starnge thing is that --> if I make a jdbc connection in java console apps it works fine but doesn't work in a web application.

Can you check the value you are getting from select query. Try to print the value of dt1 and check what value you are getting here.Do also check the format.
Your code should work.

even you can also compare the dates in following way:-->


I am creating my webservice client using following:

java -Dhttp.proxyHost=webproxy -Dhttp.proxyPort=8080 "-Dhttp.nonProxyHosts=<hosts>" -cp "%JAVA_HOME%\lib\tools.jar" -p <package> -d <path to wsdl generated classes> -keep -s <java code path> <wsdl location>

Using my GeneratedClientt_Service I am sending my request. I get a response but my connection doesn't get closed at the server.

on the server the max connection limit is 2. After 2nd connection request At server I see:-->
Undisplayed terminal message:Logon attempts exceeded maximum on device: , at: 05/04/12 08:33:32 15246( 16043) 05/04/2012 01:33:32 RTE I Undisplayed terminal message:Login failed. Maximum active logins for this user exceeded. 15246( 16043) 05/04/2012 01:33:32 RTE I Thread termination cleanup complete 15246( 16181) 05/04/2012 01:36:06 RTE I Using "utalloc" memory manager 15246( 16181)

while I see "404 authentication error" on the client. As per now I am using a console java apps to call the service.

I am using : jdk 1.6

Please suggest me the way to close the connection at my end through code. I studied that just for persistance the connection is kept alive. But It's creating an issue for me.

9 years ago

I am working on a web spring application. I have a databasex.xml file. I am trying to connect to a MSSQL SEVER 2008. I am getting following error:-->

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: class configured for SSLContext: not a SSLContext.

I am using
1. sqljdbc4.jar
2. JRE 1.6.0_31
3. JBOSS 6.1

The DB source bean as following:

I have also checked the /jre/lib/security configuration. even jsse.jar is in my buildpath.It's fine.
Please suggest me the solution.
Congratulations......!!! :-)
10 years ago

Can somebody help me to understand that is "public static void main(String[] args)" be inherited or not??
surely we can inherit a static method. main() is also a static method. so it should be inherited. How does JMV works for main() execution.

10 years ago
Please tell me about the implementation of "Abstract Interfaces".
Sun has already given a number of interfaces which are abstract.
It's also frequently used in CORBA.
10 years ago

Shashank Ag wrote:In simple terms HttpClient API is made using commons-logging and commons-codec api.
So, its dependent upon it and you need to have these in classpath while using HttpClient.

I am not attaching download links as you should be able to google it. Use codec 1.4 and logging 1.1 version.

I don't get any exception after adding thos jar files. but the thing is that how to proceed after setting paramater values as:
client.getParams().setParameter("login", "xyz");
client.getParams().setParameter("password", "xyz");
and then is it required to load the page or tell me how i will proceed to the downloadble link on welcome page after successfull login to the webpage.

and i had one more doubts reltaed to jsp and servlet I think you can also help me on the topic. please follow the link below:

Shashank Ag wrote:Well will need to use commons-logging.jar too in your class path.

Also you may need commons-codec*.jar, use it if your program gives error.

How "commons-logging.jar " is used here
and what's the need of using "commons-codec*.jar"
please share me the link from which i can get all these jar
I am using jdk1.6