Sorry, I've never use the ClientUserTransaction class so I won't be of
further help.  Having used JBoss for quite awhile now, I would be very
surprised if this class was designed only to use the default set of
connection properties - just doesn't fit with the general pluggability built
into the rest of JBoss.  Hopefully Ole will pop in.  I just did a quick
browse of the 2.4.4 code and it looks like all that code is meant to be
executed on the server, which would explain why the default InitialContext
is used.  But again, hopefully someone who knows what they are talking about
will join the discussion.

----- Original Message -----
From: "Jon Swinth" <[EMAIL PROTECTED]>
To: "Guy Rouillier" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 11:27 AM
Subject: Re: Never ending etandalone Tomcat issues


> Thanks Guy, for the response.  That is the way I used to do things.
However,
> there is code in org.jboss.tm.usertx.client.ClientUserTransaction that
calls new InitialContext()
> when you are trying to use a transaction from Tomcat.  If I don't use
jndi.properties then the
> client transaction will not work.  Much of the JBoss development is geared
toward embedded
> Tomcat/Jetty so I don't know whether this issue would qualify for a bug.
I am certainly finding
> it difficult to be able to separate Tomcat and JBoss.  Looks like I will
be limited to a physical
> two-tier application even if I have written the code as three-tier or
n-tier.
>
> On Sunday 23 June 2002 12:23 pm, [EMAIL PROTECTED]
wrote:
> > From: "Guy Rouillier" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Subject: Re: [JBoss-user] Never ending etandalone Tomcat issues
> > Date: Sun, 23 Jun 2002 01:06:20 -0400
> > Reply-To: [EMAIL PROTECTED]
> >
> > I wouldn't recommend putting jndi.properties into the Tomcat classpath,
> > because then you are restricting everyone using that instance of Tomcat
to
> > those settings. What we do is to include the home and object creation
into
> > a header file, and include that header file on each jsp page that needs
to
> > get to JBoss (equivalent things can be done for servlets). Here is what
> > our header looks like:
> >
> > java.util.Hashtable env = new java.util.Hashtable();
> > env.put("java.naming.factory.initial", INITIAL_FACTORY);
> > env.put("java.naming.provider.url", aJndiURL);
> > env.put("java.naming.factory.url.pkgs", URL_FACTORY);
> > ctx = new InitialContext(env);
> >
> > Object ref = ctx.lookup("xxxxxxx");
> > home =
> > (AuthenticationHome)PortableRemoteObject.narrow(ref,xxxxxxx.class);
> > obj = home.create();
> >
> > A page that needs to connect to JBoss then would looks something like
this:
> >
> > <%@ include file="/common/html/nccheader.jsp" %>
> >
> > <%
> > obj.callSomeMethod(....);
> > %>
> >
> > If you have multiple objects you need to lookup, maybe just setting up
the
> > initial context in the header would be better, then getting the home and
> > remote references can be done on the pages.
>




-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to