Friday, September 20, 2013

AIDConfigurationLibraryTasks.xml:298: java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

WHile installing AIA 11.1.1.7 i was facing this issue in the deploy application.


[exec] Connecting to t3://localhost:7001 with userid weblogic ...
[exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'soa_domain'.
[exec]
[exec] Warning: An insecure protocol was used to connect to the
[exec] server. To ensure on-the-wire security, the SSL port or
[exec] Admin port should be used instead.
[exec]
[exec]
[exec] Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
[exec] For more help, use help(domainRuntime)
[exec]
[exec] No stack trace available.
[exec] Disconnected from weblogic server: AdminServer
[delete] Deleting: C:\FPack\aia_instances\FPack\tmp\keyFile
[delete] Deleting: C:\FPack\aia_instances\FPack\tmp\propFile
[echo] Begin Validating schema

BUILD FAILED
C:\FPack\Infrastructure\Install\AID\AIAExecuteDriver.xml:223: The following error occurred while executing this line:
C:\FPack\Infrastructure\Install\AID\AIAExecuteDriver.xml:65: The following error occurred while executing this line:
C:\FPack\aia_instances\FPack\tmp\AIDExecuteDP_temp_876603822.xml:11: The following error occurred while executing this line:
C:\FPack\Infrastructure\Install\AID\lib\AIDConfigurationLibraryTasks.xml:298: java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

this happened because the AIA schema i have specified user name as sys and it was not having all the privileges

I logged to database manually

Logged in using system as user and grant all privileges to sys

Wednesday, September 18, 2013

Can't load AMD 64-bit .dll on a IA 32-bit platform


While trying to start node manager on a 64 bit machine you are getting the following error message

Caused by: java.lang.UnsatisfiedLinkError: C:\Oracle\SOA\wlserver_10.3\server\na
tive\win\x64\nodemanager.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform




In order to resolve this issue

Create a file nodemanager.properties in %WL_HOME%\common\nodemanager location

Add following lines in the property file

NativeVersionEnabled=false

this command will force node manager not to use .DLL files

Start up now

Tuesday, August 13, 2013

Supervisor password is not working in ODI

I was trying to set up ODI 11.1.1.7 at my local machine and faced this issue.



It was not accepting the new password and i was not able to pass through this stage.

Log in to ODI master schema and execute following query

select * from SNP_USER

This table contains the user id details and the encoded password for the repository.

you can alter this.

This is an encoded password .So you can use the encode.sh command for your password.

If this doesn't work for you ,Just try to recreate you RCU and use the same password.

FRM-92095: Oracle JInitiator version too low. Please install version 1.1.8.2 or higher

While trying to open oracle forms in oracle apps you are getting this error.

This is an annoying error and there are multiple solution for this.

you can refer to the following block for the possible solutions

https://blogs.oracle.com/ptian/entry/solution_for_error_frm_92095

The first one has worked for me.

I just created an environment variable.

with variable name =JAVA_TOOL_OPTIONS

variable value = -Djava.vendor="Sun Microsystems Inc."



AFter that i was able to resolve my issue

Wednesday, July 31, 2013

Facing issues with OSB pluggins for OEPE

I was working with OSB 11.1.1.6 and faced this issue.

The version of oepe supported with osb 11.1.1.6 is 11.1.1.8

I did a setup of weblogic server(10.3.6) with oepe

then i installed osb 11.1.1.6 on top of it to update my oepe with osb pluggins.

I tried to deploy my process from the new eclipse but with no success.

It just got stuck while publishing the data in to server.

I tried all the possible options but was not able to fix it.

I went ahead and checked all the installation files that gets installed with oepe

I came across this file oracle.osb.ide.link in the ..\OEPE\oepe_11.1.1.8.0\dropins

When i opened this i got following entry.

path=C:/Oracle/OEPE/Oracle_OSB1/eclipse140

I checked in few blogs and found that this should point to the osb home

http://mischakoelliker.wordpress.com/2010/08/31/oracle-service-bus-upgrade-to-oepe-11-1-1-6/

So i just removed the reference to eclipse and now my entry says

path=C:/Oracle/OEPE/Oracle_OSB1

After that i restarted my eclipse with a new workspace and i was able to deploy the process to the server.

Tuesday, July 30, 2013

Retrieve error code and error message in pl/sql

In soa we can use the runtimeFault.wsdl to get the code,summary and details of error messages

or we have the option to get it using prebuild function in advanced column

ora:getfaultAsString() and ora:getFault()

In a similar way we have something in pl/sql which can be used to retrieve the exact error code and error message.

This is required as we often need to capture these details and pass it to the error table so that it can be passed to the BAM for monitoring.

We will see and example on how to capture the error code and error message in pl/sql

Create an error table

CREATE TABLE error_table (
ErrorCode NUMBER,
ErrorMessage VARCHAR2(64),
ErrorTime TIMESTAMP);


Now make sure you have a employee table

IN my case it has an element fullname and employeeid

SET SERVEROUTPUT ON
DECLARE
name employee.fullname%type;
error_code NUMBER;
error_msg VARCHAR2(64);
BEGIN
SELECT fullname INTO name
FROM EMPLOYEE
WHERE EMPLOYEEID = -420;
EXCEPTION
WHEN OTHERS THEN
error_code := SQLCODE;
error_msg := SUBSTR(SQLERRM, 1, 64);
DBMS_OUTPUT.PUT_LINE
('Error code ' || error_code || ': ' || error_msg);


INSERT INTO error_table
VALUES (error_code, error_msg, SYSTIMESTAMP);
END;
/


So once you will execute this code you can go and check the error table it will be populated with the error details

Since you have already used set server output on you will be able to see the error in screen also as below

anonymous block completed
Error code 100: ORA-01403: no data found


There are two variable "SQLCODE" and "SQLERRM" which we have used to retrieve the error code and error message.

These are system defined code and can not be used directly , in order to use them we must assign them to some variable.

Now in an ideal fault handling scenario we can call a procedure in the fault handling block.

One important thing to note here is that when we call a procedure in fault handling block we must call the procedure define with

PRAGMA AUTONOMOUS_TRANSACTION

This is again similar to transaction concept in Oracle SOA suite.

When you define a procedure of function with PRAGMA AUTONOMOUS_TRANSACTION the procedure or function will run in a separate transaction.

that means it will be independent of the primary block where it is getting called.

Triggers in Pl/SQL

As we have event in SOA in a similar way we have triggers in pl/sql

Triggers cause a function/program to be called when a particular event occurs.

Lets understand this example.

The first thing you have know is that you can not have trigger on object hold be sys schema

so connect to the db using a different schema other than sys

now create two tables in the same


CREATE TABLE Old_product
(product_id number(5),
product_name varchar2(32),
supplier_name varchar2(32),
unit_price number(7,2) );

CREATE TABLE New_product
(product_id number(5),
product_name varchar2(32),
supplier_name varchar2(32),
unit_price number(7,2)

Insert a dummy value in the new product table

INSERT INTO NEW_PRODUCT VALUES('100','test','ABC','420');

Now the functionality here is that when ever some one will update the new product table the values of the existing changed component should be copied to old product table.

To achieve this target we will use a trigger.

CREATE or REPLACE TRIGGER price_trigger
BEFORE UPDATE OF unit_price
ON New_product
FOR EACH ROW
BEGIN
INSERT INTO Old_product
VALUES
(:old.product_id,
:old.product_name,
:old.supplier_name,
:old.unit_price);
END;
/

It says when ever the price is updated in the new product table copy that record in the old product table

We will now try to understand it by updating the new product table

UPDATE NEW_PRODUCT SET unit_price = 800 WHERE product_id = 100

Now as soon as you will execute this command

two things will happen

First the new product table will be updated and a new row will be inserted in the old product table

the new product table will contain a unit price of 800 however the old product table will contain a unit price value of 420


Synonym in oracle

You are logged in to database using sys user

and you wanted to retrieve the hr tables.

there are two ways

1>you can call the hr table by prefixing the table name with hr

i.e if you have to refer employee table.

you can do select * from hr.employees.


Or you can define a synonym

create PUBLIC synonym emp for hr.employees

Now you have created a synonym for hr.employees as emp

so in order to retrieve the data from employees table in hr schema you can just execute the below query

select * from emp;

Friday, July 19, 2013

Read data from database and display result using JAVA coding



import java.sql.*;

public class JavaMySQL {
public static void main(String[] args) {
String url = "jdbc:oracle:thin:@localhost:1521:orcl";
String username = "sys as sysdba";
String password = "welcome1";
ResultSet result = null;

String sql = "SELECT DETAILS From SERVER";

try {
Connection connection = DriverManager.getConnection(url, username, password);
Statement statement = connection.createStatement();
//System.out.println(statement.execute(sql));
statement.execute(sql);
result= statement.getResultSet();
while(result.next() ){
String val = result.getString(1);
System.out.println(val);}
connection.close();
} catch (SQLException e) {
System.err.println(e);
}
}
}


Thursday, July 18, 2013

Create an LOV in ADF

Create a new ADF project and it will create a model and view for you.

Click on model and select the ADF business component and Entity object





name it and select the schema you wanted to use.



select the attribute for which you wanted to create lov and say next



Generate view object and app module



Select model and create a view object



select the model you wanted to use



select the field you wanted to create lov


keep saying next and complete the wizard


got to entity object view -->attributes and list of values and create a new LOV



this was the object view created with model and not with view object.

create a new data source and now move the view object that you have create later under the available model



select the attribute .go to ui hints and complete as shown



Complete the wizard and then create a new page.

From the data control drag and drop the name field in the page in the form of single selection ,select one choice as shown



Save and deploy the page you will be able to see the lov

Wednesday, June 26, 2013

Shutting down Android Debug Bridge server... Deployment cancelled.




while trying to deploy ADF mobile apps i got this error

[06:22:49 PM] Shutting down Android Debug Bridge server...
[06:22:49 PM] Deployment cancelled.
[06:22:49 PM] ---- Deployment incomplete ----.
[06:22:49 PM] Cannot run program ""C:\Software\Android\adt-bundle-windows-x86_64-20130522\sdk\platform-tools\aapt"": CreateProcess error=2, The system cannot find the file specified
[06:22:49 PM] CreateProcess error=2, The system cannot find the file specified

The solution is specified in the following location

https://blogs.oracle.com/onesizedoesntfitall/entry/adf_mobile_deploying_to_android

Tuesday, June 25, 2013

New button is deactivated in Jdeveloper





I was trying to set up Jdeveloper at my local machine and faced this issue.

The jdeveloper installed correctly but it was not allowing to create/delete any thing.






In order to resolve this issue

Go to Tools-Preferences-Roles and make select the default role

This will ask for a jdeveloper restart.

Once it is restarted you will be able to see all the buttons active

Thursday, June 20, 2013

FTP/FILE Adapter

Set the File adapter to process files based on their creation date/time:-

First of all you need to apply patch 6445656 -ALLOW FILE PROCESSING BY CREATION DATE

Now in the WSDL of the file adapter set the following

ActivationSpec="oracle.tip.adapter.file.inbound.FileActivationSpec"
Sorter="oracle.tip.adapter.file.sorter.TimestampSorterAscending"

to sort the files in ascending order

or

ActivationSpec="oracle.tip.adapter.file.inbound.FileActivationSpec"
Sorter="oracle.tip.adapter.file.sorter.TimestampSorterDescending

to sort the files in descending orders.

You also need to model your bpel process.
Make the BPel process a synchronous process and

Set Number of threads in bpel/system/services/config/pc.properties to "1"

This setting will allow the files to be sorted as per their date/time stamp.

This feature has been added as a feature in 10.1.3.3 MLR#14 onwards

If you want to use the same feature in FTP adapter you need to do some extra settings.

In the inbound activation you need to set useNlst="true"

This parameter tells the adapter to use LIST command to get filenames in a list. Thus the adapter can capture the tiemstamp, size information during the inbound listing.


So your entry should look like this

ActivationSpec="oracle.tip.adapter.ftp.inbound.FTPActivationSpec"
DeleteFile="true"
IncludeFiles=".*\.txt"
PollingFrequency="60"
MinimumAge="0"
useNlst="true"
Sorter="oracle.tip.adapter.file.inbound.listing.TimestampSorterAscending"

Here again you need to Edit file SOA_HOME\bpel\system\services\config\pc.properties and change
oracle.tip.adapter.file.numProcessorThreads=1

If you are using ESB you need to edit file SOA_HOME\integration\esb\config\pc.properties.

If you don't have this property file you can just reanme the pc.properties.esb to pc.properties and make the changes there

====================================================================================

Controlling the name of the Archieved file in FTP adapter :-

The FTP adapter by defalut add the timestamp to the file created so that if the ftp adapter is creating a file of same name it can be distinguished easily from the previous file.

You need to model your bpel process,Make it as a synchronous bpel process

Use synchronous read feature to read the file and then move it to the archive folder

use the header mechanism to use the same file name

In order for a FTP adapter to move file to remote archive directory, specify
UseRemoteArchive="true" in the adapter wsdl (as an attribute of the jca:operation)

Deploy your process.
====================================================

The date format for the XML element that has to be used with file adapter should be in the following format YYYY-MM-DDTHH:mm:ss

========================================================

Obtain the size of files

In the file|FTPAdapterInboundHeader.wsdl make an entry for size

<element name="InboundFileHeaderType">
<complexType>
<sequence>
<element name="Name of FIle" type="string"/>
<element name="Directory of file" type="string"/>
<element name="Size of file" type="string"/>
</sequence>
</complexType>
</element>


Now Create a variable to read the size element published from the inbound and assign it to some output variable to display the result.

=============================================

configure number of threads for file/ftp adapter

FOR bpel SOA_HOME\bpel\system\service\config. Set the value for oracle.tip.adapter.file.numProcessorThreads in pc.properties file. By default, it is set to 4.
For esb rename SOA_HOME\integration\esb\config\pc.properties.esb to pc.properties. Set the value for oracle.tip.adapter.file.numProcessorThreads.

Namespace conflict in include and import in XSD




Namespace is a important concept in Schema.

One need to understand the basic difference in the two as

Include is used when the target schema has the same targetnamespace as source schema

Import is used when target schema has a different targetnamesapce as source schema


The example below will clarify the difference and will give a basic idea on namespaces too

Employee.xsd
================

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://raj.com"
xmlns:raj="http://raj.com"
elementFormDefault="qualified">
<xsd:element name="Employees">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="header_Id" type="xsd:integer"/>
<xsd:element name="Employee" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" maxOccurs="unbounded" type="xsd:string"/>
<xsd:element name="Age" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>




OtherEmployee.xsd
==================

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://raj.com"
xmlns:raj="http://raj.com"
elementFormDefault="qualified">
<xsd:element name="Employees" type="raj:employeeType"/>

<xsd:complexType name="employeeType">
<xsd:sequence>
<xsd:element name="header_Id" type="xsd:integer"/>
<xsd:element name="Employee" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" maxOccurs="unbounded" type="xsd:string"/>
<xsd:element name="Age" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>

</xsd:schema>


Manager.xsd
============

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://anil.com"
xmlns:Mang="http://anil.com"
xmlns:raj="http://raj.com"
elementFormDefault="qualified">
<xsd:import namespace="http://raj.com"
schemaLocation="OtherEmployees.xsd"/>
<xsd:element name="Manager">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="EmployeeType" type="raj:employeeType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>


OtherManager.xsd
================

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://raj.com"
xmlns:Mang="http://raj.com"
elementFormDefault="qualified">
<xsd:include schemaLocation="OtherEmployees.xsd"/>
<xsd:element name="Manager">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="EmployeeType" type="Mang:employeeType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>


Just copy paste the above xsd in your local machine and you should be able to understand about types also in xsd.

A good example is also published in following

http://www.liquid-technologies.com/Reference/XmlDataBinding/source/HowTo/WorkingWithMultipleSchemas.htm

Tuesday, June 18, 2013

How to seed oracle demo user community





I had a big time issue following the above doc and then i followed the following blog

https://blogs.oracle.com/middleware/entry/installing_seeded_users_for_bpm_11113_on_linux

If you have a managed server then make sure that you are specifying the soa_server1 in target or whatever the name of your server.

Make sure that JAVA_HOME is pointed to your jdk directory and not JRE JAVA_HOME=C:/JDK





Just from my experience the following code and not didn't work for me

Download the code "workflow-001-DemoCommunitySeedApp" from https://java.net/projects/oraclesoasuite11g/pages/HW

http://docs.oracle.com/cd/E28280_01/admin.1111/e10226/appx_users.htm



This will work only if you remove the following code from build.xml file







Tuesday, January 22, 2013

How to change the time format in SOA


Drag and drop a format-dateTime function in Transformation In picture you will specify what is the format you want your output to be "[Y0001]-[M01]-[D01]-[H01].[m01].[s01].[f000001]" it will produce an output in 2000-12-11-12.12.23.120000 Similarly you can change the picture to produce output in your required format.

Tuesday, January 08, 2013

How to pass Batch ID in ODI Call from SOAP UI

Create a project variable.

DAta type -alphanumeric

No history

default value -1

In refreshing page get the sequence value

select XX_WSH_SHIPMENT_GDW_STG_S2.NEXTVAL from dual

Now the logic is we can call the process from SOAP UI or otherwise it should be put in scheduler

So for this to achieve we first create the variable BATCH_ID as defined earlier

Then in the package we first declare then evaluate it .

We compare if it is greater than zero .

If yes then directly complete the interface

however if it is less than zero then go to another step where again drag and drop the BATCH_ID as refresh variable.

This way you can both call the service from SOAP ui and as well as you can put it on scheduler.

In case of scheduler default value will be always -1 hence it will refresh the value

however in case of ODI call the passed value will be always greater than 0 hence refresh step will be skipped and the value passed from SOAP ui will be used as a BATCH _ID


Calling ODI SCenario from SOAP UI



   
   
     
         
         
           
           
            user
           
            password
            DEVWORKREP
         
         
            SCENARIONAMEPRC
            001
            001
           
            false
           
           
           
           
           
 
               
               SCENARIONAME.BATCH_ID
               78
           

           
            5
       
     
 


When calling ODI Scenario from SOAP UI make sure that you are passing the correct user id password which is there for ODI console.


If you are passing any input variable it should be passed in Variable.

Name should be poject name.variable name

and value should contain the value.

One important thing is there is gap in the project name make sure you are replacing it with underscore _ while passing the variable in odi call.