Developing and Deploying Services in Java on Tuxedo 12c is Easy and Straightforward by Todd Little, Oracle Tuxedo Chief Architect

One of the 187 new features in Tuxedo 12c is the ability to develop Tuxedo services in Java.  Prior to Tuxedo 12c, to create a Tuxedo service in Java meant adding another application server such as WebLogic Server or IBM WebSphere to the environment and using either the WebLogic Tuxedo Connector (WTC) or the Tuxedo JCA Adapter.  The service was then developed in Java, deployed to the Java EE application server, and then connected to existing Tuxedo applications via the Tuxedo domain gateway.  This meant that every request from Tuxedo to these Java services entailed a network hop and any distributed transactions required a subordinate transaction to be started in the Java EE application server.  As well, any native Tuxedo service called by the Java service now required another network hop--all in all usable, but requiring more administration, more resources, and more complexity.

Java Server Support

The Java Server support in Tuxedo uses a POJO programming model based upon Java SE.  The programming environment and APIs used for service development is JATMI, the same API used in WTC.  JATMI is essentially an object oriented version of the standard Tuxedo Application to Transaction Monitor Interface (ATMI).  It supports virtually all of the ATMI features and should be very familiar to anyone that has developed Tuxedo services in another language.  Yet Java developers have access to the rich set of class libraries that Java developers have come to know and love.  Since the environment is Java SE based, Java EE features such as transaction management are provided by the JATMI classes instead of the Java Transaction API.

Developing & Deploying Java Service on Tuxedo is easy

Developing and deploying services in Java on Tuxedo is extremely easy and straightforward.  The basic steps are to create a Java class that extends the TuxedoJavaServer class provided by JATMI.  Create one or more methods that will handle Tuxedo service requests.  These methods take a TPSVCINFO instance as the only parameter that contains such information as the name of the service called and the typed buffer the caller passed to the service.  The method extracts whatever information it needs from the typed buffer, performs its business logic and then creates a typed buffer to reply to the caller.  Finally the class calls the tpreturn() method to return the reply buffer back to the caller.

Configuring the Tuxedo Java Server

Once the server class or classes have been developed and compiled, the Tuxedo Java Server TMJAVASVR needs to be added to the Tuxedo UBBCONFIG file.  This Tuxedo provided server will load the JVM, load the server classes, and take care of dispatching incoming requests to the methods in the server classes.  Which classes to load and the mapping between Tuxedo service names that the server will offer are defined in an XML based configuration file. By default each public method in the server classes is advertised as the name of the Tuxedo service.   This configuration file also specifies such things as the classpaths to be used, JDBC driver and connection information for accessing a database, and resources such as FML/FML32 field tables and VIEW/VIEW32 classes.  After updating and loading the UBBCONFIG file, the application is ready to be booted and tested.

Sample Implementation and Configuration

Here is what a simple Java service implementation might look like:

