Your post leaves, for me, more questions unanswered than answered.  I don't
have toplink nor oracle and probably can't get them...

I don't recommend using xa on jboss 3.0.x.  The support in 3.2 works
better.  There are various settings you have to make to  make Oracle xa
work with jboss: most or all of these are in the 3.2 oracle-xa-ds.xml.

Is toplink running in the same vm as jboss? If so you should not use
localhost:1099 in the jndi properties: it will prevent toplink from finding
anything in the java: context.  If not, you can't get to anything in the
java: context.


I'm not very familiar with jts.  Does it have a synchronization scheme
other than javax.transaction.Synchronization?  If that is what you are
using, how does whatever is registering the synchronization finding the
correct transaction to register it with?  How does it detect that it is
time to think about registering a synchronization?

Can you show the actual exception thrown from within
BaseConnectionManager2?

Thanks

I will be away from email until the weekend, so if you post on the jca
forum I might be able to respond more quickly.

david jencks



On 2003.01.02 12:25:26 -0500 Michael Huneycutt wrote:
> I have be looking through the posts and have not found much so 
> I wanted to ask the question myself. My configuration is JDK1.4.1_01, 
> Oracle 8.1.7, JBoss 3.0.4, Oracle TopLink 9.0.3 and I am using BMP for 
> my EJBs.  I am trying to configure TopLink with External JTS  so the 
> TopLink can participate in transactions, also I am use the Oracle XA 
> DataSource because some persistence may span database connections. 
> 
> I copy the oracle-xa-service.xml from docs/examples/jca into
> server/all/deploy.  
> I then modify the configuration for my database, I am using the oracle 
> thin driver, but I did try the OCI8 driver.  Also I am using the JDK 1.4 
> Oracle 9.2 JDBC Drivers. 
> 
> I startup JBoss so far so good.  But when I attempt to integrate with 
> TopLink I get the following problems: 
> 
> 1. Using the TopLink JNDIConnector I the following exception: 
>  
>     ERROR [STDERR] LOCAL EXCEPTION STACK: 
>     EXCEPTION [TOPLINK-7060] (TopLink - 9.0.3 (Build 423)): 
>         oracle.toplink.exceptions.ValidationException
>     EXCEPTION DESCRIPTION: Cannot acquire data source 
>         [XATestDS].
>     INTERNAL EXCEPTION: javax.naming.InvalidNameException: 
>         Not a compound name: XATestDS
> 
>   The exception occurs wheter I specify initial context
>   properties such as Provider URL, Context Factory and Package,
>   or use the defaults from the container. I have tried every
>   combination to no avail.  Below is the code:
>   
>         DatabaseLogin login = project.getLogin();
>       Hashtable jndiProperties = new Hashtable();
>       jndiProperties.put(Context.PROVIDER_URL, 
>                  "jnp://localhost:1099);
>       jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,
>                  "org.jnp.interfaces.NamingContextFactory");
>       jndiProperties.put(Context.URL_PKG_PREFIXES,
>                  "org.jboss.naming:org.jnp.interfaces");
>       Context context = InitialContext(jndiProperties);
>       JNDIConnector connector = new JNDIConnector(context,
>                         "java:/XATestDS");
>         login.setConnector(connector);
>         ........
>         serverSession.login();  <- This is when it occurs. 
> 
>   However I did find that I was able to get past the Invalid 
>   Naming exception with this code. Basically I get the DataSource
>   myself and then pass it to the JNDIConnector. 
> 
>         DatabaseLogin login = project.getLogin();
>       Hashtable jndiProperties = new Hashtable();
>       jndiProperties.put(Context.PROVIDER_URL, 
>                  "jnp://localhost:1099);
>       jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,
>                  "org.jnp.interfaces.NamingContextFactory");
>       jndiProperties.put(Context.URL_PKG_PREFIXES,
>                  "org.jboss.naming:org.jnp.interfaces");
>       Context context = InitialContext(jndiProperties);
>         
>       javax.sql.DataSource ds =
>               (javax.sql.DataSource) JNDIHelper.lookup(
>                       "java:/XATestDS");
>       JNDIConnector connector = new JNDIConnector(ds);
>         login.setConnector(connector);
>         ........
>         serverSession.login();  No Exceptions.
> 
> So I got past the naming exceptions. My guess is that form some reason 
> TopLink if converting java:/XATestDS to XATestDS as other servers 
> like WebLogic use this form of naming. But that is pure speculation, 
> I am debugging to see if that is the case. 
> 
> So I get past this problem only to find that neither an Oracle 
> XADataSource nor a regular Oracle DataSource will work. 
> I get exceptions in both cases. I have read on the forums that
> the Oracle XA DataSource has problems, but I use it in WebLogic
> and WebSphere pretty regularly without issue, so I am not sure
> what the forum users means by buggy.  With the following code 
> and the Oracle XA DataSource:
> 
>    login.useExternalTransactionController();
>       String jtsControllerClassName =
>                  oracle.toplink.jts.JTSExternalTransactionController
>    Class jtsControllerClass =
>       Thread.currentThread().getContextClassLoader().loadClass(jtsCon
>         trollerClassName);
>    ExternalTransactionController jtsController =
>       (ExternalTransactionController) jtsControllerClass.newInstance();
>    serverSession.setExternalTransactionController(jtsController);
>    login.useExternalConnectionPooling();
> 
> The class oracle.toplink.jts.JTSExternalTransactionController implements
> the 
> registration of a synchronization object according to the JTS 1.0
> standard.  Since
> there is not JTSExternalTransactionController for JBoss supplied with
> TopLink as there
> is in WebLogic and WebSphere, I had to use the generic one provided. 
> With the above code 
> and an Oracle XA DataSource I get the following exception: 
> 
>       at org.jboss.resource.connectionmanager.
>               BaseConnectionManager2.allocateConnection
>                (BaseConnectionManager2.java:534)
>       at org.jboss.resource.connectionmanager.BaseConnectionManager2$
>               ConnectionManagerProxy.
>               allocateConnection(BaseConnectionManager2.java:814)
>       at org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(
>               JDBCDataSource.java:131)
>       at oracle.toplink.jndi.JNDIConnector.connect(Unknown Source)
>       at oracle.toplink.sessions.DatabaseLogin.connect(Unknown Source)
>       at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown
> Source)
>       at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown
> Source)
>       at oracle.toplink.threetier.ConnectionPool.buildConnection(Unknown
> Source)
>       at oracle.toplink.threetier.ExternalConnectionPool.startUp(Unknown
> Source)
>       at oracle.toplink.threetier.ServerSession.connect(Unknown
> Source)
>       at oracle.toplink.publicinterface.DatabaseSession.login(Unknown
> Source)
> 
> 
> When I use the above code with a plain old Oracle DataSource I get a
> NullPointer 
> exception pointing with a message stating an exception occured within
> JTS.  
> I initiate a read first which works fine with the Oracle DataSource, but
> even 
> reads fail with the Oracle XA DataSource.  The stack trace is the
> following:
>  
>       at oracle.toplink.exceptions.ValidationException.jtsExceptionRai
>                sed(Unknown Source)
>        at oracle.toplink.jts.AbstractExternalTransactionController.getA
>                ctiveUnitOfWork(Unknown Source)
>        at oracle.toplink.publicinterface.Session.getActiveUnitOfWork(Un
> 
>    INTERNAL STACK TRACE: 
>        java.lang.NullPointerException
>            at oracle.toplink.jts.JTSExternalTransactionController.getExtern
>                 alTransaction(Unknown Source)
>            at oracle.toplink.jts.AbstractExternalTransactionController.getA
>                 ctiveUnitOfWork(Unknown Source)
>            at oracle.toplink.publicinterface.Session.getActiveUnitOfWork(Un
>                 known Source)
> 
> 
> Any help in this situation would be greatly appreciated. 
> 
> Thanks 
> 
> Mike H. Sr.
>                                                               
> Michael Huneycutt Sr.
> TRC - A perotsystems* Company
> Email: [EMAIL PROTECTED] 
> Office FL: (813) 891-6084 x47395
> Office VA: (804) 934-0977
> Cell: (804) 304-7655
> URL:   www.trcinc.com
>            www.perotsys.com
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to