Powered By Blogger

Sunday, April 22, 2012

This project is not associated with an Oracle Service Bus Configuration

When does this happen?
Often you may have to copy code from one place to another. Let us say you have code inside the folder “abc” . Folder abc contains, OSB configuration project, OSB project and some webservices.
Now you move this code from “abc” folder to some other folder say “testing” folder.
Let us say you open the oepe and start importing the moved code/ project. Select FileImport->General->exsiting project from workspace Select root directory. It shows all the  projects in that directory including configuration project. Select all  and click on finish.


Running the configuration(Right click on Configuration and select “run” as and run )
Now if you run the congiguration you may get the above error as “This project is not associated with an Oracle Service Bus Configuration” .

You need to follow these steps
1)Click “Project” and select Clean
2)Drag  the OSB Project into to OSB Configuration project.
Now the issue should be resolved.

Friday, April 20, 2012

OSB 11.1.1.6 Demo Sample developed from scratch

Proof of Concept: OSB Demonstration
This demonstrates the basic OSB sample. You should have already installed OSB and weblogic on your system.

Refer my previous post for installing OSB and weblogic
http://aleemkhan09.blogspot.in/2012/04/installing-osb-11116-with-osb-ide-on.html

For complete document with screen shot you can refer google doc
https://docs.google.com/open?id=0B2u9s7xy74d9WVVjSVdVd1RKM3M


For OSB demo we require the following :
1. Webservice (with WSDL,XSD)
2. Business Service which is developed using above webservice
3. Proxy Service which invokes the above Business service
Let us first construct the WebService
Step A : Construction of Webservice
1)Double click on OEPE which is installed in FMW_HOME/OEPE folder. Choose File->New->Web Service Project as shown below





2)Give the project name as Sample_WS where WS stands for WebService project. If Target run time is not defined then create the new one buy clicking on new runtime and select the version. Here 10.3.6 is selected as weblogic version is 10.3.6


3)Click the Finish button and the Target runtime is visible as shown below

4)Click on Next and follow as shown below

5)change the context root to business/sample
5)
6)Click on Yes” for the below dialogue. Let it be Java EE perspective
7)The webservice Project is created as shown below

8)Right click on src folder and create the package com.osb.sample as shown below


9)Now right click on the package and select weblogic web service and give the name as Sample

10)The following code Sample.java is generated as shown below where you can put your own logic.
Here we have added three methods.
String sayHello(String s)
Int addNum(int a, int b)
Int subNum(int a, int b)

The class is as shown below

import javax.jws.*;

@WebService
public class Sample {

@WebMethod
public String sayHello(String s) {
return "Hello"+s;
}

@WebMethod
public int addNum(int a,int b) {
return a+b;
}

@WebMethod
public int subNum(int a , int b) {
return a+b;
}
}





Step B Configuring the Server and running the webservice
1)Add the server if not added as shown below
Click File->New->other->Server








2)You should be able to see the message as shown above. “Started”
3)Now we need to run the webservice. Right click on the Sample_WS project and click run and select the server added.


4)Access the WSDL through URL
http://localhost:7001/business/sample/SampleService?WSDL





Step C: Create OSB configuration project
Now webservice Is ready. From now onwards the real OSB work starts
we need to create OSB configuration project. .It represents the configuration information associated with an OSB domain (a group of servers, all similarly configured and providing identical functionality).
1)FileNewotherOracle service bus Configuration Project

2)You can keep the default name or if you want can give some meaningful name


Now the configuration is ready hence we need to proceed further to create OSB Project

Step D: Creating Sample OSB project
1)file->Oracle service Bus Project

2)Ensure that OSB Configuration 1 is selected which was created earlier. Give the name which has suffix as _SB just to denote it is Service Bus project as shown below

3)The Sample_SB(Sample Service Bus) project is created as shown below


Step E : Developing Business Service
The next step is to develop business Service which is called by Proxy service
To develop business service we require WSDL of the service which was created earlier.
1)To generate the WSDL , go to the Sample_WS project, under src go to Sample.java , right click and select weblogic webservices and select Generate WSDL as shown below


2)Service is created in the same package as shown below


3)Copy the SampleService.wsdl and the xsd into the Sample_SB project


