Friday, 27 September 2013

Creating a sample Data Source in WeLogic server.

Creating a sample Data Source in WebLogic server.

1 .Log on to weblogic  admin colsole.
2 .Go to Servicesà Data Sources or in main page you can see the Data Source tab under services as shown below.

Click on NEW, select Generic Data Source out of 3 options .
Data Sources description:-
·         Generic Data Sources—Generic data sources and their connection pools provide connection management processes that help keep your system running efficiently.You can set options in the data source to suit your applications and your environment.
·         GridLink Data Sources—An event-based data source that adaptively responds to state changes in an Oracle RAC instance. See Using GridLink Data Sources.
·         Multi data sources—A multi data source is an abstraction around a group of generic data sources that provides load balancing or failover processing.

    Select Database Type is Oracle.

Don’t change anything let it use XA driver, If you need any other driver you can select as per your requirement unless use the default one.

Click Next
Enter DB connection properties

Click “Next” and Click “Test Configuration” you can see the test success result, then only the connection will take the action or else connection may not be created. Click “Next”.

Now a New JDBC data source will be created .Select a server (Admin Server).

Data Source creation done. You can see the data source in the list.

Now you have to create a connection factory for an outbound.
Go to Domain Structure à Deployments à Click on DB Adapter à Configuration à Outbound connection pools. Expand list.

Click “NEW” enter JNDI name that you have to create for outbound connection.
(Note:-Remember you should not use the same JNDI name while creating the data source. Use another JNDI name.
You have to use this JNDI name in DB Adapter configuration while design in JDeveloper.)

Finish. Then go to outbound connection pools that you have created recently .
Go to properties à Go to xADataSourceName  --property Value enter the JNDI name that you have given while creating the data source. Press Enter (Mandatory press enter save button will not work here).
(Note:-Here you have to enter only the JNDI name that you have given while creating the data source then only it will point to the data source.)

Go to deployments, select DB Adapter click on update.
Then the plan.xml file will be updated. Then you will the below success message.

Now you have created a data source successfully.

Remember  when you create a data source use one JNDI name ,this you have to enter in xADataSourceName ,When you are creating the outbound connection in deployments use another JNDI name , this you have to use this JNDI name in design time while DB Adapter configuration in JDeveloper.

Happy Learning.

Thursday, 26 September 2013

How to Create a Simple JMS Queue in Weblogic Server - Configuring JNDI connection for JMS Adapter- JMS Adapter Tutorial Part 1

Hi Guys

Here am going to explain about jms servers, jms modules, connection factory, persistent store, queue &
how to create ..Sample one...

Persistent Store:- It is a physical location for a queue to store its messages.
 There are two types of persistent stores
   1.Database persistent store
   2.File persistent store
JMS Server:-A JMS server acts as a management container for resources within JMS modules. Some of its responsibilities include the maintenance of persistence and state of messages and subscribers. A JMS server is required in order to create a JMS module .
JMS Module:-A JMS module is a definition which contains JMS resources such as queues and topics. A JMS module is required in order to create a JMS queue.
Subdeployment:-JMS modules are targeted to one or more WLS instances or a cluster. Resources within a JMS module, such as queues and topics are also targeted to a JMS server or WLS server instances. A subdeployment is a grouping of targets. It is also known as advanced targeting.
Connection Factory:-A connection factory is a resource that enables JMS clients to create connections to JMS destinations.

JMS Queue:-A JMS queue (as opposed to a JMS topic) is a point-to-point destination type. A message is written to a specific queue or received from a specific queue.
The objects used in this example are:
Object Name
JMS Server
JMS Module
Connection Factory
JMS Queue

1.Configuration of a queue in weblogic console:-
1.1. Create "Persistent Store"
Console -->Services-->Persistent store-->New-->File Store.
1.Go to "Domain structure" and click on Persistent stores under Services.  
2. Click on NEW and select  Create FileStore.  
3. Give FileStore name , Target n Directory click OK.   
4.Persistent store is created.

The following steps are done in the WebLogic Server Console, beginning with the left-hand navigation menu.
1.2 Create a JMS Server
·         Services > Messaging > JMS Servers
·         Select New
·         Name: TestJMSServer
Persistent Store: (none)
·         Target: soa_server1  (or choose an available server)
·         Finish
The JMS server should now be visible in the list with Health OK.
 1.3 Create a JMS Module
