Configure WebLogic tuxedo Connector

Source: Internet
Author: User
Tags server hosting
WebLogic tuxedo connector (WTC) is a software component compatible with JCA (J2EE Connector Architecture). It provides interoperability between the tuxedo service and enterprise applications deployed on WebLogic Server. The WebLogic Server component can use WTC to communicate with the tuxedo service. The tuxedo service can also call and interact with ejbs Based on the WebLogic Server.

Manual configuration of Weblogic tuxedo ctor Ctor is a tedious and error-prone operation. From this point of view, this article provides two programming-based optional solutions. The first is based on JMX, and the second is based on the use of the weblogic. Admin tool in the command line mode. This article provides a Java class library that can generate both the required JMX object and the shell file based on weblogic. admin.

The tuxedo service has been in existence for many years, and many EIS (enterprise information systems) are based on such service functions, such as transaction support, domain and ACL (Access Control List) security, domain-level failover and feedback, and advanced messaging services. On the other hand, J2EE applications cannot be isolated from existing information systems. They must be able to support tuxedo transactions and implement interoperability between Java and C ++, it also needs to be able to interoperate between Java RMI/IIOP and tuxedo CORBA.

WTC implements all these solutions and some other implementation solutions that may be similar to jatmi (Java application to transaction Monitor Interface). jatmi is a protocol similar to Tuxedo atmi.

WTC implements all these solutions and some other implementation solutions that may be similar to jatmi (Java application to transaction Monitor Interface). jatmi is a protocol similar to Tuxedo atmi.

After the importance of the tuxedo service to EIS and the association between WTC and J2EE components based on new technologies are described, the goal of this article is to provide several WTC configuration examples in the Weblogic server environment. In fact, configuring WebLogic Server to connect two-way to the tuxedo domain so that WTC is a laborious and error-prone task. This article provides two programming-style configuration solutions. They provide a solution based on the Weblogic server console, which may be the best known method. One of the two solutions is based on the weblogic. Admin tool and will certainly benefit the system administrator. Another solution is based on JMX (Java Management extension) and is very likely to attract developers' attention.

Regardless of the scheme, the WTC configuration process is based on the following general steps:

  • Create a WTC service.
  • Create a local tuxedo access point.
  • Create a remote tuxedo access point.
  • Export Service.
  • Import service.
  • Assign a newly created WTC service to the server.

In the whole article, we will follow these steps, and we will emphasize the methods executed separately in the three configuration schemes.

Configure WTC on the Weblogic server console

This is the standard way to configure WTC for your application. It includes the use of the Weblogic server console GUI. Although there are many advantages (the most important of which is its simplicity), this solution also has the disadvantages of laborious, repetitive, and error-prone. After starting WebLogic Server and Its Management Console, you can configure the WTC service according to the following steps.

  • Create a WTC service.On the administration console screen, deploy the services node and click WTC. The WTC services screen is displayed. Click the configure a new WTC service hyperlink. The displayed screen contains two text fields: the name of the WTC service and the priority order of its deployment. Click Create to create a new WTC service.
  • Create a local tuxedo access point.Make sure that you have selected the new service. Click the "content" tab on the Service Page, and click the "local APs" tab on the new page. To create a new tuxedo local access point, click the "configure a new local tuxedo Access Point" hyperlink. On the General Tab Of the tuxedo local access point, enter the domain "Access Point", "Access Point ID", and "network address ". The first domain is the user name, and the second and third domains must be associated with the dm_tdomain segment of the bdmconfig tuxedo configuration file. The default domain value in the Connections tab of the same screen is applicable in most cases, unless the current tuxedo version is 6.5, the "interoperate" field must be "yes ". For simplicity, we assume that the "Security" field in the "Security" tab on this page is "NONE", which means no authentication based on user passwords is required.
  • Create a remote tuxedo access point.Make sure that you have selected the newly created service. Click the "contents" tab on the Service Page, and click the "remote APS" tab on the new page. To create a new tuxedo Remote Access Point, click the "configure a new remote tuxedo Access Point" hyperlink. On the General Tab Of the tuxedo Remote Access Point, enter the domain "Access Point", "Access Point ID", "Local access point", and "network address ". The first and fourth fields must be selected by the user. The second and fourth fields must be associated with the dm_tdomain segment of the bdmconfig tuxedo configuration file. The third domain must be the local tuxedo access name selected in the previous step. The default domain value on the Connections tab of the same screen is applicable in most cases. For simplicity, we will accept the default values for all domains on the "Security" tab of this page.
  • Export Service.The exported WTC service is basically a stateless session EJB deployed in the container, which may be called by the tuxedo service. To export the service, make sure that the newly created service is selected. Click the "contents" tab on the Service Page, and click the "exported" tab on the new page. To export the WTC service, click the "configure a new exported service" hyperlink. On the General tab, the Resource Name field must be associated with the dm_remote_services section of the bdmconfig tuxedo configuration file. The second domain, "Local access point", must be the local tuxedo access name we selected in the previous step. The next domain, "EJB name", must have the same value as the JNDI-name segment of the weblogic-ejb-jar.xm deployment description file in the corresponding deployed stateless Session Bean. The "remote name" field can be left blank unless the rname parameter is mentioned in the dm_remote_services section of the bdmconfig tuxedo configuration file. In this case, these two values must be related.
  • Import service.The imported WTC service is basically a tuxedo service that can be called by the WebLogic Server deployment component. To import the service, make sure that the newly created service is selected. Click the "contents" tab on the Service Page, and click the "imported" tab on the new page. To import the WTC service, click the "configure a new imported service" hyperlink. On the General tab, the Resource Name field must be associated with the dm_local_services section of the bdmconfig tuxedo configuration file. The second and third domains are the previously defined local and remote tuxedo access points. Finally, the "remote name" field can be left blank unless the rname parameter is mentioned in the dm_local_services section of the bdmconfig tuxedo configuration file. In this case, these two values must be related.
  • Assign a new service to the server.Make sure that you have selected the newly created service. Click the target and deploy tab on the Service Page and check whether the boxes associated with the current server are selected in the targets field. Click "Apply" to implement the changes.

