|
From: David C. <Dav...@di...> - 2004-07-26 17:22:19
|
Hi, Jan:
Thank you very much for your reply. Still have couple questions:
1. I agree it's the easies way to deploy it to jboss bundle instead of run
jboss and jetty separately. However, in real world, company usually will run
web (or and http) server on one machine, and jboss server on another machine
for security reason, am I right?
2. Where (in which directory) should I put my jndi.properties so that my
webapplication can see it? Curretnly, I put jndi.properties in root
directory and run java -jar start.jar etc\jetty.xml, it works. Can I put it
in WEB-INF directory inside my webapplication? How to set up classpath to
include that jndi.properties file in war file? I tested Jetty-3.1 (very old
version), I can put jndi.properties in JETTY_HOME/lib directory and my
webapplication can see it, but not works for jetty4.2.21 if I put it in lib
directory, why?
Thanks a lot again, and highly appreciated if Jan or anyone can give me any
clues.
David Chen
-----Original Message-----
From: jet...@li...
[mailto:jet...@li...]
Sent: Sunday, July 25, 2004 1:09 AM
To: jet...@li...
Subject: Re: [jetty-discuss] How to configure jetty to talk to jboss
David,
Well, the easiest thing to do would be to use the Jetty/JBoss integration,
which I think was present from around JBoss-2.4.4 onwards, rather than
running a jboss instance and a separate jetty instance.
If you don't run them integrated, then your webapp effectively becomes just
like a text client - Jetty itself is a lightweight web/servlet server, and
only supports ejbs via tight integration with a J2EE container (eg JBoss).
Without the tight itegration, you don't get java:comp/env JNDI space set up
for you, and you don't get to use your <ejb> tags in web.xml. So you'd have
to do something like (as far as I can recall):
1. supply to your webapp all of the necessary jars from the
$JBOSS_HOME/client directory (best to hunt around on JBoss mail
lists and doco for which ones you need)
2. set up the JNDI root stuff by doing something in the code like:
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
env.setProperty(Context.PROVIDER_URL,
"192.168.0.1:1100,192.168.0.2:1100");
Where the PROVIDER_URL is set to a list of host:ports where
JBoss makes JNDI remotely available.
3. Do lookups in your code without java:comp/env like:
MySessionHome home = null;
MySession session = null;
InitialContext initial = new InitialContext(env);
home = (MySessionHome)initial.lookup("MySession");
cheers
Jan
David Chen wrote:
> Hi, there:
>
> I'm a new beginner to use Jetty. Currently I'm using Jboss 2.4.8 and
> Jetty 4.2.21 "*separately*". I have ejbs deployed on jboss, and a web
> application deployed on jetty. my question is:
> how can I configure jetty (or jboss), so that my web application
> deployed on jetty can use ejbs deployed on jboss? for example, the
> jboss using localhost:1099 as jndi port.
>
> (I used to use Tomcat to connect to jboss, which I just modified
> jndi.properties in ../common/classes directory).
>
> Thanks a lot in advance
>
> David Chen
>
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise
J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
jetty-discuss mailing list
jet...@li...
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
|