·         Services > Messaging > JMS Modules
·         Select New
·         Name: TestJMSModule
Leave the other options empty
·         Targets: soa_server1  (or choose the same one as the JMS server)
Press Next
·         Leave “Would you like to add resources to this JMS system module” unchecked and  press Finish .
1.4 Create a SubDeployment
A subdeployment is not necessary for the JMS queue to work, but it allows you to easily target subcomponents of the JMS module to a single target or group of targets. We will use the subdeployment in this example to target the following connection factory and JMS queue to the JMS server we created earlier.
·         Services > Messaging > JMS Modules
·         Select TestJMSModule
·         Select the Subdeployments  tab and New
·         Subdeployment Name: TestSubdeployment
·         Press Next
·         Here you can select the target(s) for the subdeployment. You can choose either Servers (i.e. WebLogic managed servers, such as the soa_server1) or JMS Servers such as the JMS Server created earlier. As the purpose of our subdeployment in this example is to target a specific JMS server, we will choose the JMS Server option.
Select the TestJMSServer created earlier
·         Press Finish
1.5  Create a Connection Factory
·         Services > Messaging > JMS Modules
·         Select TestJMSModule  and press New
·         Select Connection Factory  and Next
·         Name: TestConnectionFactory
JNDI Name: jms/TestConnectionFactory
Leave the other values at default
·         On the Targets page, select the Advanced Targeting  button and select TestSubdeployment
·         Press Finish
The connection factory should be listed on the following page with TestSubdeployment and TestJMSServer as the target.
1.6 Create a JMS Queue
·         Services > Messaging > JMS Modules
·         Select TestJMSModule  and press New
·         Select Queue and Next
·         Name: TestJMSQueue
JNDI Name: jms/TestJMSQueue
Template: None
Press Next
·         Subdeployments: TestSubdeployment
·         Finish
The TestJMSQueue should be listed on the following page with TestSubdeployment and TestJMSServer.
Confirm the resources for the TestJMSModule. Using the Domain Structure tree, navigate to soa_domain > Services > Messaging > JMS Modules then select TestJMSModule

You should see the following resources

1.7 Create outbound connection for a connection factory:- 

Console --> Deployments -->JmsAdapter-->Configuration-->Outbound connection pool.
click on new and select oracle.tip.adapter.jms.IJmsConnectionFactory
Give JNDI Name , click on e Finish.
Go to the newlay created  Outbound connection properties and enter the JMS Module --Connection factory JNDI in the ConnectionFactoryLocation hit Enter Save.

Goto Deployements and select jmsadapter ear and update the plan file.

The JMS queue is now complete and can be accessed using the JNDI names
jms/TestConnectionFactory and
WoW..Done ..Now you are familiar with JMS servers, Modules, connection factory, queue(topic same as queue)
Happy Learning..........!!!!

Generating the Keystore for SSL enabled Weblogic server

How to generate a Keystore .jks for weblogic

Open command prompt as an administrator
Go to java folder that you installed in your system eg: c:\Program files\java\jdk1.6.0_26\bin
Enter the command   “ Keytool  -genkey -alias tomcat -keyalg RSA –keystore  keystore.jks”
Answer the questions that cmd asks
  Eg:- what is your first name & last name,
What is your organization unit, what is the name of your organization , city,state,country , Y or N.
Answer all the questions above as per you.
Enter key password for weblogic , re-enter .
Now the keystore.jks fille will be generated in bin folder.
You can verify keystore contents using this command: “keytool –list –v –keystore keystore.jks”
If you are using self certificate then you can save the keystore.jks file and do the following.
(“If you are using the third party certificate then use this

Generate the Certificate Signing Request (CSR) using this command:keytool -certreq -v -alias tomcat -file csr-for-myserver.pem -keystore keystore.jks”
You will get response cert from vendor then save the file & do the following”)

Log into the Admin Console, select the server on which you want to configure the SSL certificate.
Servers-click on the keystore tab,by default it points to the demo certificates.

Server  –>  Click on the Keystore tab. By default it points to the Demo Certificates.
From the dropdown list select the “Custom Identity and  Custom Trust” option.
Enter the identity and trust keystore details

 Configure the identity of the server:
Click on the SSL tab and enter the alias of the private key i.e. client in this case and the keypass password.

NOTE: If you enable the SSL for a WebLogic Server, by default it would be One Way SSL. If you want to change to Two Way SSL, you would require to select  the two way SSL behavior from the Advanced option list.

Configure the SSL port.
By default it would be 7002.
Go to server –> General tab –> Specify  and enable SSL port.

You can see the below messages in the server logs which indicate that the certificates are loaded.
Now you can test the web logic with HTTPS