Gwt RPC Fails with no message - oracle

I realize a Gwt, SmartGWT project.
I use mostly the datasources of SmartGWT.
But I have to run a special query on a remote database, I use rpc for this.
On my pc in local mode RPC operates. I also made one .war file in order to do a deployment test in local mode, that works too.
The problem is when deploying to the remote server, the RPC request does not work anymore (status code 404 (Stacktrace: Unknow as)). I do not think this is a problem of servlet mapping but possible.
The remote server is in Asia, the database is in Prague ldap server is in Asia.
This should produce this:
My client sends the RPC request to the server in asia.
The server in asia do a connection and a "select" to an Oracle database in Prague.
The select triggers a PL-SQL code that makes a connection to an ldap server to obtain data and populates a temporary table that returns the SQL query
The data is sent to the server that is in asia.
The server in asia returns the response to me
I'm in europe.
The fact that it works in local mode (you do not need to go to asia) make me think that this is not my code that is problematic.
I think that's the way that the data take.
But how to check?

Related

In a Web API call, if the server's reply didn't get to the client, will the server know?

A client, such as a C# program, invokes a server via its web API. The server process that is invoked does some database changes, then returns some data to the client, and the web API call finishes.
Suppose the response fails on its way to the client - for example the client dies and therefore the response can't be transmitted to the client.
In this case, will the server process get an exception from the operating system, so that it can rollback the database changes, or will the server happpily assume that the client has received the response, and commit the database changes?
The reason I am asking this, is that I don't want the server's database to be in a state that believes that the client has got the response, but the client hasn't. This will result in lost of sync between the client devices and the server.

Replicate DB Connectivity Issue in Automated Junit Test Cases

I am working on a service, where if there is any issue in the application, the request gets quarantined and can be reprocessed manually again after fixing the issue. If any network issue, such quarantined requests can be just processed again without any fix.
Now, I am working on a fix where the application failed to get DB Connectivity with MariaDB and got quarantined. As part of the quarantine, there are some meta data should be populated. One of the metadata is wrong and I have fixed to populate correct data.
I need to come up with JUnit test cases to automatically test this scenario. When I tested in my local, I brought down my local instance of the MariaDB and tested the same and my fix was working fine. Now I need to push this fix to stage environment, where automated test cases should run successfully. In my case, for this fix, I need to replicate the DB connectivity Issue scenario to test my issue fix.
The application/service that I work - it is not a direct http/https call. I post a message to a Kafka stream and the service picks up from the stream. So I need help in writing test case, where the DB connectivity issue should happen in the asynchronous service and gets quarantined. Is this possible?
Error:
"exception": "org.springframework.jdbc.CannotGetJdbcConnectionException",
"message": "Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Socket fail to connect to host

Server to server transfer using AJAX

This questions was asked during one of the interview. How to transfer data from one server to another using AJAX? Is it really possible?
AJAX is generally used on the client side, not usually the server side.
It sends requests to a server.
You probably need to provide more information about what you are trying to achieve to get a decent answer.
If you are wanting to transfer data from a "client" to a server then you could send the data in a variety of ways - especially with AJAX. Just how depends on what data type and size. Requests from a client to server (HTTP) can include POST data, which can carry your data to the server.
If you are using AJAX on a client and wanting to use it to transfer data from one remote server to another then you could get AJAX on your client to call a script on the server that would instigate the transfer from the server to another server in some way. (such as FTP or SCP maybe - or even using a server to server HTTP POST)
If you can be a little more specific about what you need to do then I will try and give you a better answer.

HTTP GET requests work but POST requests do not

Our Spring application is running on several different servers. For one of those servers POST requests do not seem to be working. All site functionality that uses GET requests works completely fine; however, as soon as I hit something that uses a POST request (ex. form submit) the site just hangs permanently. The server won't give any response. We can see the requests in Tomcat Manager but they don't time out.
Has anyone ever seen this?
We have found the problem. Our DBA accidentally deleted the MySQL database files on that particular server (/sigh). In our Spring application we use GET requests for record retrieval and the records we were trying to retrieve must have been cached by MySQL. This made it seem as if GET requests were working. When trying to add new data to the database, which we use POST requests to do, Tomcat would wait for a response, which never came, from MySQL.
In my experience if you're getting a timeout error it's almost always due to not having correct ports open for your application. For example, go into your virtual machine's rules and insure port 8080, 8443 or 80, 443 are open for http and https traffic.
In google cloud platform: its under VPC networking -> firewall rules. Azure and AWS are similar.

Verifiying answers from application to web service and vice versa

Scenario:
My Application stands in connection to Web service (Master Server). Sometimes i make calls like login on application startup, where my application sents user credentials to the master server for validating.
So, how do i 1st validate that the answer is from my real server and not a fake local webserver with routed hosts file? And 2nd how do i parse this answer?
I always parsed like this (dummy code):
if($answerFromWebserver == "LOGIN_OK") {
doLogin();
}
Are there better, more safe solutions?
some of the security feature I see/use,
You can allow specific IPs to server, can setup firewall for this.
Setting up SSL/HTTPS will be great benefit to secure transport level.
You can send username/password encrypted with every message, so at server side authentication will took place each time. You can use SOAP header for this.
You can read huge article from ms here on securing services..

Resources