Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Jon Wingfield
The answer's in the question ;)
Tomcat is not a J2EE Server but an implementation of the Servlet 
Specification (which is but a part of the whole J2EE spec).
Tomcat's JNDI lookups are in-process only.

Need an open source J2EE container? Have a look at JBoss...

Hassan Sajjad wrote:
Hi

Can anyone help!

Problem with UserTransaction reference within Servlet code.

When you reference UserTransaction object in your Servlet Code, as from J2EE Specification: The J2EE Product Provider is responsible for providing an appropriate object as required 

There's a code snippet.

Context initCtx = new InitialContext();
UserTransaction tx = (UserTransaction)initCtx.lookup(java:comp/UserTransaction);
This works fine on J2EE Impementation Servers but fails on Tomcat 4.1.3. 

Exception:

javax.naming.NameNotFoundException: Name javax.transaction.UserTransaction is not 
bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
 
Thanks
Hassan
PREMIER HOUSEWARES 
Premier Business Park, 55 Jordanvale Avenue 
Whiteinch Glasgow G14 0QP
UK 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Hassan Sajjad
Jon Wingfield, thanks for your reply.

My application is a Web Application (.war) only, no ejb's etc. However,
since I'm using Composite View Pattern (aka Templating), I want different
parts to be combined into One View, all in one transaction. This is done in
a Servlet.
Now if Tomcat doesn't provide a reference to an implementation of
javax.transaction.UserTransaction, through JNDI lookup, then I believe there
must be some other of doing this. e.g. Using a third party package that
provides the implementation of javax.transaction api and plugging it in the
application. Do you know of any?

Remember, after all this is on the Web Tier, Tomcat tier, there must be a
way of doing it!

Thanks
Hassan


- Original Message - 
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 11:25 AM
Subject: Re: Problem with UserTransaction reference within Servlet code.


 The answer's in the question ;)
 Tomcat is not a J2EE Server but an implementation of the Servlet
 Specification (which is but a part of the whole J2EE spec).
 Tomcat's JNDI lookups are in-process only.

 Need an open source J2EE container? Have a look at JBoss...

 Hassan Sajjad wrote:
  Hi
 
  Can anyone help!
 
  Problem with UserTransaction reference within Servlet code.
 
  When you reference UserTransaction object in your Servlet Code, as from
J2EE Specification: The J2EE Product Provider is responsible for providing
an appropriate object as required 
 
  There's a code snippet.
 
  Context initCtx = new InitialContext();
  UserTransaction tx =
(UserTransaction)initCtx.lookup(java:comp/UserTransaction);
 
  This works fine on J2EE Impementation Servers but fails on Tomcat 4.1.3.
 
  Exception:
 
  javax.naming.NameNotFoundException: Name
javax.transaction.UserTransaction is not bound in this Context
  at
org.apache.naming.NamingContext.lookup(NamingContext.java:811)
  at
org.apache.naming.NamingContext.lookup(NamingContext.java:194)
  at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
  at javax.naming.InitialContext.lookup(InitialContext.java:347)
 
 
  Thanks
  Hassan
  PREMIER HOUSEWARES
  Premier Business Park, 55 Jordanvale Avenue
  Whiteinch Glasgow G14 0QP
  UK



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Jon Wingfield
There is always a way ;)

Saw this the other day:
http://www.theserverside.com/discussions/thread.tss?thread_id=24879
Googled for this for JTA integration with tomcat:
http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html
JNDI config for tomcat:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html
Have fun,

Jon

Hassan Sajjad wrote:

Jon Wingfield, thanks for your reply.

My application is a Web Application (.war) only, no ejb's etc. However,
since I'm using Composite View Pattern (aka Templating), I want different
parts to be combined into One View, all in one transaction. This is done in
a Servlet.
Now if Tomcat doesn't provide a reference to an implementation of
javax.transaction.UserTransaction, through JNDI lookup, then I believe there
must be some other of doing this. e.g. Using a third party package that
provides the implementation of javax.transaction api and plugging it in the
application. Do you know of any?
Remember, after all this is on the Web Tier, Tomcat tier, there must be a
way of doing it!
Thanks
Hassan
- Original Message - 
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 11:25 AM
Subject: Re: Problem with UserTransaction reference within Servlet code.



