Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Rajesh Pandey Rajesh Pandey

Greenhorn
+ Follow
since Mar 12, 2006
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 Rajesh Pandey Rajesh Pandey

Better Idea will be that first complete Khalid Mughal after that do practice with mock papers

Rajesh Pandey
9811903737
12 years ago
Hello Freind <p>
You can try it as below.I think that this eample can help your<p>
import java.rmi.*;
import javax.ejb.*;
import javax.naming.*;
import java.util.*;
public class Rajesh
{public static void main(String args[])
{try
{
Properties ptr=new Properties();
ptr.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ptr.put(Context.PROVIDER_URL,"t3://localhost:7001";);
Context ct=new InitialContext(ptr);
RajHome rh=(RajHome)ct.lookup("pandey");
RajRemote rr=rh.create();
String snp=rr.pandey();
System.out.print("Result"+snp);
rr.remove();

}catch(Exception e)
{System.out.println("Error : " +e);}

}

}
<p>
Best Regards<p>
Rajesh Pandey <p>
email :--rajesh-pandey@hotmail.com<p>
mobile :--+919811903737<p>
india ,Delhi
info@sixthquadrant.com
info@techraysolutions.com
www.techraysolutions.com
Hi
Transaction mainly work on system where cuncurrency contole required means one is second depend on that means totally it managed by container that is benefits of transaction.

With Best Regards
Rajesh Pandey
email id :-- info@sixthquadrant.com
Contact :-- +919811903737
Delhi India
Hello Freind

I am Rajesh Pandey from india delhi .I am sharing one problem that is it possible that we can call a servlet from main class in java. As i know that ejb can be call from main using jndi .But in case of servlet how is it possible.Thanks in advance..


With Best Regards
Rajesh Pandey
email:-info@sixthquadrant.com
mob :--+919811903737
India Delhi
Hello Freind

Ejb isolation depend on your application suppose u have not specify any then default it will be tx_read_uncommited means here there is no any isolation level,Second thing isolation depend on counter of application means how many user visited on application suppose lots of user then it should be tx_serializable i think u can understand

Regards
Rajesh Pandey
www.sixthquadrant.com
Delhi
Mob :--9811903737
Dear freind

Setting environment depend on application server .Application server have a bat file which assist that which file is to be add in classpath.actually i am using weblogic in weblogic setEnv uses for setting environment variable in this if you makes your separate container then add folder also in classpath.
Regards
Rajesh Pandey
email :-- rajesh-pandey@hotmail.com
mob:--9811903737
Hello Freind

You are thinking good.You can use either CMP or BMP both have done same task but difference is that in case of CMP you have work on limit which is available in CMP but in case of BMP you have not any limitation you can manage all means transaction as you want.Second thing is that you have said about memory object and Least Recently Uses Algorithm i want to say you just reverse algo Just in time which is uses for information regarding state activation and passivation means container called those object which is just called before.i think my answer can help your.

With Best Regards
Rajesh Pandey
email :-- rajesh-pandey@yahoo.com
India Delhi
Hello Freind

The parameter you have passed in lookup (means jndi name) same jndi should be in Deployment Descriptor which can be created through ant command or writting that deployment descriptor.After all these setting your application will work successfully (not display exception report)

With Best Regards
Rajesh Pandey
mail: rajesh-pandey@hotmail.com
India Delhi
Hello Freind

I want to say you that main purpose of lookup is for locatio transparency which is possible through uses JNDI.As you know that lookup takes parameter jndi name which map through weblogic.jar.xml (in case of weblogic applicatio server) and formate pre defined in DTD which takes jndi name and map it to correspondind bean.I think you can understand all this

With Best Regards
Rajesh Pandey
email :--rajesh-pandey@hotmail.com
Mobile :--+919811903737<p>
india Delhi
Hello Freind<p>

I want to say you that main purpose of lookup is for locatio transparency which is possible through uses JNDI.As you know that lookup takes parameter jndi name which map through weblogic.jar.xml (in case of weblogic applicatio server) and formate pre defined in DTD which takes jndi name and map it to correspondind bean.I think you can understand all this <p>

With Best Regards<p>
Rajesh Pandey <p>
email :--rajesh-pandey@hotmail.com<p>
Mobile :--+919811903737<p>
india Delhi
Hello Freind <p>
First thing i have some confusion that you r saying that you are interact through database but it is not possible that you interact through database through session bean.This task possible if you call a entity bean in session,Second thing that you have ask client of ejb can be a class,jsp,servlet,applet and you want to know how ejb called through class so i am giving a example.Here RajHome is home interface RajRemote is remote Interface method name is pandey which return a String.I think that this eample can help your<p>
import java.rmi.*;
import javax.ejb.*;
import javax.naming.*;
import java.util.*;
public class Rajesh
{public static void main(String args[])
{try
{
Properties ptr=new Properties();
ptr.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ptr.put(Context.PROVIDER_URL,"t3://localhost:7001";);
Context ct=new InitialContext(ptr);
RajHome rh=(RajHome)ct.lookup("pandey");
RajRemote rr=rh.create();
String snp=rr.pandey();
System.out.print("Result"+snp);
rr.remove();

}catch(Exception e)
{System.out.println("Error : " +e);}

}

}
<p>
Best Regards<p>
Rajesh Pandey <p>
email :--rajesh-pandey@hotmail.com<p>
mobile :--+919811903737<p>
india ,Delhi
Dear Freind

