Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Two phase commit transaction using WSAD5.0 and DB2

Two phase commit transaction using WSAD5.0 and DB2

2005-04-27       - By Anuj Kumar

 Back
Reply:     1     2     3     4     5     6     7     8  

?
yaa ur right but m getting theexception saying that

[4/27/05 14:15:45:401 GMT+05:30] 3b325053 WebGroup      E SRVE0026E: [Servlet
Error]-[A]: java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc
.WSJdbcDataSource
   at hello.A.getDataSource(A.java:201)
while looking and casting the jndi.

thanks
anuj

On Wed, 27 Apr 2005 Naslai,Shobha(Cognizant) wrote :
>
>The JDK 1.4 Doc says
>
>public interface XADataSource
>A factory for XAConnection objects that is used internally. An object
>that implements the XADataSource interface is typically registered with
>a naming service that uses the Java Naming and Directory InterfaceTM
>(JNDI).
>
>
>It means that whoever uses the JNDI to lookup the object should cast
>that to XADataSource right?
>
>Pls clarify.
>
>Thanks
>Shobha Naslai
>
>-- --Original Message-- --
> From: A mailing list for Java(tm) 2 Platform, Enterprise Edition
>[mailto:J2EE-INTEREST@(protected)] On Behalf Of Hrishikesh Barua
>Sent: Wednesday, April 27, 2005 1:48 PM
>To: J2EE-INTEREST@(protected)
>Subject: Re: Two phase commit transaction using WSAD5.0 and DB2
>
>Hi Anuj,
>           Application programmers are not supposed to use the
>XADataSource interface directly - it's used by the TransactionManager
>internally (in this case, the TM inside your appserver). You should use
>the DataSource interface in your application - and the appserver will
>take care of the transaction management transparently, provided you use
>either the declarative or programmatic model.
>  If you're using EJB's you can use either of them; if you're using web
>components you can use the UserTransaction API to manage your
>transactions. You datasource will automatically participate in those
>transactions (it's the responsibility of the appserver to make it
>participate in 2PC).
>  Also, the appserver never exposes the actual DataSource from the driver
>- this is to provide services like connection pooling and transaction
>management.
>  Depending on the appserver, you might also have to mark the datasource
>as transactional sometimes.
>
>Regards
>   Hrish
>-- -- Original Message -- --
> From: Anuj <mailto:anujkumar73@(protected)>  Kumar
>To: A <mailto:J2EE-INTEREST@(protected)>  mailing list for Java(tm)2
>Platform,Enterprise Edition
>Cc: Hrishikesh <mailto:hrishikesh.barua@(protected)>  Barua
>Sent: Wednesday, April 27, 2005 12:54 PM
>Subject: Re: Re: Two phase commit transaction using WSAD5.0 and DB2
>
>
>hi Harish,
>thanx for ur reply but
>         javax.sql.DataSource db2Datasource = null;
>does not work in this case since i need the instance of either
>DB2XADataSource or XADataSource class to proceed with 2 phase commit
>transaction Api's and DB2XADatasource class does not implement
>DataSource so we can't type cast too.
>any other solution ???
>
>Thanks and Regards,
>Anuj
>
>
>On Wed, 27 Apr 2005 Hrishikesh Barua wrote :
> >Hello,
> >  You should cast the object that you look up to a javax.sql.DataSource
>object. Using any proprietary APIs means your app will not run on any
>other appserver. In this case the object that you get back from the
>lookup is a WAS datasource wrapper - which is correct.
> >
> >Declare
> >          javax.sql.DataSource db2Datasource = null;
> >
> >Regards
> >  Hrish
> >  -- -- Original Message -- --
> >  From: Anuj Kumar
> >  To: J2EE-INTEREST@(protected)
> >  Sent: Wednesday, April 27, 2005 11:46 AM
> >  Subject: Two phase commit transaction using WSAD5.0 and DB2
> >
> >
> >
> >  Hi All,
> >
> >  I am trying to implement (prototype) 2 phase commit transaction
>protocol using wsad5.1 and db2.i configured the DB2XADatasource provider
>in wsad and when i try yo run my program i get
> >  [4/27/05 11:27:13:296 GMT+05:30] 1accbc8a WebGroup      E SRVE0026E:
>[Servlet Error]-[A]: java.lang.ClassCastException:
>com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
> >        at hello.A.getDataSource(A.java:196)
> >
> >  while looking up and casting the DB2XADatasource.
> >
> >  My method which is supposec to return DB2XADatasource is..
> >
> >  public static DB2XADataSource getDataSource(String jndiName) {
> >
> >            InitialContext ctx = null;
> >            DB2XADataSource db2Datasource = null;
> >            Connection conn = null;
> >
> >            try {
> >                  ctx = new InitialContext();
> >
> >                  db2Datasource = (DB2XADataSource)
>ctx.lookup(jndiName);
> >
> >
> >            } catch (NamingException ne) {
> >                  ne.printStackTrace();
> >            }
> >
> >            return db2Datasource ;
> >        }
> >
> >  }
> >
> >  can anyone Help me out ???
> >
> >  Thanks a lotttt
> >  Anuj
> >
> >
> >
> >
> >
>========================================================================
>=== To unsubscribe, send email to listserv@(protected) and include in
>the body of the message "signoff J2EE-INTEREST". For general help, send
>email to listserv@(protected) and include in the body of the message
>"help".
> >
> >=======================================================================
>====
> >To unsubscribe, send email to listserv@(protected) and include in the
>body
> >of the message "signoff J2EE-INTEREST".  For general help, send email
>to
> >listserv@(protected) and include in the body of the message "help".
> >
>
>
>  <http://clients.rediff.com/signature/track_sig.asp>
>========================================================================
>=== To unsubscribe, send email to listserv@(protected) and include in
>the body of the message "signoff J2EE-INTEREST". For general help, send
>email to listserv@(protected) and include in the body of the message
>"help".
>
>
>
>This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
>If you are not the intended recipient, please contact the sender by reply e
-mail and destroy all copies of the original message.
>Any unauthorised review, use, disclosure, dissemination, forwarding, printing
or copying of this email or any action taken in reliance on this e-mail is
strictly
>prohibited and may be unlawful.
>
>   Visit us at http://www.cognizant.com
>
>===========================================================================
>To unsubscribe, send email to listserv@(protected) and include in the body
>of the message "signoff J2EE-INTEREST".  For general help, send email to
>listserv@(protected) and include in the body of the message "help".


