[JBoss-user] HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource)

2003-01-02 Thread Michael Huneycutt
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 

Re: [JBoss-user] HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource)

2003-01-02 Thread David Jencks
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:
 

RE: [JBoss-user] HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource)

2003-01-02 Thread Sasidharan, Manoj
Hello Mike,

Here are a few things I would check:

a. Check if the XA datasource is getting created successfully (XATestDS)
Note: Just deploying the oracle-xa-service.xml or oracle-xa-ds.xml will not
be enough. Try writing a small j2ee app (a Entity Bean that uses this
datasource) and deploy it.

b. For using XA with Oracle, Oracle JVM should be initialised. Have you run
this setup on the Oracle instance??

c. If (a) works fine, try doing the setup for TopLink
Questions:
1. Does Top Link work using an external Transaction Manager server (TMS)?
2. I think it works with Tuxedo.. Is it from BEA??
3. Could you get this to work with BEA WLS?

I have setup Oracle XA datasource using JBoss3.2 and it works fine. We are
not using Top Link.

HTH
regards
MS

-Original Message-
From: David Jencks [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] HELP - JBoss 3.0.4/Oracle TopLink
9.0.3/JTS/Oracle (XADataSource/DataSource)


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