Showing posts with label Weblogic. Show all posts
Showing posts with label Weblogic. Show all posts

Sunday, June 10, 2012

How to create a JNDI for MQ Adapter on Weblogic

This post explains how to create a simple JNDI for MQ Adapter in Weblogic 10.3.x. This JNDI properties can be further changed to configure One-way or Two-way SSL on MQ Adapter as explained in post Enabling SSL on MQ Series Adapter - Part 2.
  • Login to Weblogic Server Administration Console and navigate to Deployments > MQSeriesAdapter > Configuration Tab > Outbound Connection Pool.


  • Click on New button and select javax.resource.cci.ConnectionFactory and click Next.
  • Give an appropriate JNDI name and press Finish. This JNDI name will be used by your MQ Adapter inside the BPEL process. If it asks to Create/Save a Deployment Plan, Create/Save a deployment plan for this JNDI reference.
  • Go back to the MQSeriesAdapter > Configuration Tab > Outbound Connection Pool and expand the connection factory  javax.resource.cci.ConnectionFactory. Click on the JNDI created by you above.


  • Set the following properties for the above created JNDI. Leave the other properties to their default. Remember to hit Enter after updating each property. 

    S. No
    Property Name
    Property Value
    Description
    1
    channelName
    <Channel Name>
    The name of the channel which is of server-conection type. Ask your MQ Server Admin to provide this detail. Your process will connect to this channel.
    2
    hostName 
    <Host Name>
    The host name of the MQ server
    3
    password
    <Password to access MQ>
    Specify the password to access the MQ Server
    4
    portNumber
    <MQ Server Port>
    Network port to connect to MQ server
    5
    queueManagerName
    <Queue Manager name on MQ Server>
    Queue Manager provides access to the queues and also transfers messages to other queue managers through message channels.
    6
    SSLEnable
    false
    By default this value is false. As we're not using any SSL in this post, leave this value as false.
    7
    userID
    <username to connect MQ>
    User Id to access MQ server
    8
    XATransaction
    false
    By default this is False. Keep it false unless you want to enable global transactions on this adapter.

  • Save the properties by hitting the Save button at the bottom of the properties page.
  • Navigate back to Deployments and check MQSeriesAdapter. Now press Update button on the top.
  • On the next page, choose to Redeploy this application using the following deployment files and hit Finish.
After the JNDI is created successfully and properties are set as above, use this JNDI in a simple BPEL process to enqueue a message in MQ. If this is successful, JNDI configuration is correct.

Tuesday, May 10, 2011

Weblogic and MS SQL Configurations to run projects using SQL Server Connections

Creating the SQL Server connection from Jdeveloper is easy. However, after the project is developed, it has to be deployed on the Weblogic Server, a JNDI needs to be created to connect to the MS SQL Server. Oracle has provided 2 default drivers for MS SQL Server.


*Oracle's MS SQL Server Driver (Type 4 XA) Versions:7.0, 2000, 2005, 2008
*Oracle's MS SQL Server Driver (Type 4) Versions:7.0, 2000, 2005, 2008


The difference between 2 drivers is that one is Transaction Aware and other one is not. There are other drivers also present but they would need specific jars to be placed in the server lib directory, but default drivers would work without any additional configuration on the Weblogic Server. Hence a JNDI to connect to MS SQL Server can be created using any of these drivers very much the same way as you create for Oracle Database.

However, following MS SQL Server configurations also need to be done to be able to connect to MS SQL Server from Weblogic Server.
Create the JTA Procedures
Follow the steps as given here.

