Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Viv Gupta

Greenhorn
+ Follow
since Dec 01, 2005
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Viv Gupta

Hi All,

I want to know what's the use of InitialContext? what happens when we write

Ok let me explain this how I understand this question. 3 threads exists
1. Main
2. Thread created by the inner method call - createThread(20, Thread.currentThread()) lets call it t2-1.
3. Thread created by the outer method call - createThread(10, t2-1). call it t2-2.

t2-1 is having a join on Main thread and t2-2 has join on t2-1.

Now given such condition lets justify the answers -

1. The first number printed is 13.
Not possible because System.out.println(i+3); will be the first statement to execute.

2. The number 14 is printed before the number 22.
This is for sure, as 22 will be printed by thread t2-1 and 14 can only be printed by Main thread.

3. The number 24 is printed before the number 21.
Can't say. Because Main and t2-1 are 2 threads that are running. Its on the scheduler which one will be executed first.

4. The last number printed is 12.
This is for sure, as t2-2 will be the last to finish.

5. The number 11 is printed before the number 23
Not possible as t2-2 has a join on t2-1, and t2-1 inturn has a join on Main thread. Here 23 can only be printed by Main thread.
Hi All,
There is a question on threads from Khalid Mughal book which Iam not able to understand.



Select the two correct answers.

1. The first number printed is 13.
2. The number 14 is printed before the number 22.
3. The number 24 is printed before the number 21.
4. The last number printed is 12.
5. The number 11 is printed before the number 23

The answer is 2 and 4 . Can any one please explain the reason behind the answers ?

Thanks
[ August 28, 2006: Message edited by: Viv Gupta ]

Originally posted by hareendranath babu Kotha:


For Example :

String S1="Testing";
String S2="Testing";

if (S1==S2)--------always returns false, where as coming to equals()

if (S1.equlas(S2))-------> always returns True.




No, S1==S2 will not always return false. Rather I will say that it will always return true(in this case). Why ? I think wise owen explanation is the exact answer for this.

[ June 12, 2006: Message edited by: Viv Gupta ]

[ June 12, 2006: Message edited by: Viv Gupta ]
[ June 12, 2006: Message edited by: Viv Gupta ]

SOAP allows for an entire chain of SOAP nodes to "process" a single SOAP request. It starts at the initial SOAP sender, goes over any number of SOAP intermediaries, and then ends up at the ultimate SOAP receiver.



what are SOAP intermediaries ? Talking at the implementation level Is this a kind of service or a firewall ?

In some cases the SOAP sender may only be aware of the first intermediary the message is sent to, and the message is then dynamically routed (potentially through multiple SOAP nodes) based on content of the message; so some of the intermediaries may not know who the initial Sender is. Sometimes the SOAP message may be sent on another systems behalf and when "certain things happen" yet other systems need to be notified.



Can we have some practical example of this. That will make the thing more clear.
14 years ago
Hi,
How can i configure Axis2 for WSAD 5.1.1 ? Installation guide on ws.apache.org says that it can be deployed by copying the war on webapps folder of any servlet container. Almost all servlet container accepts the axis that way.

So I created a axis2.war and imported that war on WSAD. But the server throwing exception while starting up.


Can any body point out where Iam wrong.
14 years ago
Hi All,
I have gone through some of the articles on ws-addressing, but couldn't actually figure out why ws-addressing is required ?

what I understand from ws-addressing is that using ws-addressing a response can be addressed to some other destination. For e.g. client-A

invokes a service at Server1 and requires the response to be sent to Client-B. ws-addressing provides the standarized <wsa:ReplyTo> MI

header to achieve this. The client client-A will send a SOAP message with <wsa:ReplyTo> element containing the url of destination endpoint

where response is to be made, in SOAP header. The server when find <wsa:ReplyTo> element in SOAP header, will send the response to the

specified url.

Similarly From header is to send the acknowledgement back to the sender & FaultTo to send the fault to sender/other fault handler.

Utility of EPR's (End Point Reference) is also vague.

Is this the only scenario where ws-addressing should be implemented ?

Comments/Suggestions are welcome.
14 years ago
Hi,
Iam new to struts. I want to ask that Is it possible to work with plain JSP (i.e. No taglibs) in struts framework. Do the request processor will map the html input boxes to the respective property of form bean then ?

Thanks
14 years ago
Hi,
Iam working on application that implements JNDI & JMS on Tomcat 5.0. The JMS provider that Iam using is OpenJMS. I am writing this application just to clear my concepts of JNDI and JMS. Now my question is - How can I bind a QueueConnectionFactory to a JNDI so that the sender/receiver can lookup JNDI for ConnectionFactory.

I don't want to use the JNDI of openJMS. Iam using fileSystem JNDI provider of SUN. The code goes like this -



QueueConnectionFactory is an interface, so how can bind the object of QueueConnectionFactory to JNDI so that the sender/receiver can lookup for the connection factory ?
I have Tomcat 5.0 installed on my windows 2000 machine. How can I switch from console monitor to commnad window for logs ?
14 years ago

Press Ctrl+D and see your favourites



Some people like to have a favourite menu spreading all over the screen. And the day come when they burn their eyes searching which of topic is favourite among the favourites.
14 years ago
I have been reading and posting the topics on various forums of the ranch. To refer to the topic that I have seen few days back, I have to run a search for the topic. That too will get more difficult when you don't exactly remember the keyword from the topic, as in that case searching result to a bulk of topics.

Iam not able to find any way to mark a topic for future reference.I think some way of marking a topic will be good (similar to that of google groups where one can put a star on the topic).
14 years ago

Here, an example for Transitivity
- a house HAS-A kitchen, the kitchen HAS-A oven >>>
the house HAS-A oven



Lets code this example


Its very clear that although it seems transitive in real world, but not in context of java.

- serialization will take a whole graph of object. if you serialize the house, you will take the whole



Its because you will not like to loose any information while serializing an object
HAS-A relation is not transitive.

Really, I can find examples where sometimes you tend to reply YES and sometimes you tend to replay NO... BUT in theory is it a YES or a NO ?



Can you give some examples where the answer is YES.
Hi
While invoking the service from an DII axis client, Iam receiving an exception -



I could not get any clue why this is happening. Can any one point out why do I need servlet context while invoking a service ?
15 years ago