As you can see, WTC configuration through the Weblogic server console is indeed very laborious, because we have to perform many operations on our own. In addition, if we need to create several such WTC domains, we will have to repeat these operations. This increases the chance of making mistakes during the configuration process. In this case, the idea of a new configuration tool that can create WTC parameters is very attractive.

PassJMXConfigurationWTC

As a distributed resource that can be fully managed, WebLogic Server instrumentation can be achieved through JMX (Java Management extension. This will be implemented through the mbean server, which serves as the mbeans host on an independent WebLogic instance, allows customers to create, access, retrieve, and modify WebLogic domain distribution objects (such as JDBC connection pool, JMS server, destination, and factory ). From the perspective of WTC, you can create a WTC domain by creating a new wtcmbeans.

In the process of creating and processing WebLogic distributed objects programmatically, we can use interfaces of the JMX standard class (consisting of passing operation names and a series of parameters to mbean to call mbean operations ), you can also use Weblogic's type security implementation (which provides an independent interface for each mbean type ).

Because the Weblogic domain may be distributed across multiple computers, these computers have different deployments and different resource targets, therefore, the mbean server of each WebLogic instance has three different mbeans sets:

  • Configure attributes and mbeans for public resource configuration
  • Mbeans at runtime provide information about the resource running status
  • Security mbeans provides direct access to Weblogic's security framework

When we mention the WTC domain, we will focus on configuring mbeans. This type of mbeans has configuration for all managed resources (such as web servers, clusters, JDBC connection pools, and more resources including WTC domains.

The mbean server on the Weblogic instance can be reached through the weblogic. Management. mbeanhome interface. You can obtain the following two home interfaces:

  • The local home interface provides access to local mbeans. mbeans are located on the mbean server and belong to the current Weblogic server instance.

     

  • The Administration home interface is only available to the management server and provides access to specific management server mbeans and all other mbeans hosted by the managed server.

     

The home interface can be searched both by the server's JNDI tree and by the Weblogic-specific help class. For example, the following code retrieves the local home interface:

  import weblogic.management.*;MBeanHome localHome = (MBeanHome)Helper.getMBeanHome(username,password, url, serverName);

The preceding Code calls the getmbeanhome () method of the helper class and sends the username, password, WebLogic Server URL, and server name to it. Similarly, to retrieve and manage the home interface, call the getadminmbeanhome method of the same helper class, but send the user name, password, and Management Server URL to it, as shown in the following example:

Listing 2 home interface for retrieval and Management

  import weblogic.management.*;MBeanHome localHome = (MBeanHome)Helper.getAdminMBeanHome(username, password, url);

It is also easy to use JNDI (Java command directory interface. The local and Management return addresses are stored in the mbeanhome. local_jndi_name constants and mbeanhome. admin_jndi_name constants. The following code example shows how to proceed:

Listing 3 Use JNDI to retrieve the local home interface.

  Hashtable ht = new Hashtable();ht.put (Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");ht.put(Context.PROVIDER_URL, "t3://adminserver:8001");InitialContext ic = new InitialContext (ht);MBeanHome localHome = (MBeanHome)ic.lookup (MBeanHome.LOCAL_JNDI_NAME);

We have been able to retrieve local/management interfaces. Next we will look at the six steps required to configure the WTC domain in JMX.

     

  • Create a WTC service. This can be achieved by using the createadminmbean () method of the home interface and passing a new WTC domain name, the type of mbean to be created, and the current WebLogic Server domain name to it.

     

    List 4 Create a WTC service.

      WTCServerMBean wtcServerMBean = homeMBean.createAdminMBean ("myWTCDomain",    "WTCServer", "myWebLogicServerDomain");

     

  • Create a local tuxedo access point. To achieve this goal, we need to create another management mbean of the wtclocaltuxdom type and set its access point, access point id, network address, connection policy, and security attribute, at the same time, add it as the component of the wtcserver mbean created previously.

     

    Listing 5 create a local tuxedo access point.

       WTCLocalTuxDomMBean wtcLocalTuxDomMBean = (WTCLocalTuxDomMBean)    homeMBean.createAdminMBean("myLocalTuxDom","WTCLocalTuxDom",    getWebLogicDomainName());    wtcLocalTuxDomMBean.setAccessPoint(getLocalAccessPointName());    wtcLocalTuxDomMBean.setAccessPointId(getLocalAccessPointId());    wtcLocalTuxDomMBean.setNWAddr(getLocalNetworkAddress());    wtcLocalTuxDomMBean.setConnectionPolicy("ON_DEMAND");    wtcLocalTuxDomMBean.setSecurity("NONE");    wtcServerMBean.addLocalTuxDom(wtcLocalTuxDomMBean);

     

  • Create a remote tuxedo access point. To achieve this goal, we need to create another management mbean of the wtcremotetuxdom type and set its access point, access point id, network address, and local access point attributes, at the same time, add it as the component of the wtcserver mbean created previously.

     

    Listing 6 creates a remote tuxedo access point.

       WTCRemoteTuxDomMBean wtcRemoteTuxDomMBean = (WTCRemoteTuxDomMBean)    homeMBean.createAdminMBean("myRemoteTuxDom",    "WTCRemoteTuxDom",    "myWebLogicServerDomain");    wtcRemoteTuxDomMBean.setAccessPoint    ("myRemoteAccessPoint");    wtcRemoteTuxDomMBean.setAccessPointId("myRemoteAccessPointId");    wtcRemoteTuxDomMBean.setNWAddr("myRemoteNetworkAddress");    wtcRemoteTuxDomMBean.setLocalAccessPoint("myLocalTuxDom");    wtcServerMBean.addRemoteTuxDom(wtcRemoteTuxDomMBean);

     

  • Export Service. To achieve this goal, we need to create another wtcexport management mbean and set its Resource Name, local access point, and JNDI name attributes, at the same time, add it as the component of the wtcserver mbean created previously.

     

    Listing 7 export the service.

       WTCExportMBean wtcExportMBean = (WTCExportMBean)    homeMBean.createAdminMBean    ("myRemoteTuxDom", "WTCExport",    "myWebLogicServerDomain");    wtcExportMBean.setResourceName    ("myExportedResource");    wtcExportMBean.setLocalAccessPoint    ("myLocalTuxDom");    wtcExportMBean.setEJBName    ("myResourceJndiName");    wtcServerMBean.addExport(wtcExportMBean);

     

  • Import service. To achieve this goal, we need to create another management mbean of the wtcimport type and set its Resource Name, local access point, and remote access point list attributes, at the same time, add it as the component of the wtcserver mbean created previously.

     

    List 8 Import services.

       WTCImportMBean wtcImportMBean = (WTCImportMBean)    homeMBean.createAdminMBean    ("myRemoteTuxDom","WTCImport",    "myWebLogicServerDomain");    wtcImportMBean.setResourceName    ("myImportedResource");    wtcImportMBean.setLocalAccessPoint    ("myLocalAccessPoint");    wtcImportMBean.setRemoteAccessPointList    ("myRemoteAccessPoint");    wtcServerMBean.addImport(wtcImportMBean);

     

  • Assign a new service to the server. Now that all management objects have been created, we only need to locate our mbean server. The addtarget () method of the wtcservermbean class represents the completion of this process. Note that the getmbeanserver () method of the home interface is called to retrieve the mbean server instance.

     

    Listing 9 allocates WTC services to the server.

      wtcServerMBean.addTarget    ((TargetMBean)homeMBean.getMBeanServer());

UseWeblogic. AdminTool ConfigurationWTC

Weblogic. Admin is a Java tool that can be used to write Weblogic server scripts. Since weblogic. Admin can manipulate JMX data, it may be easier to configure WTC domains.

Before we can use the weblogic. Admin Tool to configure the WTC domain, we must understand how WebLogic names its mbeans. Each mbean hosted by the mbean server has a unique name, and each name is constructed using an instance of the JMX objectname class. They extend the objectname to carry additional information. Mbean names follow the following format:

<Domain>: Name = <Name>, type = <type> [, location = <Server>] [<ATTR >=< value>] *
Where:
<Domain> is the name of the Weblogic domain to which the mbean server belongs
<Name> is the name of the resource associated with the mbean
<Type> is the name of the mbean
<Server> is the name of the server hosting the mbean Server
<ATTR> and <value> are name-value pairs for mbean attributes

Now let's take a look at how to configure the WTC domain through this tool.

     

  • Create a WTC service.

     

     java weblogic.Admin -url t3://localhost:8001 -username weblogic    -password weblogic CREATE    -mbean "myDomain:Name=myWtcService,Type=WTCServer"

     

  • Create a local tuxedo access point.

     

    java weblogic.Admin ... CREATE -mbean    "myDomain:Name=myLoclTuxDom,    Type=WTCLocalTuxDom,WTCServer=myWtcService"    java weblogic.Admin ... SET    -mbean    "myDomain:Name=myLoclTuxDom,Type=WTCLocalTuxDom,WTCServer=myWtcService    -property AccessPoint MyLclAccessPt -property    AccessPointId MyLclAccessPtId    -property NWAddr //footse:9010    -property ConnectionPolicy ON_DEMAND    -property Security NONE"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myWtcService,Type=WTCServer -property    LocalTuxDoms    myDomain:Name=myLoclTuxDom,Type=WTCLocalTuxDom,    WTCServer=myWtcService" 

     

  • Create a remote tuxedo access point.

     

    java weblogic.Admin ... CREATE -mbean    "myDomain:Name=myRemoteTuxDom,    Type=WTCRemoteTuxDom,WTCServer=myWtcService"    java weblogic.Admin ... SET    -mbean    "myDomain:Name=myRemoteTuxDom,Type=WTCRemoteTuxDom,WTCServer=myWtcService    -property AccessPoint MyRemoteAccessPt -property    AccessPointId    MyRemoteAccessPtId -property NWAddr //footse:9020    -property LocalAccessPoint    MyLclAccessPt"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myWtcService,Type=WTCServer -property    RemoteTuxDoms    myDomain:Name=myRemoteTuxDom,Type=WTCRemoteTuxDom,    WTCServer=myWtcService"

     

  • Export Service.

     

    java weblogic.Admin ... CREATE -mbean    "myDomain:Name=myExportedResources,    Type=WTCExport,WTCServer=myWtcService"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myExportedResources,Type=WTCExport,    WTCServer=myWtcService    -property ResourceName myExportedService    -property EJBName myServiceJNDIName    -property LocalAccessPoint MyLclAccessPt"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myWtcService,Type=WTCServer -property Exports    myDomain:Name=myExportedResources,    Type=WTCExport,WTCServer=myWtcService"

     

  • Import service.

     

    java weblogic.Admin ... CREATE -mbean    "myDomain:Name=myImportedResources,    Type=WTCImport,WTCServer=myWtcService"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myImportedResources,Type=WTCImport,    WTCServer=myWtcService    -property ResourceName myImportedService    -property RemoteAccessPoint    MyRemoteAccessPt -property LocalAccessPoint MyLclAccessPt"    java weblogic.Admin ... SET -mbean    "myDomain:Name=myWtcService,Type=WTCServer    -property Imports    myDomain:Name=myImportedResources,    Type=WTCImport,WTCServer=myWtcService"

     

  • Assign a new service to the server.

     

    java weblogic.Admin ... SET -mbean    myDomain:Name=myWtcService,Type=WTCServer    -property Targets    myDomain:Name=myServer,Type=Server

Another flexible tool that allows users to record activities such as creating, viewing, monitoring, or modifying mbeans is wlshell, which may be able to be downloaded from the dev2dev web site. For more information, see http://www.wlshell.com.

Conclusion

Using the WebLogic Administration Console to configure the WTC domain may be used in some scenarios, but it will soon generate repetition and generate errors. The programming solution can alleviate this problem. This article describes these two solutions. The first method is based on the standard JMX solution, while the second method uses powerful script commands Based on the weblogic. Admin tool.

The code samples attached to this article provide implementation of these ideas.

Source

Http://dev2dev.bea.com/products/wlserver81/articles/TuxedoConnector.jsp

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.