Mike Thomson

Ranch Hand
+ Follow
since Nov 07, 2007
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Mike Thomson

Hi, I am trying to understand the below terminology as in my company I used to hear this term from infrastructure team a lot..

What is VIP (Virtual IP), BIG IP and WIP (Wide IP) and Internet IP ? I have goggled a lot, but got only little information and unable to understand.

In above question, there are lot of IPs I am not sure it it is used interchangeably.

For Example: consider I am having load balanced server (2 servers - Server A and Server B)

Server A will have the BASE IP address like our PC/Laptop..similarly for Server B..

How this VIP, WIP involved?

Hi,
In the below program, I am running the simple service at 162.96.24.142:2403
The client is connecting from 192.108.0.109:63432.

There should be 3 ports involoved.

1. ServerSocket (2403)
2. ClientSocket (63432)

3. ConnectionPort (Ephemeral port) at the server side 162.96.24.142 right? I want to display that port.

Once the serverSocket.accept(), new Socket object is bound to which port (some random - ephemeral port right?)
The server can communicate with the client over this new Socket (what is that port?) and continue to listen for client connection requests on the original ServerSocket (2403)






netstat from client machine


netstat from server machine


Not sure what it means -- perhaps we can get more context?



I have got it from https://docs.oracle.com/javase/tutorial/networking/sockets/definition.html

So as you told definitely at the server side new socket opened at random port for handling the client request and the actual port (in this case: 4242) where service is running is only for accepting the connection and hand it over it to random port (Ephemeral)

Because friend of mine told no ports at server side is opened, as client is opened the firewall only for 4242 (where service is running) and client won't be able to connect to that random port.
Thanks a lot for your quick reply, Henry.

So firewall will allow the ephemeral port associated with this rendezvous port (4242) even though those ports are not opened for the external world?
Is there a way to capture what are all the active ephemeral port associated with this rendezvous port 4242?.

Also, below quotes says "new socket object which is bound to same local port". I am not getting what is the meaning of same local port?

Note that The Java Tutorial says:

"When a connection is requested and successfully established, the accept method returns a new Socket object which is bound to the same local port and has it's remote address and remote port set to that of the client. The server can communicate with the client over this new Socket and continue to listen for client connection requests on the original ServerSocket."



Is this mean, the server indeed creates a new socket per client, but ALL these new sockets bind on same port on which Server is listening (port 4242 in this case)? or some other random port?
Because calling getLocalPort() on the newly created socket always returns 4242
Hi,

I have doubt in Socket programming.

1. We are running a service in a server in IP (ex: 190.165.1.103) and port (4242)

2. We don't want everyone to connect to our service. Those who want to connect to our service they need to provide their IP address and we will configured it to allow them in our firewall.

3. For Example: one of the client (IP: 167.158.25.100) has been allowed to consume our service at (190.165.1.103:4242)
SO this client is having access to our server's port 4242. because our firewall configured to allow connections to port 4242 only.


Based on the below, I have some doubts.

The server listens to the socket for a client to make a connection request . If everything goes well, the server accepts the connection.
Upon acceptance, the server gets a new socket bound to a different port.
It needs a new socket (consequently a different port number) so that it can continue to listen to the original socket for connection requests while serving the connected client.



4. Client connects to the server 190.165.1.103:4242 and server creates a new socket (example: 2478) and again starts to listen in port 4242 for other incoming client requests.

My question, how the client will able to connect to port 2478 (local port at server side), as it is allowed to connect only server port 4242?

I think somewhere I misunderstood the concept and I don't know how it will work?
Hi,
We have been provided with the WSDL file and we need to consume the web service call.

We are trying for the top-down approach. We are using IBM 8.0 - JAX-WS 2.1 - JDK 1.6 and we are trying to generate the client using the WSDL from RAD ("Generate Client" option).

It has generated a pile of files based on the WSDL and we are written standalone java client for testing.

We have got the http endpoint using the service class and invoking the required operations.

The issue here is we need to send some of header info in RqHeaders along with each operations.
We also have RqHeaders class generated thru RAD and set the reqiured values but there is no option to send it along with the required operations.
I have checked all the classes generated based on the WSDL and couldn't see any such set property.
In axis, we will use to send like