I am Rajesh from india Delhi.I want to make a system that i can run servlet and jsp on interanet.I am using Web server tomcat and Appliaction Server Weblogic .Is any setting through which we can run it on interanet.Thanks in Advance

With Regards
Rajesh Pandey
14 years ago
Hello Freind

i am expain all the process and i think it will help all those freind which are beginer for ejb that you will not get any problem that i you r beginer..you can deploy programme as below 1) write all java programme like Remote interface home interface Bean class in case entity primary key class etc
2)Make Deployment descriptor which is inside META-INF for this u can use ant command which i have explain below

3)Make jar file & corresponding skeleton for this use command on command prompt

4)After that start Application server and upload skeleton

5) Now your application completed

6)For checking write client code and compile it If you try as i have explain then sure your application will success
Suppose you have deploye a countBean
first copy setEnv and paste in
C:\rajesh <p>all file of ejb in that add rajesh folder in classpath inside setEnv
First CountRemote will be as below <p>
import javax.ejb.*;
import java.rmi.*;
public interface CountRemote extends EJBObject
{public int abc() throws RemoteException;
}<p>
After that write CountHome which is Home interface
import javax.ejb.*;
import java.rmi.*;
public interface CountHome extends EJBHome
{CountRemote create(int p) throws RemoteException,CreateException;
}
After that Bean
import javax.ejb.*;
public class CountBean implements SessionBean
{private SessionContext ctx;
private int p;
public int abc()
{System.out.println("abc(int p)");
return ++p;
}
public void ejbCreate(int p) throws CreateException
{System.out.println("ejbCreate()");
this.p=p;
}
public void ejbRemove()
{System.out.println("ejbRemove()");}
public void ejbActivate()
{System.out.println("ejbActivate()");}
public void ejbPassivate()
{System.out.println("ejbPassivate()");}
public void setSessionContext(SessionContext ctx)
{}
}
After that Client code
import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import java.util.*;
public class Count
{public static void main(String args[])
{
try
{Properties p=new Properties();p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001";);
Context ctx=new InitialContext(p);
CountHome CH=(CountHome) ctx.lookup("xyz");
CountRemote A[]=new CountRemote[3];
int abcp=0;
System.out.println("Initializing Bean ........");
for(int i=0;i<3;i++)
{A[i]=CH.create(abcp);
abcp=A[i].abc();
System.out.println(abcp);
Thread.sleep(500);

}
// Calling abc() on each EJB Object
System.out.println("Calling abc() on bean ");
for(int i=0;i<3;i++)
{abcp=A[i].abc();
System.out.println(abcp);
Thread.sleep(500);

}
// Removing object
for(int i=0;i<3;i++)
{
A[i].remove();
}
}catch(Exception e){}
}
}
<p> compile all as <p>
C:\rajesh>javac countRemote.java
C:\rajesh>javac countHome.java
C:\rajesh>javac countBean.java
C:\rajesh>javac count.java
After compile all file
go command prompt suppose all java file in rajesh folder<p>
write ant command as below :--
c\rajesh >java weblogic.ant.taskdefs.ejb.DDInit it create META_INF inside you will get xml equivalent deployment descriptor
c:\rajesh>jar cvf cc.jar *.*
which make jar file as compress file
c:\rajesh>java weblogic.ejbc cc.jar ccc.jar <p> you will get a jar file which you have to upload. and finally
c:\rajesh>java Count
which give result Finnaly i think this example help lot of freind

Regards
Rajesh Pandey
Mob :- +919811903737
email :- rajesh-pandey@hotmail.com
Hello Freind
First thing is that if you think ejb 3.0 is better then you should read ejb 3.0 but i think there is no much difference between 2. 3. secondthing is about book then till to now i have read Adroman (Mastering in ejb).but i suggest that any book on ejb read completely after that you can chose any which you like but Adroman cover all topic very well

Regards
Rajesh Pandey
email :-- rajesh-pandey@hotmai.com
Mob :- +919811903737
A freelance software Developer
India Delhi
Hello Safin

I think there will be error of database connectivity pool you try for this if again find any problem then there may other option if not successful then say it

Regards
Rajesh Pandey
email :- rajesh-pandey@hotmail.com
A freelance software Developer
India Delhi