Also if you are using the XA driver, you also need to enable XA Transactions on MS SQL Server. Follow the following steps for that. 

  1. Turn on support for XA transactions: 
    • Go to Control Panel > Administrative tools > Component Services.
    • Expand the tree view to locate the computer where you want to turn on support for XA transactions: for example, Component Services > Computers > My Computer
    • Right-click the computer name, then click Properties
    • Click the MSDTC tab, and then click Security Configuration. 
    • Under Security Settings, click the check box for XA Transactions to turn on this support. (Enable XA Transactions
    • Click OK, and then click OK again. 
  2. Create a registry named-value: 
    • Use Registry Editor and navigate to registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL
    • Create a new registry named-value:
    • Name is the file name of the XA DLL (in the format dllname.dll).
    • Type is String (REG_SZ).
    • Value is the full path name (including the file name) of the DLL file. for example, C:\Program Files\Microsoft SQLServer\ MSSQL.1\ MSSQL\ Binn\ sqljdbc.dll
  3. Go to Control Panel ->Administrative tools->Services
    •  Start "Distributed Transaction Coordinator."
  4. Please restart the server to make these changes take effect.

Note:
While making the JNDI for data sources on WLS Console, specify the value of property platformClassName as oracle.toplink.platform.database.SQLServerPlatform.

And that's all. Happy Development!

Wednesday, June 30, 2010

Starting Admin and Managed Servers using Node Manager and WLST

Node Manager is a WebLogic Server utility, independent of domains, that enables you to start, shut down, and restart Administration Server and Managed Server instances from a remote location. You can further use the Node Manager to control Administration Server and Managed Server from a local location also as I used in my case. Below post explains how you can start your Admin and Managed servers from the Node Manager.


Note : I have used Windows Vista OS and Oracle Database 11.2. All the commands for Linux/Unix will change accordingly.


Please follow the following steps for the same.


1.) Firstly configure the Node Manager
2.) Verify the Node Manager
3.) Once you verify and complete the above steps, I recommend, stop and close everything open till now. Then follow the following steps.
Start your Node Manager using <Middleware_Home>\wlserver_10.3\server\bin\startNodeManager.cmd command from the command prompt.

  • Open a fresh command prompt window and run WLST.cmd from <Middleware_Home>\wlserver_10.3\common\bin\WLST.cmd.
  • Next task is to connect to the Node Manager using nmConnect(). In the WLST console window type nmConnect('weblogic','welcome1','neeraj-pc','5556','soa_domain').
  • Once connected to Node Manager the command prompt will change.
  • Now to start your Admin server type nmStart() e.g. nmStart('AdminServer')
  • To start your managed server type nmStart() e.g. nmStart('soa_server1')
  • If it gives the success notification, you are done. Also, you can verify the same from the Weblogic Console.


    Part 2 : How to start the Node manager and Verify that it is running properly

    After the Node Manager is properly configured, you can start the Node Manager by following the below mentioned steps.

    • Open a new command window and go to <Middleware_Home>\wlserver_10.3\server\bin using cd command. Type startNodeManager and press Enter.
    • It starts your Node Manager and gives the output as shown in below image.

    • To verify if the Node Manager is running successfully, start your Admin Server if it is not Running and go to Weblogic Server Console.
    • Navigate to Environment --> Machines --> LocalMachine --> Monitoring Tab --> Node Manager Status. It should display Reachable. See below image.
    • Hence the Node Manager is running properly.




    Part 1: How to configure the Node Manager to start Admin and Managed Servers

    Before you can use the Node Manager utility, you need to configure/verify the Node Manager. 
    • For this start the Admin Server as usual by running the <Middleware_home>\user_projects\domains\soa_domain\startWebLogic.cmd.
    • Go to Weblogic Console and navigate to Machines-->LocalMachine-->Configuration Tab-->Node Manager Tab. Specify the ListenAddress (where Node Manager will run) and ListenPort as per you installation. By default the port is 5556. Be sure to provide the exact URL/Host name in ListenAddress as localhost will disallow starting the servers from remote location. See below image.

    • Go to <Middleware_home>\wlserver_10.3\common\nodemanager\nodemanager.properties. Set StartScriptEnabled=true.
    • Start WLST from <Middleware_home>\wlserver_10.3\common\bin\wlst.cmd in a separate command prompt window. You can double click on the wlst.cmd also to start WLST.
    • Once WLST starts, connect to Admin Server from the WLST console. To connect type the connect() command on the WLST console and press Enter. Accept defaults or provide inputs as required. Once it connects successfully, the WLST prompt will change to wls:/mydomain/serverConfig>.
    • Now type nmEnroll(<Middleware_home>\user_projects\domains\soa_domain). This command enrolls the current machine with the Node Manager and creates some properties file (nm_password.properties,SerializedSystemIni.dat).
    • If the message displays as "Successfully enrolled this machine with the domain directory at", Enrollment is successful. 
    • Exit from the WLST console using the exit() command and shut down your Admin Server and Close the Browser Console window.
    • Node Manager is configured. Further, to start the Admin and Managed Servers from this Node Manager, refer to this post.