Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Abhishekshri Shrivastava

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

Recent posts by Abhishekshri Shrivastava

Hi,

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)?

Thanks,
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.
7 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

Or

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

I am happy it got resolved :-) Cheers.....!!!
7 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.

WP


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?
8 years ago
Hi,

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.

at java.lang.Thread.run(Thread.java:619)
06:24:16,020 ERROR [STDERR] AxisFault
06:24:16,021 ERROR [STDERR] faultCode: {http://xml.apache.org/axis/}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] {http://xml.apache.org/axis/}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(HTTPSender.java:744)
06:24:16,045 ERROR [STDERR] at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
06:24:16,045 ERROR [STDERR] at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
06:24:16,046 ERROR [STDERR] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
06:24:16,046 ERROR [STDERR] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
06:24:16,047 ERROR [STDERR] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
06:24:16,047 ERROR [STDERR] at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
06:24:16,048 ERROR [STDERR] at org.apache.axis.client.Call.invoke(Call.java:2767)
06:24:16,048 ERROR [STDERR] at org.apache.axis.client.Call.invoke(Call.java:2443)
06:24:16,049 ERROR [STDERR] at org.apache.axis.client.Call.invoke(Call.java:2366)
06:24:16,049 ERROR [STDERR] at org.apache.axis.client.Call.invoke(Call.java:1812)
06:24:16,050 ERROR [STDERR] at com.peregrine.webservice.IncidentManagement_BindingStub.retrieveIncidentList(IncidentManagement_BindingStub.java:652)
06:24:16,050 ERROR [STDERR] at com.bfm.app.identity.webservice.sm9request.GetSM9Tickets.SM9TicketInfo(GetSM9Tickets.java:94)
06:24:16,051 ERROR [STDERR] at com.bfm.app.identity.controller.IndetityViewController.getUserTicketInfo(IndetityViewController.java:93)
06:24:16,051 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06:24:16,052 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
06:24:16,052 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
06:24:16,053 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
06:24:16,053 ERROR [STDERR] at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
06:24:16,054 ERROR [STDERR] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
06:24:16,055 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
06:24:16,055 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
06:24:16,056 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
06:24:16,056 ERROR [STDERR] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
06:24:16,057 ERROR [STDERR] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
06:24:16,057 ERROR [STDERR] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
06:24:16,058 ERROR [STDERR] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
06:24:16,058 ERROR [STDERR] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
06:24:16,059 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
06:24:16,059 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
06:24:16,060 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
06:24:16,060 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
06:24:16,061 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
06:24:16,061 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
06:24:16,062 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
06:24:16,063 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
06:24:16,063 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
06:24:16,064 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
06:24:16,064 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
06:24:16,065 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
06:24:16,065 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
06:24:16,066 ERROR [STDERR] at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504)
06:24:16,066 ERROR [STDERR] at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437)

Thanks,
Abhishek Shrivastava
8 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: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: class configured for TrustManagerFactory: com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl$PKIXFactory not a TrustManagerFactory.
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1509) [:]



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.
pourush,

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:-->

Hi,

I am creating my webservice client using following:

java -Dhttp.proxyHost=webproxy -Dhttp.proxyPort=8080 "-Dhttp.nonProxyHosts=<hosts>" -cp "%JAVA_HOME%\lib\tools.jar" com.sun.tools.internal.ws.WsImport -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.

http://docs.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html

Thanks,
Abhishek
8 years ago
Hi,

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: com.sun.net.ssl.internal.ssl.SSLContextImpl 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......!!! :-)
8 years ago
Hi,

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.

Thanks
8 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.
9 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:
https://coderanch.com/t/523495/JSP/java/setting-HTML-element-value-JSP

https://coderanch.com/t/523497/Servlets/java/set-JSP-HTML-element-values

https://coderanch.com/t/523492/JSP/java/Getting-name-JSP-servlet

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