4)Notice the following in WSDL






Replace the location


With
http://localhost:7001/business/sample/SampleService?WSDL

It should look as shown below







5)Now we can develop business service as shown below as we have WSDL file for the same. Right-click the Sample_SB project in the Project Explorer window and select New -> Business Service from the pop-up menu



6)make sure that the Sample_SB project is selected, and then set the file name field to SampleBiz where Biz stands for Business


7)Busniess service is created as shown below
8)The General Configuration settings needs to be done as shown below


9)Select the WSDL and port (SamplePort) as shown below




10)Select Yes when we get the following dialog


Note:If you select NO then under transport tab you get the error

Step F: Creating the proxy service

Once the Business Service is ready next is to create Proxy Service.The easiest way to create proxy service is to “Right click “ on SampleBiz, select the Oracle Service Bus and select generate proxy which will automatically create the proxy service.
The other way of doing is given below but you need to add more steps
1)Right click project explorer->Proxy Service



2)Select Sample_SB to get rid of the above error. Give the name of proxy as “sample”



3)Do the General configuration as shown below


4)Do the transport configuration as shown below
Change the end point to /osb/Sample


5)Click on the Message flow tab as shown below


6)Add the routing so that it gets routed to SampleBiz. Drag Route from Nodes from RHS.

7)Click on Routing from route Actions. After adding Routing it looks as shown below


8)Click on Routing on LHS and browse the Service and point to SampleBiz as shown below

Step G: Deploy project
1)Go the server tabs, right click on the server tab, click “Add and Remove”



2)Add OSB_Configuration , Sample_ws, Sample_SB to the server
Note: The Sample_SB project is part of the OSB_Configuration, so you do not need to add it explicitly. Just click the Finish button, and OEPE will deploy the projects.



3)After clicking finish the services would be deployed

4)Verify the service
Login to localhost:7001/sbconsole weblogic/welcome1 , notice the proxy service , business service are deployed



5)When you try to launch test console to test the proxy service through “Actions” as shown in above figure, you may get error as "Test Console" service is not running. Contact administrator to start this service.

Note: Test console will work only when OSB server is up and running (Along with admin server); and all deployments on OSB server are in active state. Make sure to check this by logging to em. If osb server is not up then start the server

6)Now start the OSB_server
startManageWeblogic.cmd osb_server1 from the location
E:\ oracle\fmw11116\user_projects\domains\osb_domain\bin
Check through EM if it has been started
7)testing the proxy service
Now launch the TestConsole as described previously and give the input . Select the addNum operation from the available operations. Given the input as 3,3 and you should get the ouput as 6.



8)Analyzing more details
If you scroll down in the same test console , you could see the invocation trace. Notice thei incoming request, also notice it is getting routed to sample business service called samplebiz.

Tuesday, April 17, 2012

Installing OSB 11.1.1.6 with OSB IDE on windows 7 64 bit

Installing OSB on windows 7 64 bit:
It is not very straight forward to install OSB server, OSB IDE ,weblogic on windows 7 64 bit. For 32 bit we get OEPE with weblogic which is quite easy to install, but on 64 bit you don't have OEPE with weblogic. You need to install weblogic separately then install OEPE . Here selecting the OEPE version is tricky. If weblogic version is 11.1.1.6 , it does not mean you have to select OEPE version of 11.1.1.6. It will not work. Infact the correct version of OEPE is 11.1.1.8. Now what about OSB? which version should be selected? OSB should be of version 11.1.1.6 . So in summary
weblogic: 11.1.1.6
OEPE: 11.1.1.8
OSB 11.1.1.6

Important points

1)Weblogic and OSB versions should be same if you want OSB IDE to be installed.
So weblogic is 11.1.1.4 , then OSB should be 11.1.1.4.
Incase if they don’t match then while installing OSB (from osb_generic_11.1.1.4) you may get error as “weblogic is not suited for this version of IDE” at step 4 (Typical/Custom step)

2)OEPE should be compatible with the OSB version.

Here are the list of compatible OEPE with OSB . There is no document for this though
OSB Weblogic Server OEPE
11.1.1.6.0 10.3.6 11.1.1.8.0
11.1.1.5.0 10.3.5 11.1.1.7.2
11.1.1.4.0 10.3.4 11.1.1.6.1
11.1.1.3.0 10.3.3 11.1.1.5