public void JAVATOUPPER(TPSVCINFO rqst) throws TuxException {
        TuxAppContext myAppCtxt = getTuxAppContext();         /* The the application context */
        TypedBuffer svcData = rqst.getServiceData();        /* Get the callers data */
        TypedString TbString = (TypedString)svcData;        /* Assume it's a STRING buffer */
        String newStr = TbString.toString().toUpperCase();    /* Get the string and upper case it */
        TypedString replyTbString = new TypedString(newStr);    /* Create the reply buffer */
        myAppCtxt.tpreturn(TPSUCCESS, 0, replyTbString, 0);    /* Return reply buffer to caller */

The entry in the UBBCONFIG for the Tuxedo Java Server might look like:

         CLOPT="-- -c TJSconfig.xml"

which would start a single copy of the Tuxedo Java Server with 10 threads to handle requests. The configuration file TJSconfig.xml for this server might look something like:

<?xml version="1.0" encoding="UTF-8"?>
        <TuxedoServerClass name="MyTuxedoJavaServer"></TuxedoServerClass>

where MyTuxedoJavaServer is the name of the Java class that extends the TuxedoJavaServer class.Multiple copies of the Tuxedo Java Server can be run just as any other Tuxedo server using the same configuration file or each using their own configuration file.  All standard Tuxedo buffer types are supported, so services can use STRING, CARRAY, MBSTRING, FML/FML32, XML, or VIEW/VIEW32 buffers.  As well, Java services can call other Tuxedo services by using the tpcall() method on the TuxAppContext.


As the Tuxedo Java Server is a standard Tuxedo server, all of the monitoring, management, and administration capabilities that Tuxedo provides to C or other language servers is available to services written in Java.  These services also benefit from the unmatched reliability, availability, scalability, and performance that Tuxedo has proven to provide at thousands of customer sites.  By providing Java support in Tuxedo, customers are free to choose the language that best suits their application development needs, whether it is C, C++, COBOL, Python, Ruby, PHP, and now Java, and they all work together seamlessly to provide one integration application.

Stay Connected

Cloud Application Foundation (CAF):


The following is the sequence of calls we are making using a Java shared Object using multiple threads:


Please guide us if this is the right way of calling
I am a Tuxedo novice, i would like to know if there is a better way of handling

Posted by guest on May 23, 2013 at 01:16 AM CDT #


I'm not exactly sure what you are asking. The support in Tuxedo 12c for Java is for developing Tuxedo services in Java, not Tuxedo clients, at least not yet. The only supported Java clients for Tuxedo are Jolt, WebLogic Tuxedo Connector from WebLogic Server, and the Tuxedo JCA Adapter. If you are trying to call Tuxedo APIs from Java using JNI you are basically on your own.

Regarding the sequence of calls you are making, in general those are fine, although it's highly inefficient to make a single request in a session, i.e., one TPCALL() after performing TPINIT().

If you are creating a Tuxedo service in Java, then the above sequence shouldn't include the TPINIT() or TPTERM() calls.

Posted by Todd Little on May 23, 2013 at 12:17 PM CDT #


as suggested we have tweeked the code and removed the TPINIT() and TPTERM() calls.

we are using only the TPCALL()
things seem to be working fine, using a single socket we are able to pump in transactions, however when the server is restarted the client is not able to connect to the server anymore and needs a restart itsel(Client).
please advise.

Posted by guest on June 06, 2013 at 01:59 AM CDT #

Sorry for the extremely long delay in responding to this comment. :-(

I don't understand how sockets fit into the picture. Tuxedo servers, including the Tuxedo Java Server don't use sockets. All communication to servers is via IPC queues. Remote clients use sockets, but those socket connections are to one of the Tuxedo listeners such as the WSL. Restarting the server doesn't affect the socket connection the client has to Tuxedo as the WSL/WSH are presumably still running.

If you are talking about shutting down the entire Tuxedo application, or shutting down the WSL/WSH, then the client will receive an error and needs to perform its tpinit() call again to re-establish its connection to the Tuxedo domain.

Posted by Todd Little on March 10, 2014 at 11:01 AM CDT #

The authors might want to correct this in the "Java Sever Support" section (it is not a valid sentence):

"Yet being Java developers have access to the rich set of class libraries that Java developers have come to know and love"

Posted by guest on July 14, 2014 at 08:36 AM CDT #

I would like to know if I can deploy a war or a jar which is spring based application in Tuxedo instead of simple java files.Like similar to non web based application.

Posted by rajendra on August 13, 2014 at 02:36 AM CDT #

You can definitely deploy a Spring application to the Tuxedo Java Server as we have tested this as well as provided an interface from the Spring transaction management facility to the Tuxedo transaction management capabilities.

Posted by Todd Little on August 13, 2014 at 10:06 AM CDT #

I'm running a big Tuxedo application that run a mix of Cobol and C calling each other within the same service.

Will it be possible that I will convert the Cobol code into Java, so I will have a mix of C and Java in the same single server? Or does the Java Tuxedo needs to only include Java in a single server?

Posted by wile on August 03, 2015 at 08:07 AM CDT #

Hi Wile,

C and Java services can operate in the same application, but they execute in separate processes. Hope that answers your question.


Posted by Todd Little on August 26, 2015 at 10:53 AM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed

This is the Tuxedo product team blog.


« July 2016