Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Deep Chand

Ranch Hand
+ Follow
since Dec 17, 2002
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 Deep Chand

Hi,

I have a web service client (using axis) developed using axis:
Ran WSDL2Java on WSDL to generate the client stubs and then filled in the logic to access the web service exposed by soap server.
We need to add mutual authentication (2 way TLS authentication) to this existing web service communication. What changes do I need to make in the client? Any help is appreciated.

thanks,
deep
13 years ago
Hi,

Which mock exam is the most relevant to the new format i.e. 310-081 Servlets 2.4 and JSP 2.0)? If I'm not wrong then j2ee certificate and jdiscuss cover the old format? Please reply.

Thanks
Deep
Hi,

I'm getting this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/ejs/ras/Tr
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.<clinit>(CNInitialContext
Factory.java:47)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at TempClient.main(TempClient.java:27)

I've IBM\WebSphere\AppServer\lib\j2ee.jar;IBM\WebSphere\AppServer\lib\namingclient.jar in my classpath. My Standalone client looks like:

import ejbs.session.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import javax.ejb.*;
import java.util.*;
import com.ibm.ejs.ns.jndi.CNInitialContextFactory;

public class TempClient {

public static void main(String[] args) {
try {
System.out.println("In main");
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
//properties.put(javax.naming.Context.PROVIDER_URL,"iiop://localhost";);
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("3");
//System.out.println(properties.get(javax.naming.Context.PROVIDER_URL));
System.out.println(properties.get(javax.naming.Context.INITIAL_CONTEXT_FACTORY));
InitialContext initial= new InitialContext(properties);
System.out.println("4");

Object o = initial.lookup("ejb/ejbs/session/TimeUtilityHome");

TimeUtilityHome home = (TimeUtilityHome)PortableRemoteObject.narrow(o, ejbs.session.TimeUtilityLocalHome.class);
TimeUtility t = home.create();
System.out.println("Time returned" + t.getTime());

}
catch (Exception e) {
e.printStackTrace();

}
}
}

Please help.

Thanks
Deep
15 years ago
Hi,

I've developed a very basic (Hello world) type EJB which has one stateless session bean and deployed/installed it on WAS6.0 running locally on my machine. I get the following exception when I try to access it using a client written by me. Please help.

javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at TempClient.main(TempClient.java:25)

Here are the exact steps I performed:

1) Using RAD 6.0 (Rational Application Developer), I created EJB Project with one stateless session bean in it. It has local/remote interfaces.
2) Deployed the bean/app.
3) Created the .ear file using Export utility and installed it on the WAS6.0 installed locally on my machine.
4) Wrote the following sample client, compiled it successfully using the EJB client stubs generated by the RAD.
15 years ago
I downloaded the websphere app svr 6.0 & ibm http svr 6.0 from IBM website. I don't find the plug-in for that over there.

Any ideas from where I can get that or what should I do? There are instructions to configure the web svr plugin. Is that sufficient? OR Do I need to install the plugin too?

Thanks
Deep
15 years ago
Hi,

I've installed Websphere 6.0 (trial version) on my machine. It installed sucessfully. Then I installed IBM HTTP Server 6.0 (Apache powered) on my machine and it also installed successfully. Not sure how to verify that.
But now, from where to install the WEB SERVER PLUG-IN? I can only find the instructions to configure the plug-in but I can't find the plug-in installer. Please help.



Thanks
Deep
15 years ago
I know I shouldn't be posting this in this forum but got to post this here to 'thank' every body who took the pain of answering my questions, and who helped me indirectly by posting doubts/queries that forced me to re-visit EJB fundamentals or theory.

The score I got is 91% but I found this test more 'testing', in-depth as well as more questions were quite detailed compared to SCJP/SCWCD. May be it is lack of preparation but wanted to provide my comments/tips(which every body are free to ignore happily ):

HF book + mock exams are sufficient for this test. Again thanks to Kathy & Bert for this book. It is not only good for clearing this exam but explains all the concepts very well. Still not sure what 8 Horseshoe rating on this forum means for this book and why it is lower than other books. I don't know what this 'Horseshoe' unit means )

If you don't want to practice much (code wise) then one has to really go through the book very thoroughly. I also glanced through MZ Study Guide. Thanks to Mikalai. That guide is definetely helpful and covers some of the points that are missing from the HF book (unfortunately). But HF book alone is sufficient if you want to aim for 80% something.

The number of correct answers provided (For e.g., Choose two) makes it easy. Concluding on the correct answer by eliminating wrong answers saved me )

Good Luck to every body.

Thanks again,
Deep
Mikalai,

Correct but when I said 'same home', I meant same entity bean type i.e. both the objects are of PersonBean but from different homes. I have this doubt because if a bean is deployed twice, each will have a different home.

Please reply.
Deep
The abstract getter/setter method for a CMR field should specify only the local interface for the related entity bean. But if it returns Collection, then is there a requirement that it should be a Collection/Set of local interfaces for the related entity bean?


can 'method-intf' be used while specifying tx attributes using 'container-managed' ?


Thanks
Deep
For 2 Entity Bean objects with the same primary key but from different homes, will isIdentical() return true or false?

I think it should be false.

deep
I understand that bean provider has to make all the non transient references Serializable or null before ejPassivate method ends (there are some exceptions to it like jndi context, session context etc). but what if bean provider doesn't make them null/serializable then what will happen?

will the container throw an exception or it's just that those things won't be recreated during activation?

Please reply.

thanks
Deep
HF book on page 228 it's mentioned that

Stateless bean CAN NOT get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

On page 196 it's mentioned that

Stateful bean CAN get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

Is this right and if yes, then why is that difference in the behavior of Stateless vs Stateful? Also, it's mentioned that both stateful & stateless beans can't invoke setRollbackOnly & getRollbackOnly on CMT beans in ejbCreate/ejbRemove methods. Why that differentitation between BMT and CMT beans?

Please reply.

Thanks
Deep
Below is my understanding @ MDB (message driven bean). Please correct me if I'm wrong.

With CMT, the acknowledgement is always sent back to the JMS when the method ends successfully i.e. transaction is committed. As the onMessage() can not throw a checked (application) exception, it can only throw a system exception, which implies that if an exception is thrown from an onMessage() method, the transaction will roll back and no acknowledgement is sent back.

With BMT, the acknowledgement is always sent back when the bean provider commits/rollback the transaction explicitly. However, the acknowledgement is ALWAYS sent irrespective of whether the tx is COMMITTED or ROLLED BACK.

Now one doubt:
What will happen if the BMT MDB throws a system exception from onMessage() method?

Please reply.

Thanks
Deep
Hi,

May be some one has asked/answered this question before but could some one please tell me the syntax for exclude-list tag in DD?

Please reply.

Thanks
Deep
[A] Q5 (page 639):

The answer says: All calls to a MDB instance must be serialized.
What does 'serialized' mean? Shouldn't it be synchronized?

[B] Q 49 [page 673]

What are true about transactions in EJB 2.0?
One of the correct answers given are:

Entity beans with BMT demarcation must use the getStatus method instead of the getRollbackOnly method.

Isn't this wrong? I thought Entity Beans have to be CMT and that's why we skip mentioning the transaction-type attribute in the DD for entity beans.

Please reply

Thanks
Deep