The answer's in the question ;)
Tomcat is not a J2EE Server but an implementation of the Servlet
Specification (which is but a part of the whole J2EE spec).
Tomcat's JNDI lookups are in-process only.
Need an open source J2EE container? Have a look at JBoss...

Hassan Sajjad wrote:

Hi

Can anyone help!

Problem with UserTransaction reference within Servlet code.

When you reference UserTransaction object in your Servlet Code, as from
J2EE Specification: The J2EE Product Provider is responsible for providing
an appropriate object as required 
There's a code snippet.

Context initCtx = new InitialContext();
UserTransaction tx =
(UserTransaction)initCtx.lookup(java:comp/UserTransaction);

This works fine on J2EE Impementation Servers but fails on Tomcat 4.1.3.

Exception:

javax.naming.NameNotFoundException: Name
javax.transaction.UserTransaction is not bound in this Context

   at
org.apache.naming.NamingContext.lookup(NamingContext.java:811)

   at
org.apache.naming.NamingContext.lookup(NamingContext.java:194)

   at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)

   at javax.naming.InitialContext.lookup(InitialContext.java:347)

Thanks
Hassan
PREMIER HOUSEWARES
Premier Business Park, 55 Jordanvale Avenue
Whiteinch Glasgow G14 0QP
UK


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Jon Wingfield
And of course:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Tyrex%20Connection%20Pool
Although I'm not sure how actively maintained Tyrex is these days.
http://sourceforge.net/projects/tyrex/
Jon

Jon Wingfield wrote:

There is always a way ;)

Saw this the other day:
http://www.theserverside.com/discussions/thread.tss?thread_id=24879
Googled for this for JTA integration with tomcat:
http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html
JNDI config for tomcat:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html
Have fun,

Jon

Hassan Sajjad wrote:

Jon Wingfield, thanks for your reply.

My application is a Web Application (.war) only, no ejb's etc. However,
since I'm using Composite View Pattern (aka Templating), I want different
parts to be combined into One View, all in one transaction. This is 
done in
a Servlet.
Now if Tomcat doesn't provide a reference to an implementation of
javax.transaction.UserTransaction, through JNDI lookup, then I believe 
there
must be some other of doing this. e.g. Using a third party package that
provides the implementation of javax.transaction api and plugging it 
in the
application. Do you know of any?

Remember, after all this is on the Web Tier, Tomcat tier, there must be a
way of doing it!
Thanks
Hassan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Hassan Sajjad
This looks very promising Jon.

Thanks a lot mate.

- Original Message - 
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 12:58 PM
Subject: Re: Problem with UserTransaction reference within Servlet code.


 And of course:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Tyrex%20Connection%20Pool

 Although I'm not sure how actively maintained Tyrex is these days.
 http://sourceforge.net/projects/tyrex/

 Jon

 Jon Wingfield wrote:

  There is always a way ;)
 
  Saw this the other day:
  http://www.theserverside.com/discussions/thread.tss?thread_id=24879
 
  Googled for this for JTA integration with tomcat:
  http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html
 
  JNDI config for tomcat:
 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html
 
  Have fun,
 
  Jon
 
  Hassan Sajjad wrote:
 
  Jon Wingfield, thanks for your reply.
 
  My application is a Web Application (.war) only, no ejb's etc. However,
  since I'm using Composite View Pattern (aka Templating), I want
different
  parts to be combined into One View, all in one transaction. This is
  done in
  a Servlet.
  Now if Tomcat doesn't provide a reference to an implementation of
  javax.transaction.UserTransaction, through JNDI lookup, then I believe
  there
  must be some other of doing this. e.g. Using a third party package that
  provides the implementation of javax.transaction api and plugging it
  in the
  application. Do you know of any?
 
  Remember, after all this is on the Web Tier, Tomcat tier, there must be
a
  way of doing it!
 
  Thanks
  Hassan



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Hassan Sajjad
Thanks Jon, the resource you mentioned at ONJava did the magic. It's
excellent tutorial-type Article, for anyone interested in knowledge reading.
It's
http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html?page=1

