[JBoss-user] RE: CompositeName and JBoss 3.0.4
Dain, If you want to learn more about CompositeName and CompoundName you can read about it in most discussions on JNDI. Basically a compound name is a name that does not span multiple namespace and works within a single heirachical naming systems, and a composite name is one that spans multiple namespaces. Here are the Java API References to both: http://java.sun.com/products/jndi/javadoc/javax/naming/CompositeName.html http://java.sun.com/products/jndi/javadoc/javax/naming/CompoundName.html 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
[JBoss-user] RE: CompositeName and JBoss 3.0.4
Scott, I understand that the CompositeName is suppose to be used for names that span Namespaces, but is appears that in all cases TopLink generates CompositeNames. The name that I am passing into their JNDIConnector is java:/XATestDS, however I wrote a simple test and it does not matter what I pass in I get back a CompositeName. It is easy to test, just download TopLink 9.0.3 from Oracle and use the following code: JNDIConnector connector = new JNDIConnector(null,java:/XATestDS); //or a valid context it is just a test. javax.naming.Name name = connector.getName(); This code does not require a database or even JBoss up, it simply constructs a JNDIConnector which is used by TopLink's other classes to lookup data sources in JNDI. You will see that the name implementation that is returned on the above getName() call is the CompositeName. So the problem is that TopLink will always attempt to use a CompositeName. 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
[JBoss-user] Re: HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource) - Followup Info
I made some progress today. My problem with Transactions was a simple one from a Oracle DataSource Standpoint. In WebLogic you do not have to set the TransactionManager using the TopLink JTSSynchronizationListener, but in JBoss you do. So the following code fixed the problem with exception using the Oracle DataSource: javax.transaction.TransactionManager tm = (TransactionManager)JNDIHelper.lookup(java:/TransactionManager); JTSSynchronizationListener.setTransactionManager(tm); I still cannot get Oracle XA DataSources to work. I am still getting the XAER_RMERR I mentioned in my first email. I believe it is that the initxa.sql/initjvm.sql script has not been run in the database. But if anyone has other ideas on the Oracle XA DataSource that would be great thanks. By the way I also found out the problem with TopLink JNDIConnector and InvalidNamingException not a CompoundName. It is not a compound name, TopLink's JNDIConnector returns a CompositeName which JBoss does not handle. After looking through the JBoss 3.0.4 code I noticed that it only seems to support CompoundName. Can anyone confirm that? Thanks Mike H. Sr. 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
[JBoss-user] CompositeName and JBoss 3.0.4
After looking at the JBoss code, it appears that JBoss only supports Compound Names and not Composite Names. I have something I am trying to hook up (TopLink), which uses Composite Names. I have no control over this, I found a work around, by I was looking for help in understanding why only Compound Name support and is there a JBoss solution. For more detail look at my post on TopLink in this forum. 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
[JBoss-user] Re: HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource
Quick HOW-TO Setting up: TopLink 9.0.3/Oracle (8.1.7,9.2,9.0)/Oracle XA DataSource/JBoss 3.0.4/JDK1.4.1 1. Run initjvm.sql and initxa.sql in the oracle databases that you will be connecting to with the Oracle XA DataSources configured in JBoss. They can be found in $ORACLE_HOME/javavm/install. 2. Get the latest Oracle JDBC Driver from http://technet.oracle.com. The one I used is the latest and is named ojdbc14.jar (not classes12.zip). 3. Copy $JBOSS_HOME/docs/examples/jca/ oracle-xa-service.xml to the appropriate $JBOSS_HOME/server/[all|default|minimal]/deploy and configure it for your database. 4. Modify $JBOSS_HOME/server/[all|default|minimal]/conf/ jboss-service.xml to include the attribute pad true for the XidFactory. It should look as follows: mbean code=org.jboss.tm.XidFactory name=jboss:service=XidFactory attribute name=Padtrue/attribute /mbean 5. In your code to connect up to JNDI using the TopLink JNDIConnector you will need to lookup and get the DataSource yourself and pass it in the JNDIConnector constructor. If you user the a jndi name string the JNDIConnector will generate a CompositeName, which results in a InvalidNamingException - not a CompoundName. It appears that CompositeNames do not work in JBoss 3.0.4. Here is some sample code: //jndiProperties are the your properties Context context = InitialContext(jndiProperties); javax.sql.DataSource ds = (javax.sql.DataSource) context.lookup( java:/XATestDS); JNDIConnector connector = new JNDIConnector(ds); login.setConnector(connector); 6. You will need to write code to lookup and get the JBoss TransactionManager and then use the TopLink JTSSynchronizationListener to set the transaction manager so TopLink knows about it. The following code is an example: import javax.transaction.TransactionManager; import oracle.toplink.jts.*; .. TransactionManager tm = (TransactionManager)context.lookup( transactionMgrJndiName); JTSSynchronizationListener. setTransactionManager(tm); 7. Finally you need to also set in TopLink the the external JTS Controller class and let TopLink know you want to use external transactions. The generic TopLink class JTSExternalTransactionController seems to work so far. An example: login.useExternalTransactionController(); String jtsControllerClassName = JTSExternalTransactionController; Class jtsControllerClass = Thread .currentThread() .getContextClassLoader() .loadClass( jtsControllerClassName); ExternalTransactionController jtsController = (ExternalTransactionController) jtsControllerClass .newInstance(); serverSession.setExternalTransactionController( jtsController); login.useExternalConnectionPooling(); That does it. Hopefully this helps others who may struggle as well. 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
[JBoss-user] Re: HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource
Turns out that initxa.sql and initjvm.sql had not been run in the database I was trying to connect to. I confirmed this by connecting to a database that has JAVA_XA installed and the Oracle XA DataSource worked fine. 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
[JBoss-user] HELP - JBoss 3.0.4/Oracle TopLink 9.0.3/JTS/Oracle (XADataSource/DataSource)
) 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