STEP1: Install JDK
Install JDK (Jrockit can be preferred)
jrockit-jdk1.6.0_26-R28.1.4-4.0.1-windows-x64(1) should be installed .Always prefer Jrockit over JDK as Jrocking has very good performance

STEP2: Install Weblogic

1. Open a terminal and go to the folder where wls1036_generic file is.
2. Execute the following command:
Double click on the file
3. When the oracle weblogic installer starts, click next and enter the folder you want to use as Middleware Home Directory, for example:
E:\InstalledSoftwares\oracle\fmw11116
4. Choose the typical installation (or customise if you need). Better to select customize as you can install examples also
5. On the JDK installer screen, the installer should automatically recognise the JDK installed during step 1. If not, click on “Browse” button and point to JDK directory (e.g. /jrocking).
6. Finish the installation.

STEP 3 – Install Oracle Enterprise Pack for Eclipse
Download from
http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html
Just extract the oepe-indigo-all-in-one-11.1.1.8.0.201110211138-win32-x86_64
content into a folder named “oepe” in you middleware home directory, for example:
E:\InstalledSoftwares\oracle\fmw11116\oepe-indigo11.1.1.8.0_64

STEP 4 – Install OSB

Download from :http://www.oracle.com/technetwork/middleware/service-bus/downloads/index.html
1. Extract the downloaded zip file (ofm_osb_generic_11.1.1.6.0_disk1_1of1) into a any folder. Go to that “Disk 1” directory under the extracted folder and run the following command:
E:\softwares\OSB\ofm_osb_generic_11.1.1.6.0_disk1_1of1\Disk1>setup -jreLoc E:\InstalledSoftwares\jrockit
2. we have provided the JDK location in the above command
3. During the rest of the installation used the settings below
Installation location:
Oracle Middleware Home :E:\InstalledSoftwares\oracle\fmw11116\
Oracle Home Directory: Oracle_OSB1
Installation Type: Custom (ensure that ORACLE BUS IDE is selected).
Note the following in “Typical”. If the version is not matched it would say weblogic version is not compatible with OSB IDE. Then in “CUSTOM” you won’t be able to select the ORACLE BUS IDE. This means that weblogic which is selected is of different version say 11.1.1.4 and OSB_GENERIC is of different version say 11.1.1.6
Prerequisite Checks – This stage passes
Product Home Location:
Weblogic Server Location: / E:\InstalledSoftwares\oracle\fmw11116\wlserver_10.3
OEPE Location E:\InstalledSoftwares\oracle\fmw11116\oepe-indigo11.1.1.8.0_64

Note the following: The OEPE location is automatically taken. Suppose if OEPE version is not compatible with OSB , then OEPE will not get recognized. You will get message as “OEPE” location is invalid even if you manually select the OEPE. So in this example OEPE should be 11.1.1.8 and OSB should be 11.1.1.6

Step5: Verify the OSB IDE
Check if OSB IDE has been installed or not
Open the eclipse ide from the below location
E:\InstalledSoftwares\oracle\fmw11116\oepe-indigo11.1.1.8.0_64
Set the workspace to any folder
Check the following
Window->open perspective->other->Oracle Service bus
You should be able to see the Oracle Service bus

Step6)Configuring the OSB SERVER or creating the domain
a) Go to E:\InstalledSoftwares\oracle\fmw11116\Oracle_OSB1\common\bin
b) Config.cmd
c) Select new domain creation.
d) Select the configuration as shown below so that we get OWSM,EM etc
e) give the domain name as osb_domain
f) Give username as weblogic/welcome1
g) Select development mode
h) Give the databse details for OWSM MDS schema(ignore the failure test) and OSB JMS reporting provider
i) Proceed to next step(by pass the DB connection if it asks),


Step 7)Access the sbconsole
Go to the following location:
E:\InstalledSoftwares\oracle\fmw11116\user_projects\domains\osb_domain
And type the following
startWeblogic.cmd
Now access the sbconsole
http//localhost:7001/sbconsole
enter weblogic/welcome1
you should be able the see the screen