Vijay Gade

Ranch Hand
+ Follow
since Jul 04, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vijay Gade

I am positive about the iiop port. I went to the Application Server's General Tab in the admin gui, and that was where I found that 3700 was the port.
Basically, I am using J2EE 1.4 and SDK 1.5. Can that be any reason?

Thanks,
-V
Hi,

I know this is a question that has been asked very frequently, but I could not get it to work.

This is basically about the jndi set up in the AdviceClient.java.

This is what I did:



Thanks,
-Vijay
This is what I'm thinking:

Based on the transaction attribute, it would be decided whether the transaction is restricted to a single method, or would propogate further. For example, if the transaction attribute of a method bar() is Mandatory, then this method would enforce the method calling this method, foo(), to be in a transaction. Thus, if bar() fails, so would foo().

Please correct me if I'm wrong.
Hi all,

I am using the RI tool, and I was trying to create a CMP Entity Bean. The home, remote and bean, all returned passed tests when I used the verifier in the RI tool.

Now came the part when I have to connect the data sources, and here is what I did:

(1) copied my classes12.jar to the C:\j2sdkee1.3.1\lib\system directory, and included this classes12.jar in my CLASSPATH (windows).
(2) changed the config\resource.properties to the following:


But nothing seems to work. When I go try to build the SQL code giving the jdbc/Oracle jndi name and username and password, I get a message box that says I have an SQLException (no suitable driver).

Can someone help me out in connecting to an oracle database using the RI tool please?

Thanks,
-Vijay
Hi,

I just read that the stateless session bean and the EJB object will only be tied when the client calls a business method on the EJB object, NOT when the ejbCreate method is called. Which also means, I am assuming, the session context is tied to the bean, but, the session context has no idea about the EJB object.
Then on the next page, I read that within the ejbCreate method, one can use the session context to access reference to the home and the ejb object.
What I did not understand is that, when the ejbCreate method has no link with the EJB object, how can one access the EJB object's reference from within the ejbCreate method? It's only after the business method is called, the container pulls a bean out of the pool and links it with the client's ejb object.
Hi Vidyasagar,

I am now facing a new problem. I initially was using OC4J's j2ee/home/lib/ejb.jar. Then, I removed that ejb.jar from my CLASSPATH, and added Sun's home/lib/j2ee.jar. I compiled the classes, and deployed the application (just like in HF). I then added my AdviceAppClient.jar to the CLASSPATH, and compiled the AdviceClient.java, and it comiles fine.

The problem starts when I try to run the client, at exactly the following line,
Object o = ic.lookup ("Advisor");

and the error is:

I am now more confused!! And as for your question, no, I did not include the properties file, because I do not know what to include. Could you please help me out?

Thanks a lot!

-Vijay
I meant "run" AdviceClient, not "compile". Sorry about that.

-Vijay
Hi,

I am doing the first given exactly as mentioned in the Head First EJB. I am still getting the following error when I try to compile the AdviceClient.java:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:
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 AdviceClient.go(AdviceClient.java:19)
at AdviceClient.main(AdviceClient.java:11)

I am using java version 1.4.2.12 and j2ee 1.3.1 in windows xp.
I even added AdviceAppClient.jar to the CLASSPATH.

Any help please? As you can obviously see, I am very much new to EJBs.

Thanks,
-Vijay
Hi,

When I try to run the deploytool, I only see a blank deploytool window. So I turned off my windows firewall, and for some reason, I see the contents of the deploytool window. But after a few seconds, the deploytool window is back to blank. Then, if I again turn on the windows firewall, and then turn it off again, I once again see the deploytool contents, but well, only for about 10 seconds.

Did this happen to anyone else?

Thanks,
-Vijay
Hi,

Pardon me if the question is dumb. In HFEJB, page 139, The Client View, the book mentions that the client code would have something like:

Handle h = this.restoreTheHandle();

and then,

Objec o = h.getEJBObject(); //etc etc...

I did not understand what goes on inside the restoreTheHandle() method. How do we restore the handle before calling the getEJBObject() method?

Thanks a lot,
-Vijay
I think you are right too. From what I know, if class Super and Sub are in different packages, and Sub extends Super, then of course, you CANNOT access Super's protected members from Sub by using Super's references. But, you CAN use that Super's protected member by (1) directly calling that member, or (2) using a sub class reference.

-V
p.s.

Forgot to add the main method in the Test class. aa.f() would fail to compile if not inside some method.

Thanks,
-Vijay