Rgds
Hassan

- Original Message - 
From: Hassan Sajjad [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 1:17 PM
Subject: Re: Problem with UserTransaction reference within Servlet code.


 This looks very promising Jon.

 Thanks a lot mate.

 - Original Message - 
 From: Jon Wingfield [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Tuesday, April 06, 2004 12:58 PM
 Subject: Re: Problem with UserTransaction reference within Servlet code.


  And of course:
 

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Tyrex%20Connection%20Pool
 
  Although I'm not sure how actively maintained Tyrex is these days.
  http://sourceforge.net/projects/tyrex/
 
  Jon
 
  Jon Wingfield wrote:
 
   There is always a way ;)
  
   Saw this the other day:
   http://www.theserverside.com/discussions/thread.tss?thread_id=24879
  
   Googled for this for JTA integration with tomcat:
   http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html
  
   JNDI config for tomcat:
  
 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html
  
   Have fun,
  
   Jon
  
   Hassan Sajjad wrote:
  
   Jon Wingfield, thanks for your reply.
  
   My application is a Web Application (.war) only, no ejb's etc.
However,
   since I'm using Composite View Pattern (aka Templating), I want
 different
   parts to be combined into One View, all in one transaction. This is
   done in
   a Servlet.
   Now if Tomcat doesn't provide a reference to an implementation of
   javax.transaction.UserTransaction, through JNDI lookup, then I
believe
   there
   must be some other of doing this. e.g. Using a third party package
that
   provides the implementation of javax.transaction api and plugging it
   in the
   application. Do you know of any?
  
   Remember, after all this is on the Web Tier, Tomcat tier, there must
be
 a
   way of doing it!
  
   Thanks
   Hassan
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Guy Pardon
Hi,

True, it's nicely written but it suggests things that JOTM has never  
been able to do.

In particular, JOTM is not a fully functional transaction manager and  
will not recover your databases after restart or crash - meaning that  
the claim that it makes your application robust is to be taken with at  
least a few grains of salt (especially if you value data integrity)...

Of course, one will probably say that I'm biased in what I value to be  
important in a JTA ;-)

Best regards,

Guy

On dinsdag, apr 6, 2004, at 15:10 Europe/Brussels, Hassan Sajjad wrote:

Thanks Jon, the resource you mentioned at ONJava did the magic. It's
excellent tutorial-type Article, for anyone interested in knowledge  
reading.
It's
http://www.onjava.com/pub/a/onjava/2003/07/30/ 
jotm_transactions.html?page=1

Rgds
Hassan
- Original Message -
From: Hassan Sajjad [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 1:17 PM
Subject: Re: Problem with UserTransaction reference within Servlet  
code.


This looks very promising Jon.

Thanks a lot mate.

- Original Message -
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 12:58 PM
Subject: Re: Problem with UserTransaction reference within Servlet  
code.


And of course:


http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource- 
examples-howto.html#Tyrex%20Connection%20Pool
Although I'm not sure how actively maintained Tyrex is these days.
http://sourceforge.net/projects/tyrex/
Jon

Jon Wingfield wrote:

There is always a way ;)

Saw this the other day:
http://www.theserverside.com/discussions/thread.tss?thread_id=24879
Googled for this for JTA integration with tomcat:
http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html
JNDI config for tomcat:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources- 
howto.html
Have fun,

Jon

Hassan Sajjad wrote:

Jon Wingfield, thanks for your reply.

My application is a Web Application (.war) only, no ejb's etc.
However,
since I'm using Composite View Pattern (aka Templating), I want
different
parts to be combined into One View, all in one transaction. This is
done in
a Servlet.
Now if Tomcat doesn't provide a reference to an implementation of
javax.transaction.UserTransaction, through JNDI lookup, then I
believe
there
must be some other of doing this. e.g. Using a third party package
that
provides the implementation of javax.transaction api and plugging  
it
in the
application. Do you know of any?

Remember, after all this is on the Web Tier, Tomcat tier, there  
must
be
a
way of doing it!