portType.httpEndPoint().cardVaildation(CardInfoRq, rqHeader)

But I don't have any such options. Any help or idea will be helpful
6 years ago
Hi all,

I am new to web services technologies though know here and there.
We have an internet application, where one of the functions needs to call the web service.

1. We have the WSDL in place.
2. We are using the soapUI Pro tool where it is using Axis2 Artifcats for wsdl2java and databinding as adb. it is generating 3 java files with the build.xml.
a. Fault.java
b. ServiceStub.java
c. ServiceCallbackHandler.java
3. We are creating a java project in Eclipse and having the 3 generated java files along with the build.xml. And compiling the 3 java files which required some of the external jar files from Axis2.
4. Then we are running the build.xml using the ANT, which generates thousands of class files (most of them are inner classes..may be due to adb databinding nature) and creates the jar file.
5. Now,we have written the client pgm to call the web service call.
6. We are able to call the web services call. THOUGH WE HAVE STILL GOT SOME ISSUES...

Issues:

1. Opening the 3 generated java files causing the IDE to crash due to the memory issue. I have tried opening it in Eclipse/RAP/MyEclipse and also assigned more memory option, but still opening these java files causing the memory issue (unhandled loop execution). We want to know why this memory issue..it should not cause any issue in real env...The reason to open this file, we want to configure the endpoint dynamically and need to add some code there.

2. We are successfully able to call the web service, but some times we are not able to get the Fault Message...it is just returing the Fault and not able to get the faultCode, description to get the actual error message and it is very diffcult to know what is the actual issue for our investigation. Fault message is coming for http, whereas it is not coming for https (SSL). we have the proper trustsotre/cert..

In the client pgm we are catching AxisFault..

for http call, it is going to the catch block...for https, it is not going to the catch block.

try{

// calling the stub

}catch(org.apache.axis2.AxisFault f){
System.out.println( "fault code: " + f.getFaultCode() );
System.out.println( "fault message : " + f.getMessage() );

}

We are not able to get the below message...It is returning only the FaultString as "FAULT"

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Fault</faultstring>
<faultactor/>
<detail xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<ns:Fault xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://www.citi.com/gcgi/shared/system/fault" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">
<ns:ErrorDetail>
<nsateAndTimeStamp>2011-10-14T23:52:15.678+08:00</nsateAndTimeStamp>
<ns:UUID>20110603153701</ns:UUID>
<ns:ESBUUID>d1ss6f1d-cd4c-49c3-9e7d-d364548e5b63</ns:ESBUUID>
<ns:ResponseCode>DE23232</ns:ResponseCode>
<ns:Type>ERROR</ns:Type>
<ns:Code>23SW23</ns:Code>
<ns:Status>ERROR</ns:Status>
<nsescription>Error Message</nsescription>
<ns:Actor>DEMO</ns:Actor>
<ns:ProviderError>
<ns:Code>DE23232</ns:Code>
<nsetail/>
<ns:FieldID/>
</ns:ProviderError>
</ns:ErrorDetail>
</ns:Fault>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
6 years ago

From main jsp page I am calling the "openNewWin()" javascript, which will open a new jsp page(sample.jsp).
sample.jsp has more fields and the page is little bit long. And I am using the <DIV> tag for the vertical scroll bar and it's working fine.
But the issue is, sample.jsp page has more fields and while submitting I am doing the validation and if any of the field is empty, I am the using alert message to correct it.
Whenver, alert message popup opens the entire content inside the <DIV> tag moves down and causing a huge blank space at the top.
If I scroll the page (not with vertical scrollbar, using the mouse and draging on the page down) I can able to see the DIV content along with the vertical scrollbar.
If I removed the DIV tag, even on the alert popup message on validation it's not moving down. So the issue is with the DIV.
PLease help to advice whether am I using the DIV tag correctly?
How to fix this issue? I am using IE 7.0 browser.




While submitting the form and if the http method is POST, then instead of returning 200 response code, I will be redirecting to dummy/temp page from which it will be directed to required page, so that we will return 302 response code to avoid the caching of senstivie information.

This is working fine and in one place it's giving some strange error which is working fine without the above logic.

My dummy jsp page will have the following code for redirection.


For example:

Actual page to be redirect from servlet: empSuccess.jsp

In "empSuccess.jsp", I am using the above code for redirection to emp.jsp. It's redirecting propely and working fine. But in my emp.jsp, I am using the below javascript for excel download.
Below methos will open a popup window to display the message to the user that it's about to download the report and the form will be submitted for the biz logic. The form submission is working fine, but the download.jsp page is not diaplying and returing 404 error.

But if I am not usinf the above logic (200 instead od 302 rsp code), the download.jsp pasge is displaying properly. Any suggestion/idea on why it's not working?

7 years ago
JSP
Hi,

I have a requirement to download the data from DB to CSV/Excel. What I did is retrieving all the records from DB and store in the List and pass that list to the jsp page. In JSP page, I am using the below setting to download it to CSV/EXCEL.



It was working fine. But I have an issues in it. Excel is capable of storing it only 65,536 rows.
Even all the data getting downloaded to CSV/excel (> 65,536), while saving I am getting error from excel saying that it can't save more than 65,536 rows and the below data won't be saved.



I am not opt for POI apache third party at this point of time.
Is it possible to download it in other sheets if it exceeds the max limit.

Example: Having data of around 100,000.

Download 65,536 - Sheet 1
Remaining in Sheet 2,3.. of the same excel.

Any idea/input/suggestion on it?
7 years ago
JSP
Thanks a lot for the confirmation.
7 years ago
Below one is extracted from
http://www.fortify.com/vulncat/en/vulncat/java/race_condition_format_flaw.html

ABSTRACT
The methods parse() and format() in java.text.Format contain a design flaw that can cause one user to see another user's data.


EXPLANATION
The methods parse() and format() in java.text.Format contains a race condition that can cause one user to see another user's data.

Example 1: The code below shows how this design flaw can manifest itself.




While this code will behave correctly in a single-user environment, if two threads run it at the same time they could produce the following output:

Time in thread 1 should be 12/31/69 4:00 PM, found: 12/31/69 4:00 PM
Time in thread 2 should be around 12/29/09 6:26 AM, found: 12/29/09 6:30 AM

In this case, the date from the first thread is shown in the output from the second thread due a race condition in the implementation of format().



So format() is not threadsafe. I am using format() in many places in servlet. Instead of synchroized the methos or using synch block, can I make the variable local so that it will thread safe. Please advice that approach will address the above issue.

Instead of gloabl var (private static SimpleDateFormat dateFormat;), making dateFormat as local var will solve the issue for above case
7 years ago
Hi,

I have a simple jsp page with input text fields and select drop downs.
I have 3 buttons. one for submit, download and cancel.
Whenever I click the download button, it will download the csv files (will ask for default popup to open/save/cancel).
Now, when I am clicking the submit/cancel after the download button, I am enountering an issue and the problem is again the default popup is opening and askinfg for download.
I thought the problem miught be with javascript document object and declared the document object globally and I couldn't able to resolve the issue.
Any inputs will be helpful?


<SCRIPT language="JavaScript">

var doc = document;


function csvDownlaod(){
doc.form.cycle.value = "4";
doc.form.submit();
}


function submitResult(){
doc.form.cycle.value = "1";
doc.form.submit();
}



<SCRIPT>

<INPUT TYPE="button" value="Download" onclick="return csvDownlaod();">
Submit
I have a frameset like below:



1. Menu.html has the main menu.
2. Whenever I mouseover on the Menu.html (main menu) the sub menu will be floating on the second frame thats is on Search.html.

Search.html is having some select boxes and while the sub menu floating over it the select boxes overlaps it in IE but not in FF.
z-index option and all it's not working in IE for select boxes alone.

To avoid it I am trying to hide/show the select boxes when the layer floating over it.

From the Menu.html ("body" frame) I am trying to get all the select boxes available at Search.html("MyFrameOne" frame), as below, but it's failing and throwing javascript error as



Not Working


When I tried to get the value of textbox from ("body" frame) to ("MyFrameOne" frame), I can able to get the value as

Working


I want to hide the select boxes when the layer floating over it and need to bring back the select boxes when the layer hides.
Right now I can't use getElementById, since the body frame html page will differ and id is not used in many select boxes.
Please help to advice how to achieve it?