Shoaib Khanzada

Ranch Hand
+ Follow
since Jan 24, 2004
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 Shoaib Khanzada

Hi,

I appeared in the SCDJWS 6 beta exam on 4th September, most of the exam covers the JAX-RS and Security related questions. Following is what i think is the breakdown of topics covered with their percentage:

JAX-RS --> 40%
Security --> 20%
EJBs based web services --> 10%
JAX-WS --> 15%
Configurations --> 5%
XML Schemas --> 5%
Other --> 5%

There were total 168 questions and i had 4:15 hours to finish the test. However, i finished it in 3 hours!. Exam is not very difficult if you have dome some preparation.

For preparation, i would say to read Ivan study guide, although it doesn't cover the most of the exam part (jax-rs and ejbs) but will be good help in other areas. This is the only book i read and all else i take advantage of my web services experience. There are other study notes and quiz made by Mikalai but that would need to be updated as well (my guess).

Shoaib
Hi,

are you preparing for the beta exam of SCDJWS for EEE 6? Which preparation meterial you are using? Test outline will be same as was of EE 5 (mostly)? as the test outline given on the Oracle site is not detailed one.

Thanks,

Shoaib
Anyone knows the last date of this beta exam?
Thanks much!, thats helpful.
Hi,

We don't have any mock question available to test how much we have learned so far. It would be really nice if everyone preparing for beta create 5-10 mock questions for every section. This way we could easily test our skills and get a better idea where we stand.

I have started this practice if others will also contribute that would be great! What do you think MZ, Ko Ko, and others?
Great effort!!!, Thanks a lot for your time.

I like the idea of pdf, Can anyone please convert HTML pages into pdf?
Hi guys,

Following are few mock questions available about the section 2 of 311-091. I prepare these question to test myself and just to guess what could be asked in real exam. It might not be very difficult but could be helpful to test where you stand in section 2. (Ignore any compile time errors)

I will add further question about this section and other sections later.

Guess your answers and post them in reply of this thread.

------------------------------------------------------------------------
Section 2: General EJB 3.0 Enterprise bean knowledge
------------------------------------------------------------------------

Q1: If there is not any compile time error in the following bean what it will be print when client invoke someBusinessMethod first time?

@Stateless
Class MyBean implements IMyBean {

{
System.out.println(0);
}

Public MyBean() {
System.out.println(1);
}

@Postconstruct
Public void init() {
System.out.println(2);
}

Public void someBusinessMethod() {
System.out.println(3);
}

}

A.It will throw a RuntimeException because we can not use std out in bean
B.It will throw an EJBException because we can not use std out in bean
C.0, 1, 2
D.2, 0, 1
E.0, 1, 2, 3

Q2: What will be the result of invoking someBusinessMethod for the following bean?

@Stateful
class MyBean implements IMyBean {

{
System.out.println(0);
}

public MyBean(String str) {
System.out.println(str);
}

@Postconstruct
public void init() {
System.out.println(2);
}

public void someBusinessMethod() {
System.out.println(3);
}

}

A.0, 1, 2
B.Bean instance will not be created
C.0, 1, 2, 3
D.2, 3

Q3: Suppose someBusinessMethod is in or required transaction and timeout of bean occur, cleanup method will be called or not?

@Stateful
class MyBean implements IMyBean {

@Postconstruct
public void init() {
System.out.println(�bean initialized, opening connections��);
�..
}

@Predestroy
public void cleanup() {
System.out.println(�closing open connections��);
�..
}

public void someBusinessMethod() {
��
}

}

A.yes
B.no
C.EJBException will be thrown
D.IllegalStateException will be thrown
E.Stateful bean can not be timeout while in a transaction

Q4: A timeout occur while bean was in ready state. cleanup will be called?

@Stateful
class MyBean implements IMyBean {

@Postconstruct
public void init() {
System.out.println(�bean initialized, opening connections��);
�..
}

@Predestroy
public void cleanup() {
System.out.println(�closing open connections��);
�..
}

public void someBusinessMethod() {
��
}

}

A.yes
B.no
C.Stateful bean can not be timed out
D.Depends upon vendor implementation or container specific

Q5: Where dataSource injected resource will be available?

