*
The moose likes EJB and other Java EE Technologies and the fly likes Deploying EJB on Internet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Deploying EJB on Internet" Watch "Deploying EJB on Internet" New topic
Author

Deploying EJB on Internet

syed khadeer ahmed
Greenhorn

Joined: Sep 15, 2010
Posts: 3
Hi Everyone.


I am new to EJB, and i am stuck somewhere.
i have developed a web application which uses EJB, it works perfectly on netbeans.

What i wan to know is, what do i have to do if i want to deploy this application on internet,
do i have to install EJB on my Host. or Do i have to install database on host. i dont know what to do.

Please help me.

regards
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
If you're using entity beans, then yes - you'd need a database. Message-driven beans, on the other hand, may not need a DB (but they'd need a JMS server).

You also need a server that can host EJBs; either a full-blown JEE server like GlassFish, or -if you don't need other JEE features besides EJBs- OpenEJB installed in a servlet container like Tomcat will suffice.
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

If it is working perfectly on netbeans, You no need to do anything.

You need to use IP address to your application server runtime. by default it is localhost. Look at the server configurations for this.

If your system running the application server is in the network, your ejb will be accessable from anywhere from a client in the network using the ip address and port number and ejb jndi name.


SCJP 5, SCWCD 5
syed khadeer ahmed
Greenhorn

Joined: Sep 15, 2010
Posts: 3
Hi thanks for the reply.

but still i am not clear on how to deploy it on internet,

i developed a website which uses some jsp and html pages, and deployed on my host so it is accessible on www.
but when we use ejb (i am using entity and session bean here) so definitely i need a database, where would i place my database.
because with ms access we get a database file, but using ejb we dont get a db file. here i am using oracle 10g database . so when i deploy this on internet how will ejb connect to database


please tell me in details how do i make this work.

thanks
mohammed mayer
Greenhorn

Joined: Feb 23, 2008
Posts: 1
syed khadeer ahmed wrote:Hi thanks for the reply.

but still i am not clear on how to deploy it on internet,

i developed a website which uses some jsp and html pages, and deployed on my host so it is accessible on www.
but when we use ejb (i am using entity and session bean here) so definitely i need a database, where would i place my database.
because with ms access we get a database file, but using ejb we dont get a db file. here i am using oracle 10g database . so when i deploy this on internet how will ejb connect to database


please tell me in details how do i make this work.

thanks


hi syed,

you don't need anything if your oracle server is in the same host as your website.

some time you need to put the oracle server in a different host (# website host) at this time you must edit your persistence.xml file .



Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
you don't need anything if your oracle server is in the same host as your website. some time you need to put the oracle server in a different host (# website host) at this time you must edit your persistence.xml file.

The persistence.xml file contains the DB server name or IP address no matter whether it's local or on a different machine, so that's not a distinguishing criterion.
syed khadeer ahmed
Greenhorn

Joined: Sep 15, 2010
Posts: 3
hi thanks for reply guys.

I am sorry but i am still confused,
what i dont understand is, when we use netbeans or any other editor, usually my database is on localhost,
suppose oracle 10g is localhost/apex/sql

with this the ejb can communicate with database when it is on virtual server like glassfish(on netbeans).

but what happens when we actually put this web application(web site) on internet.

how does the ejb(module which is on internet now) communicate with database when database is on localhost? or do i have to install oracle on host aswel

thanks
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
how does the ejb(module which is on internet now) communicate with database when database is on localhost? or do i have to install oracle on host aswel

Yes, as I said in my first post, you need a DB server as well as an app server.
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

First of all your machine should be accessable on the internet. That will be possible having an ip address to your system which can be accessagle over internet.

Now the appliction server or DB will be accessable with that IP address instead of localhost.

Everything else is same as your local.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Deploying EJB on Internet
 
Similar Threads
what is Host String?
Experience and skillset
Releasing the JRE
JNDI in websphere
general question on what JBoss is