[WAS6 / Spring / MDB] UserTransaction not not found?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Application Server > [WAS6 / Spring / MDB] UserTransaction not not found?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [WAS6 / Spring / MDB] UserTransaction not not found?  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-06-06 10:55 PM

We've got an application running on JBoss 4.0.2 that we're currently porting
 to WebSphere 6. The application uses Spring and Hibernate, and is built wit
h ant and xdoclet.

In porting the application we've run into a problem with JMS, as we get a ja
vax.naming.NameNotFoundException for java:comp/UserTransaction (I understand
 this the "new home" for the UserTransaction object in WAS6 as opposed to th
e "old home" in WAS5, jta/u
sertransaction).

At this point, I don't know if the issue is in our code, in the Spring Frame
work, or in my configuration of WebSphere, but as I'm a complete WebSphere n
ovice, I wouldn't be at all surprised if it is the latter!

To help illustrate my problem, I've created a dummy HelloMDB project and a s
tep-by-step summary of what I do to configure WebSphere. Currently I'm exper
iencing three problems -

1) At deployment I get an ADMA8019E warning with my Activation Specification
.
2) At deployment I get an ADMA0138W warning with my Activation Specification
.
3) At run-time I get a javax.naming.NameNotFoundException for java:comp/User
Transaction

The HelloMDB project (with source, build and configuration scripts, spring and xdoclet 
libraries, and deployment descriptors) is available as a 4 MB zip file from http:/
/www.mindbend.demon.co.uk/EchoMDB.zip (though you'll need to supply your own
 JDK1.4 an
d Ant installation). I'll be happy to post scripts and config files here, I 
just didn't want to clutter up the thread if there's an easy, obvious soluti
on that I've missed!

I'm really at my wits' end on this one, and would greatly appreciate any and
 all hints or suggestions on this matter.

Thanks for your help,

=Per





[ Post a follow-up to this message ]



    Re: [WAS6 / Spring / MDB] UserTransaction not not found?  
Paul Ilechko


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-06-06 10:55 PM

per.hammer@vamosa.com wrote:
> We've got an application running on JBoss 4.0.2 that we're currently
> porting to WebSphere 6. The application uses Spring and Hibernate,
> and is built with ant and xdoclet.
>
> In porting the application we've run into a problem with JMS, as we
> get a javax.naming.NameNotFoundException for
> java:comp/UserTransaction (I understand this the "new home" for the
> UserTransaction object in WAS6 as opposed to the "old home" in WAS5,
> jta/usertransaction).
>

Not sure what the specifics of your problem are, but using user
transactions with MDBs is not a very good idea, as you can lose
messages. Ideally if you want guaranteed delivery you should be using
container managed transactions. By the time you start a user transaction
the message has already been read outside of that transaction. If your
transaction rolls back, the message has already been consumed, and is lost.





[ Post a follow-up to this message ]



    Re: [WAS6 / Spring / MDB] UserTransaction not not found?  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-06-06 10:55 PM

You may find these links helpful. Please post a reply if you find the soulti
on.
o http://forum.springframework.org/showthread.php?t=20088
o http://www.springframework.org/docs...nsactionManager(javax.transaction.TransactionMa
nager)
o http://www-128.ibm.com/developerwor... />
brown.html

Cheers,
Trond Arve






[ Post a follow-up to this message ]



    Re: [WAS6 / Spring / MDB] UserTransaction not not found?  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 10:56 PM

I figured it out.

We were using dentical (Spring) bean factory configuration files inside both
 the Servlet and EJB containers. The UserTransaction is found as expected in
 the Servlet container, but isn't available in the EJB container (presumably
 because we only have MDBs
defined).

I've now rewritten the EJB side bean factory configuration to remove the Tra
nsactionFactory wrapper around our beans, and it's working. (Though I had to
 upgrade to Hibernate3.2-alpha and Spring 1.2.7 in the process.)

I'm still left with ADMA8019E and ADMA0138W warnings at deployment relating 
to my Activation Specifications, though, but it seems to be working so I'll 
investigate those later.

Thanks to everyone for the help!

Cheers,

=Per





[ Post a follow-up to this message ]



    Re: [WAS6 / Spring / MDB] UserTransaction not not found?  
Randy Schnier


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 10:56 PM

Here's the most likely reason your MDB's java:comp/UserTransaction
lookup is failing:

As outlined in the JavaEE specs, the EJB container is only supposed to
make java:comp/UserTransaction available in the component-specific JNDI
namespace if the EJB has been configured for bean-managed transactions.
If the EJB is configured for container-managed transactions (the
default), java:comp/UserTransaction won't be available in that EJB's
namespace (again, per the JavaEE specs).  Recall that there's an
individual java:comp namespace maintained by the container for each EJB
component being hosted by that container.  The presence or absence of
java:comp/UserTransaction in that namespace isn't determined by bean
type (MDB vs. SLSB, etc.) but by transaction management type (CMT vs. BMT).

As Paul mentioned in a previous posting on this thread, configuring
message-driven beans for bean-managed transactions is not a good
practice since you can easily lose messages if the transaction is forced
to roll back.

per.hammer@vamosa.com wrote:
> I figured it out.
>
> We were using dentical (Spring) bean factory configuration files inside both the S
ervlet and EJB containers. The UserTransaction is found as expected in the Servlet c
ontainer, but isn't available in the EJB container (presumably because we only have 
MDB
s defined).
>
> I've now rewritten the EJB side bean factory configuration to remove the T
ransactionFactory wrapper around our beans, and it's working. (Though I had 
to upgrade to Hibernate3.2-alpha and Spring 1.2.7 in the process.)
>
> I'm still left with ADMA8019E and ADMA0138W warnings at deployment relatin
g to my Activation Specifications, though, but it seems to be working so I'l
l investigate those later.
>
> Thanks to everyone for the help!
>
> Cheers,
>
> =Per





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:15 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register