@Stateless
class MyBean implements IMyBean {

@Resource(mappedName=�myDataSource�) DataSource dataSource;

public MyBean() {
// here 1
}

@Postconstruct
public void init() {
// here 2
}

@Predestroy
public void cleanup() {
// here 3
}

public void someBusinessMethod() {
// here 4
}

}

A.2, 3, 4
B.2, 4
C.1, 2, 3, 4
D.Will be available in 2 and 4 but for 1 and 3 depends upon vendor implementation

Q6: What will be the output if someBusinessMethod is called?

@Stateless
class MyBean implements IMyBean {

public void someBusinessMethod() {
System.out.println(2);
}

@AroundInvoke
public Object doSomething(InvocationContext inv) {
System.out.println(1);
return inv.getTarget();
}


}

A.2, 1 will be printed
B.1, 2, 1 will be printed
C.1, 2 will be printed
D.Only 1 will be printed
E.It will throw an EJBException

Q7: How can I disable default and class interceptors for someBusinessMethod?

@Stateless
@Interceptors(MyInterceptor.class)
class MyBean implements IMyBean {

public void someBusinessMethod() {
System.out.println(2);
}

}

A.By using @ExcludeDefaultInterceptors
B.By using @ExcludeAllInterceptors
C.By using @ExcludeClassInterceptors
D.By using @ExcludeDefaultInterceptors and @ExcludeClassInterceptors
E.There is not way to override class interceptors

Q8: Which of the following statements are true about interceptors?

A.Interceptors are invoked in the same call stack of the business or life cycle methods
B.All Interceptors can throw checked or unchecked exceptions
C.Interceptors follow the life cycle of the bean for which they are being invoked
D.Interceptors can be given public, private, protected, or default access and they can be final or static.
E.Callback interceptors can not be declared as final or static

Q9: What will be the order of statements when someBusinessMethod will be called?

public class MyInterceptor1 {

@PostConstruct
public void initInterceptor(InvocationContext inv) {
System.out.println(�PostConstruct interceptor�);
inv.proceed();
}

@AroundInvoke
public Object wrapBusinessMethod(InvocationContext inv) {
System.out.println(�business interceptor1�);
return inv.proceed();
}

}

public class MyInterceptor2 {

@PostConstruct
public void initInterceptor(InvocationContext inv) {
System.out.println(�PostConstruct interceptor2�);
inv.proceed();
}

@AroundInvoke
public Object wrapBusinessMethod(InvocationContext inv) {
System.out.println(�business interceptor2�);
return inv.proceed();
}

}

@Stateless
@Interceptors({MyInterceptor1.class,MyInterceptor2.class})
public class MyBean implements IMyBean {

@PostConstruct public void init() {
System.out.println(�PostConstruct�);
}

public void someBusinessMethod() {
System.out.println(�business method�);
}

@AroundInvoke
public Object wrapBusinessMethod(InvocationContext inv) {
System.out.println(�local business interceptor�);
return inv.proceed();
}

}

A.local business interceptor, business method
B.local business interceptor, business interceptor, business interceptor2, business method
C.business interceptor, business interceptor2, local business interceptor, business method
D.order of statement is unknown
E.local interceptor can not be used with class interceptors

Q10: With the Q9 code in mind, What will be the order of statements when new bean instance is created?

A.PostConstruct interceptor1, PostConstruct intercept2, PostConstruct
B.PostConstruct interceptor2, PostConstruct intercept1, PostConstruct
C.order of statement is unknown
D.PostConstruct, PostConstruct interceptor1, PostConstruct intercept2

Q11: Which of the following statements are correct?

A.Timeout callback method can not throw application exceptions
B.Timer can be registered in setEntityContext
C.When multiple timers are registered and timed out the sequence of callbacks is unknown
D.Timout callback doesn�t run in any client�s security context
E.Timer survive the system crashes
Hi,

please send this guide to me as well. Thanks much!

skhanzada@gmail.com
Hi,

methods define in bean interface can throw RemoteException or not?

Shoaib
Thanks guys for your time and answer. :-)
Hi All,

Can anyone please tell me when the next version of java will be available? and when they will announce its beta exam?

I think Bert you can answer :-) please do so, thanks

Shoaib
Hi,
Can anyone please answar when the j2ee 1.5 beta is comming?
Hi all,
Can anyone please tell me the how can i use embedded version of mysql in my java application. thanks
Hi all,
Can anyone please tell me that when SCJP 1.5 Beta exam is going to be announced? thanks