Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use EJB with tomcat?

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
0
0
US
Hi I want to mantain session for my applet and read somewhere that EJB is the best way to go, create a session bean and have it interact with the applet but the problem is that I am not very familiar with EJB and how to host it. Is tomcat capable of hosting EJBs, or do I need something else. i am currently using Tomcat 5.5.7

Also any quick tutorial on the possibilities of EJB use would also be helpfuly.

Thanks
Ankur
 
Tomcat is a servlet container, not an EJB container.
You will need a J2EE Application Server (JBoss is a free one) that has an EJB container built in.

As for EJB tutorials, just google :)

--------------------------------------------------
Free Database Connection Pooling Software
 
So I dont need to intgrate Jboss with tomcat right?

They run independed and the session bean or EJB will be running there and my applet will basically talk to that bean?

Also is there a better or easier way of performing session handling to store data for applets?

Also I am not clear when I do create this session bean, I would have to handle my own vector of sessions right, since any number of client can connect and get their down stored data?

Thanks for the help
Ankur
 
What is Mbean, can I just use that with tomcat instead of doing all this to maintain what i am trying to do?

Thanks
Ankur
 
Easy fella ... one question at a time !

If you are using EJB, and servlets, I would forget about Tomcat, and use the servlet container that comes with the J2EE AS (often Jetty or Tomcat, or a home grown version).

Personally, I don't think EJB would be the best way to handle sessions for Applets alone - it seems a bit heavyweight to me.

MBeans are part of the JMX spec, and are not really for the beginner, but they are powerful. However, again I don't really think this is what you should be looking at for handling sessions for applets.

I think you should slow down, and analize what you have, what you wish to get to, and the technolgies possible to do it. Just saying "Can I use Mbeans or EJB" does not really sound to be as if you have actually looked into the technologies very well ...



--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks for the help sedj, I typed "session handling in applet" or something like that in google and got something to do with session beans, so I just looked into that. I really dont want to use DB, since this will be the only thing I will be using the database for, so I looked a little in beans and somewhere I read about Mbean so I started to look into that.

I am not very familiar with all the java technologies available and what exactly they do, so I am always lost :)

What would you suggest for such a sitiuation, I have aGUI handling and displaying alarms for a box and you can open as many applets as you want, but the server side only sends the alrams as and when they come, so I need to store older alarms to be displayed by the applet which comes alive after the alarm was rasied. I thought I could store some info in beans and retrieve it from the applets, but if you think there is a better way of doing this, it would be great.

Thanks a ton for all your help.

Ankur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top