Apratim Khandalkar

Ranch Hand
+ Follow
since Jan 09, 2006
Merit badge: grant badges
For More
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 Apratim Khandalkar

Hi All ,

I was looking into the definition of javax.xml.rpc.service interface and one of the method is

public HandlerRegistry getHandlerRegistry();

So is it possible to change or add handler in the handler chain during runtime.?

Please help
Thanks in advance
Mission SCDJWS
Hi Peer,

Thanks a lot its a great help.
Hi All,
I was looking into objective for exams and objective 10.1 it states that

Describe the characteristics of a service oriented architecture and how Web services fits to this model.

I was looking into links but didn�t find any documents/links which will cover this objective .Please help me if anyone knows link for the document which will cover this objective.
Thanks in advance
SCJP 1.5
Mission SCDJWS
Hi all I was reading notes on WSDL topic given on xyzws.com it gives following description about use of wsdl:import element

WSDL import element can only be used to import other WSDL files. For example:

<definitions name="StockQuote"

<import namespace="http://example.com/stockquote/schemas"

<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>

<definitions name="StockQuote"
<import namespace="http://example.com/stockquote/definitions"
<message name="GetLastTradePriceInput">
<part name="body" element="..."/>

Does this mean if I want to write separate file for schema definition and use this schema definition in WSDL then I need to write schema definition in another wsdl file and import this file .Why can't I directly import xsd file in WSDL.

Please help
Thanks in advance
SCJP 1.5
Mission SCDJWS
Hi All,

Thanks a lot for your reply its much clear now
Hi All,
Thank you for your reply.But I am wondering how the non-java client might call EJB endpoint based webservice.
Please help

Thanks in Advance

SCJP 1.5
Hi All,
I am reading Webservice endpoint from RMH book and only difference between Servlet endpoint and EJB endpoint is that it says using EJB endpoint we can take advantages of transaction management.
My question is servlet endpoint can also take advantage of transaction management ?
Is there any other difference between them? Please help

Thanks in advance
SCJP 1.5
Mission SCJWS
Hi ,

Following is the question at the end of chapter10 from k&B book

Given the default classpath:
And this directory structure:
And these two files:
package xcom;
public class A { }
package xcom;
public class B extends A { }

Which allows B.java to compile? (Choose all that apply.)
A. Set the current directory to xcom then invoke
javac B.java
B. Set the current directory to xcom then invoke
javac -classpath . B.java
C. Set the current directory to test then invoke
javac -classpath . xcom/B.java
D. Set the current directory to test then invoke
javac -classpath xcom B.java
E. Set the current directory to test then invoke
javac -classpath xcom:. B.java

and correct answer given is C .This is confusing to me why B can't be correct answer.Please help
Hi Keith,

Thanks for your reply yes I got it vargs will be always choosen last.
Hi ,
Following is the question at the end of chapter 3 from K& B book and the explanation to answer given below

5. Given:
class Eggs {
int doX(Long x, Long y) { return 1; }
int doX(long... x) { return 2; }
int doX(Integer x, Integer y) { return 3; }
int doX(Number n, Number m) { return 4; }
public static void main(String[] args) {
new Eggs().go();
void go() {
short s = 7;
System.out.print(doX(s,s) + " ");
} }

What is the result?
A. 1 1
B. 2 1
C. 3 1
D. 4 1
E. 2 3
F. 3 3
G. 4 3

3 G is correct. Two rules apply to the first invocation of doX(). You can�t widen and then box
in one step, and var-args are always chosen last. Therefore you can�t widen shorts to either
ints or longs, and then box them to Integers or Longs. But you can box shorts to Shorts and
then widen them to Numbers, and this takes priority over using a var-args method. The
second invocation uses a simple box from int to Integer.

But in this chapter I have read that compiler gives prefrence to widening over boxing them so according to this at the first call to doX when we pass short
I thought that short is widen to long and method int doX(long... x) { return 2; } should be called but explantion says something else.
Please help me on this topic.
Hi All,

Following is the mock question at the end of chapter 6 from K & B Book.

import java.io.*;
public class TestSer {
public static void main(String[] args) {
SpecialSerial s = new SpecialSerial();
try {
ObjectOutputStream os = new ObjectOutputStream(
new FileOutputStream("myFile"));
os.writeObject(s); os.close();
System.out.print(++s.z + " ");
ObjectInputStream is = new ObjectInputStream(
new FileInputStream("myFile"));
SpecialSerial s2 = (SpecialSerial)is.readObject();
System.out.println(s2.y + " " + s2.z);
} catch (Exception x) {System.out.println("exc"); }
class SpecialSerial implements Serializable {
transient int y = 7;
static int z = 9;

Which are true? (Choose all that apply.)
A. Compilation fails.
B. The output is 10 0 9
C. The output is 10 0 10
D. The output is 10 7 9
E. The output is 10 7 10
F. In order to alter the standard deserialization process you would override the readObject()
method in SpecialSerial.
G. In order to alter the standard deserialization process you would override the defaultReadObject() method in SpecialSerial

Answer is
C and F are correct. C is correct because static and transient variables are not serialized when an object is serialized. F is a valid statement.

I am confused if C is correct then why F is also correct please help
public class Test {
static String mountain = "Everest";

static Test favorite(){
System.out.print("Mount ");
return null;
public static void main(String[] args) {

Ouput of above program is Mount Everest I am confused is why this is not throwing NullPointerException Any ideas?
Hi Gavi ,
We had the same problem .We were also having application that uses multiple languages and also we were using struts1.1 and was 5.1.
There are two steps to solve this problem
Add the follwing tag in JSP and this works for any language not just japanease
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="Shift_JIS" %>
2> Use request.setEncoding("UTF-8"); in reset method of ur ActionForm.

This should solve your problem.
Let me know if u have any problem
18 years ago
Hi All,
We are develpoing a application which reads XML data from one server by using http connection and then writes the XML data to HttpServletResponse.
But the problem our XML data is huge so sometimes if data goes over1 MB then it writes only part of the data on to the HttpServletResponse and then it prints Error:500 with the data on the HttpServletResponse.
I have tried changing the buffer size by response.setBufferSize() .It works only if i give it a value exactly equals to the length of the data and this value is very large .Also everytime i can't calculate the length of the data before writing so this is not very feasible solution for me.
Please help if you have any idea???
18 years ago
Hi All,
Yesterday i have cleared SCEA Part 1 with 79% .

My details were

Design patterns - 100%
Security - 100%
lnternationalization - 100%
Concetps = 100%
Protocols - 100%
EJB - 77%
EJB Container - 75%
Messaging - 66
Applicability of J2EE - 50%
Legacy Connectivty - 66%

It took me around 4 months of part time prepartion.
used the following material for study:

1> John Wetherbie's Study Notes SCEA Notes
2>EJB: http://brijeshtech.blogspot.com/2005/12/scea-i-note-ejb.html
3> Messaging: http://brijeshtech.blogspot.com/2005/12/scea-i-note-messaging.html
4> Protocol: http://brijeshtech.blogspot.com/2005/12/scea-i-note-protocol.html
5> For security i have used the Secuirty chapter from mark cades book which is present on java-architect yahoo group .I found those notes very very good.

I also did free mock exams available on the net:
4>http://www.javaqueries.com/scea.do there are 6 mocks

I think all of this preparation is enogh for the exam.The exam is quite easy if you read the questions carefully.
Also i want to thank all the people in this forum because one of the most amazing thing about this forum i found is that when ever i used to post the question at anytime i would not have to wait for more than half hour for answers.
Every time i have posted the question i got the answer with in half hour this is realy amazing once again thank you all.