Thanks
Hassan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Dr. Guy Pardon ( [EMAIL PROTECTED] )
Atomikos: Your Partner for Reliable eBusiness Coordination
http://www.atomikos.com/
The information in this email is confidential and only meant for the  
addressee(s). The content of this email is informal and will not be  
legally binding for Atomikos.



Re: Problem with UserTransaction reference within Servlet code.

2004-04-06 Thread Guy Pardon
Thanks Hassan,

It's always good to receive useful feedback.
Maybe we should also publish a light-weight release that doesn't do  
recovery...

Kind of like a 50% JTA.
(Actually, that doesn't sound too bad;-)
Thanks,
Best,
Guy

On dinsdag, apr 6, 2004, at 15:50 Europe/Brussels, Hassan Sajjad wrote:

Guy, I've seen the alternative product at
http://www.atomikos.com/download.html, it seems good, however in my  
instance
I only require transaction support to make a composite view from more  
than
one JSP pages (Templating), and I want this to be done in a  
transaction. Due
to this reason I'm not concerned if JOTM does not support database  
crash
etc.

Cheers
Hassan
- Original Message -
From: Guy Pardon [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 2:26 PM
Subject: Re: Problem with UserTransaction reference within Servlet  
code.


Hi,

True, it's nicely written but it suggests things that JOTM has never
been able to do.
In particular, JOTM is not a fully functional transaction manager  
and
will not recover your databases after restart or crash - meaning that
the claim that it makes your application robust is to be taken with at
least a few grains of salt (especially if you value data integrity)...

Of course, one will probably say that I'm biased in what I value to be
important in a JTA ;-)
Best regards,

Guy

On dinsdag, apr 6, 2004, at 15:10 Europe/Brussels, Hassan Sajjad  
wrote:

Thanks Jon, the resource you mentioned at ONJava did the magic. It's
excellent tutorial-type Article, for anyone interested in knowledge
reading.
It's
http://www.onjava.com/pub/a/onjava/2003/07/30/
jotm_transactions.html?page=1
Rgds
Hassan
- Original Message -
From: Hassan Sajjad [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 1:17 PM
Subject: Re: Problem with UserTransaction reference within Servlet
code.

This looks very promising Jon.

Thanks a lot mate.

- Original Message -
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 12:58 PM
Subject: Re: Problem with UserTransaction reference within Servlet
code.

And of course:


http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-
examples-howto.html#Tyrex%20Connection%20Pool
Although I'm not sure how actively maintained Tyrex is these days.
http://sourceforge.net/projects/tyrex/
Jon

Jon Wingfield wrote:

There is always a way ;)

Saw this the other day:
http://www.theserverside.com/discussions/ 
thread.tss?thread_id=24879

Googled for this for JTA integration with tomcat:
http://www.onjava.com/pub/a/onjava/2003/07/30/ 
jotm_transactions.html

JNDI config for tomcat:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-
howto.html
Have fun,

Jon

Hassan Sajjad wrote:

Jon Wingfield, thanks for your reply.

My application is a Web Application (.war) only, no ejb's etc.
However,
since I'm using Composite View Pattern (aka Templating), I want
different
parts to be combined into One View, all in one transaction. This  
is
done in
a Servlet.
Now if Tomcat doesn't provide a reference to an implementation of
javax.transaction.UserTransaction, through JNDI lookup, then I
believe
there
must be some other of doing this. e.g. Using a third party  
package
that
provides the implementation of javax.transaction api and plugging
it
in the
application. Do you know of any?
Remember, after all this is on the Web Tier, Tomcat tier, there
must
be
a
way of doing it!

Thanks
Hassan


--- 
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:  
[EMAIL PROTECTED]



 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Dr. Guy Pardon ( [EMAIL PROTECTED] )
Atomikos: Your Partner for Reliable eBusiness Coordination
http://www.atomikos.com/
The information in this email is confidential and only meant for the
addressee(s). The content of this email is informal and will not be
legally binding for Atomikos.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Dr. Guy Pardon ( [EMAIL PROTECTED] )
Atomikos: Your Partner for Reliable eBusiness Coordination
http://www.atomikos.com/
The information in this email is confidential and only meant for the  
addressee(s). The content of this email is informal and will not be  
legally binding for Atomikos.