===========================================================================
To unsubscribe, send email to listserv@(protected) and include in the body
of the message "signoff J2EE-INTEREST".  For general help, send email to
listserv@(protected) and include in the body of the message "help".

<P>
&nbsp; <BR>
yaa ur right but m getting theexception saying that<BR>
<BR>
[4/27/05 14:15:45:401 GMT+05:30] 3b325053 WebGroup&nbsp; &nbsp; &nbsp; E
SRVE0026E: [Servlet Error]-[A]: java.lang.ClassCastException: com.ibm.ws
.rsadapter.jdbc.WSJdbcDataSource<BR>
&nbsp; &nbsp; &nbsp;at hello.A.getDataSource(A.java:201)<BR>
while looking and casting the jndi.<BR>
<BR>
thanks<BR>
anuj<BR>
<BR>
On Wed, 27 Apr 2005 Naslai,Shobha(Cognizant) wrote :<BR>
&gt;<BR>
&gt;The JDK 1.4 Doc says<BR>
&gt;<BR>
&gt;public interface XADataSource<BR>
&gt;A factory for XAConnection objects that is used internally. An object<BR>
&gt;that implements the XADataSource interface is typically registered with<BR>
&gt;a naming service that uses the Java Naming and Directory InterfaceTM<BR>
&gt;(JNDI).<BR>
&gt;<BR>
&gt;<BR>
&gt;It means that whoever uses the JNDI to lookup the object should cast<BR>
&gt;that to XADataSource right?<BR>
&gt;<BR>
&gt;Pls clarify.<BR>
&gt;<BR>
&gt;Thanks<BR>
&gt;Shobha Naslai<BR>
&gt;<BR>
&gt;-- --Original Message-- --<BR>
&gt; From: A mailing list for Java(tm) 2 Platform, Enterprise Edition<BR>
&gt;[mailto:J2EE-INTEREST@(protected)] On Behalf Of Hrishikesh Barua<BR>
&gt;Sent: Wednesday, April 27, 2005 1:48 PM<BR>
&gt;To: J2EE-INTEREST@(protected)<BR>
&gt;Subject: Re: Two phase commit transaction using WSAD5.0 and DB2<BR>
&gt;<BR>
&gt;Hi Anuj,<BR>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Application programmers are not
supposed to use the<BR>
&gt;XADataSource interface directly - it's used by the TransactionManager<BR>
&gt;internally (in this case, the TM inside your appserver). You should use<BR>
&gt;the DataSource interface in your application - and the appserver will<BR>
&gt;take care of the transaction management transparently, provided you use<BR>
&gt;either the declarative or programmatic model.<BR>
&gt;&nbsp; If you're using EJB's you can use either of them; if you're using
web<BR>
&gt;components you can use the UserTransaction API to manage your<BR>
&gt;transactions. You datasource will automatically participate in those<BR>
&gt;transactions (it's the responsibility of the appserver to make it<BR>
&gt;participate in 2PC).<BR>
&gt;&nbsp; Also, the appserver never exposes the actual DataSource from the
driver<BR>
&gt;- this is to provide services like connection pooling and transaction<BR>
&gt;management.<BR>
&gt;&nbsp; Depending on the appserver, you might also have to mark the
datasource<BR>
&gt;as transactional sometimes.<BR>
&gt;<BR>
&gt;Regards<BR>
&gt;&nbsp;  Hrish<BR>
&gt;-- -- Original Message -- --<BR>
&gt; From: Anuj &lt;mailto:anujkumar73@(protected)&gt;&nbsp; Kumar<BR>
&gt;To: A &lt;mailto:J2EE-INTEREST@(protected)&gt;&nbsp; mailing list for Java
(tm)2<BR>
&gt;Platform,Enterprise Edition<BR>
&gt;Cc: Hrishikesh &lt;mailto:hrishikesh.barua@(protected)&gt;&nbsp; Barua<BR>
&gt;Sent: Wednesday, April 27, 2005 12:54 PM<BR>
&gt;Subject: Re: Re: Two phase commit transaction using WSAD5.0 and DB2<BR>
&gt;<BR>
&gt;<BR>
&gt;hi Harish,<BR>
&gt;thanx for ur reply but<BR>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;  javax.sql.DataSource db2Datasource = null;<BR>
&gt;does not work in this case since i need the instance of either<BR>
&gt;DB2XADataSource or XADataSource class to proceed with 2 phase commit<BR>
&gt;transaction Api's and DB2XADatasource class does not implement<BR>
&gt;DataSource so we can't type cast too.<BR>
&gt;any other solution ???<BR>
&gt;<BR>
&gt;Thanks and Regards,<BR>
&gt;Anuj<BR>
&gt;<BR>
&gt;<BR>
&gt;On Wed, 27 Apr 2005 Hrishikesh Barua wrote :<BR>
&gt; &gt;Hello,<BR>
&gt; &gt;&nbsp; You should cast the object that you look up to a javax.sql
.DataSource<BR>
&gt;object. Using any proprietary APIs means your app will not run on any<BR>
&gt;other appserver. In this case the object that you get back from the<BR>
&gt;lookup is a WAS datasource wrapper - which is correct.<BR>
&gt; &gt;<BR>
&gt; &gt;Declare<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; javax.sql.DataSource db2Datasource
= null;<BR>
&gt; &gt;<BR>
&gt; &gt;Regards<BR>
&gt; &gt;&nbsp; Hrish<BR>
&gt; &gt;&nbsp; -- -- Original Message -- --<BR>
&gt; &gt;&nbsp; From: Anuj Kumar<BR>
&gt; &gt;&nbsp; To: J2EE-INTEREST@(protected)<BR>
&gt; &gt;&nbsp; Sent: Wednesday, April 27, 2005 11:46 AM<BR>
&gt; &gt;&nbsp; Subject: Two phase commit transaction using WSAD5.0 and DB2<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; Hi All,<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; I am trying to implement (prototype) 2 phase commit transaction
<BR>
&gt;protocol using wsad5.1 and db2.i configured the DB2XADatasource provider<BR>
&gt;in wsad and when i try yo run my program i get<BR>
&gt; &gt;&nbsp; [4/27/05 11:27:13:296 GMT+05:30] 1accbc8a WebGroup&nbsp; &nbsp;
&nbsp; E SRVE0026E:<BR>
&gt;[Servlet Error]-[A]: java.lang.ClassCastException:<BR>
&gt;com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; at hello.A.getDataSource(A.java:196)<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; while looking up and casting the DB2XADatasource.<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; My method which is supposec to return DB2XADatasource is..<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; public static DB2XADataSource getDataSource(String jndiName) {
<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitialContext ctx = null;
<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DB2XADataSource
db2Datasource = null;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connection conn = null;<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ctx =
new InitialContext();<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
db2Datasource = (DB2XADataSource)<BR>
&gt;ctx.lookup(jndiName);<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (NamingException ne)
{<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ne
.printStackTrace();<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return db2Datasource ;<BR>
&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; }<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; }<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; can anyone Help me out ???<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; Thanks a lotttt<BR>
&gt; &gt;&nbsp; Anuj<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt;========================================================================<BR>
&gt;=== To unsubscribe, send email to listserv@(protected) and include in<BR>
&gt;the body of the message &quot;signoff J2EE-INTEREST&quot;. For general help
, send<BR>
&gt;email to listserv@(protected) and include in the body of the message<BR>
&gt;&quot;help&quot;.<BR>
&gt; &gt;<BR>
&gt; &gt;======================================================================
=<BR>
&gt;====<BR>
&gt; &gt;To unsubscribe, send email to listserv@(protected) and include in the
<BR>
&gt;body<BR>
&gt; &gt;of the message &quot;signoff J2EE-INTEREST&quot;.&nbsp; For general
help, send email<BR>
&gt;to<BR>
&gt; &gt;listserv@(protected) and include in the body of the message &quot
;help&quot;.<BR>
&gt; &gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;&nbsp; &lt;http://clients.rediff.com/signature/track_sig.asp&gt;<BR>
&gt;========================================================================<BR>
&gt;=== To unsubscribe, send email to listserv@(protected) and include in<BR>
&gt;the body of the message &quot;signoff J2EE-INTEREST&quot;. For general help
, send<BR>
&gt;email to listserv@(protected) and include in the body of the message<BR>
&gt;&quot;help&quot;.<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
<BR>
&gt;If you are not the intended recipient, please contact the sender by reply e
-mail and destroy all copies of the original message.<BR>
&gt;Any unauthorised review, use, disclosure, dissemination, forwarding,
printing or copying of this email or any action taken in reliance on this e
-mail is strictly<BR>
&gt;prohibited and may be unlawful.<BR>
&gt;<BR>
&gt;&nbsp;  Visit us at http://www.cognizant.com<BR>
&gt;<BR>
&gt;===========================================================================
<BR>
&gt;To unsubscribe, send email to listserv@(protected) and include in the body
<BR>
&gt;of the message &quot;signoff J2EE-INTEREST&quot;.&nbsp; For general help,
send email to<BR>
&gt;listserv@(protected) and include in the body of the message &quot;help
&quot;.<BR>

</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp">
<IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com
/inbox.htm@(protected)" BORDER=0 VSPACE=0 HSPACE=0></a>

===========================================================================
To unsubscribe, send email to listserv@(protected) and include in the body
of the message "signoff J2EE-INTEREST".  For general help, send email to
listserv@(protected) and include in the body of the message "help".
<p>

©2008 junlu.com - Jax Systems, LLC, U.S.A.