Any Java API can be used in bpel using java embedding activity.Please follow the previous post of custom logging using log4j.Same approach can be used to call any Java API from BPEL
Thursday, September 1, 2011
selectionFailure fault while updating the output variable in Java Embedding
In my java embedding i was updating the outvariable of the bpel using the setVariable method.But i was getting the following error in doing so.
{{http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure}
messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
parts: {{
summary=
There can be 2 reasons for this either the Xapth expression is wrong.
Second in 11g before setting the value of the outvariable in java embedding it should be intialized.Put an assign activity before java embedding and initialize the variable and than set the value in java embedding and it will work.
Custom logging in BPEL 2.0 using Log4j
We can use Java Embedding activity to do custom logging using log4j.
Download log4j
Deploy the composite and check log file gets created in the location mentioned in the properties file.
Other approach is to copy the log4j.jar in the composite folder under/SCA-INF/lib folder.
Download log4j
Extract the zip file and use the log4j.jar file from that.There are two approaches of using the jar file.
First approach is to put the jar file at the server so that all the applications can use it.
For doing to do the following steps.
1. Copy the log4j,jar at the following location /Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/
2. Open the command prompt and go the the above location.
3. Set the following enironment variables
ANT_HOME -where your ant is installed
PATH -path to bin folder of ant
JAVA_HOME -path to jdk
4.Run the ant command.
5. Check the oracle.soa.ext.jar file in the path log4j.jar path gets added in the jar file
6. Restart the managed server.
Now create log4j.properties file
# logging: Log4j_BPEL
log4j.category.Log4j_BPEL=info,Log4j_BPEL
log4j.appender.Log4j_BPEL=org.apache.log4j.RollingFileAppender
log4j.appender.Log4j_BPEL.File=D:\\Log4j_BPEL.log
log4j.appender.Log4j_BPEL.MaxFileSize=5MB
log4j.appender.Log4j_BPEL.MaxBackupIndex=10
log4j.appender.Log4j_BPEL.layout=org.apache.log4j.PatternLayout
log4j.appender.Log4j_BPEL.layout.ConversionPattern=%d{ISO8601} %-5p [%t] [%c] [%x] %m%n
Copy this file in any location on the server.Say D:\log4j.properties
Import the classes in .bpel file for bpel 2.0
For importing the classes in bpel 1.1 use the following
importType="http://schemas.oracle.com/bpel/extension/java"/>
importType="http://schemas.oracle.com/bpel/extension/java"/>
importType="http://schemas.oracle.com/bpel/extension/java"/>
importType="http://schemas.oracle.com/bpel/extension/java"/>
Now in your java embedding activity enter the following java code
/*Write your java code below e.g.
System.out.println("Hello, World");
*/
try{
String sLog4jFile = "D:\\log4j.properties";
PropertyConfigurator.configure(sLog4jFile);
Logger logger = Logger.getLogger("Log4j_BPEL");
logger.info(">>>> Message log for instance: " + getTitle());
XMLElement input= (XMLElement)getVariableData("inputVariable", "payload","/client:process/client:input");
addAuditTrailEntry("input is: " + input.getTextContent());
logger.info("Input Value :"+input.getTextContent());
setVariableData("outputVariable","payload","/client:processResponse/client:result", input.getTextContent());
}catch(Exception e)
{
e.printStackTrace();
}
Deploy the composite and check log file gets created in the location mentioned in the properties file.
Other approach is to copy the log4j.jar in the composite folder under
Monday, July 18, 2011
Tuesday, June 28, 2011
ORA-04063: package body "DEV_MDS.MDS_INTERNAL_SHREDDED" has errors
After installing oracle SOA Suite 11.1.1.5 on Oracle XE I was getting the following issue
ORA-04063: package body "DEV_MDS.MDS_INTERNAL_SHREDDED" has errors
ORA-06508: PL/SQL: could not find program unit being called: "DEV_MDS.MDS_INTERNAL_SHREDDED"
ORA-06512: at line 1
ORA-06508: PL/SQL: could not find program unit being called: "DEV_MDS.MDS_INTERNAL_SHREDDED"
ORA-06512: at line 1
and the the soa server was not coming up.I followed the following steps and was able to run the server successfully.
- Drop the SOA Schemas using the rcu.
- Connected to the XE database server using the following steps and ran the following commands.
sqlpus
show parameter processes
by default “processes” should be 40. We should make it 300:
alter system set processes=300 scope=spfile;
conn / as sysdba
shutdown immediate
startup
conn / as sysdba
show parameter sga
alter system set sga_target=350M scope=spfile;
alter system set sga_max_size=350M scope=spfile;
shutdown immediate
startup
show parameter processes
by default “processes” should be 40. We should make it 300:
alter system set processes=300 scope=spfile;
conn / as sysdba
shutdown immediate
startup
conn / as sysdba
show parameter sga
alter system set sga_target=350M scope=spfile;
alter system set sga_max_size=350M scope=spfile;
shutdown immediate
startup
After fixing the above parameters.Set the following environmental variable and than run rcu.bat.
set RCU_JDBC_TRIM_BLOCKS=TRUE in the command prompt.
run rcu.bat from the command prompt.
Wednesday, May 25, 2011
Upgrading SOA Suite 11.1.1.4 to 11.1.1.5
Oracle has released the Oracle SOA Suite 11.1.1.5 and weblogic server 10.3.5.To Upgrade the SOA Suite from 11.1.1.4 to 11.1.1.5 follow the previous post of Upgrading WebLogic Server 10.3.4 to 10.3.5 and Upgrading Oracle SOA Suite 11.1.1.4 to 11.1.1.5.
Download the patch number 12395560 from support.oracle.com to upgrade to weblogic server 10.3.5.
Other softwares can be downloaded from the following link
http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html
Download the patch number 12395560 from support.oracle.com to upgrade to weblogic server 10.3.5.
Other softwares can be downloaded from the following link
http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html
Monday, April 11, 2011
Installing AIA Foundation Pack 11.1.1.4
PreRequisites for installing AIA Foundation Pack 11.1.1.4
- Oracle SOA Suite 11.1.1.4.0
- JDeveloper 11.1.1.4.0
- AIA Foundation Pack Service Constructor for JDeveloper 11.1.1.4.0
This extension creates Application Integration Architecture (AIA) Service Constructor to create an AIA based service component project. This extension is an online JDeveloper update. Start JDeveloper. From the menu choose Help > Check for Updates. In the Update Wizard, select Search Update Centers and ensure the first and second options are checked . Then ensure that Oracle AIA Foundation Pack Service Constructor is checked.
AIA Foundation Pack 11.1.1.4 which can be downloaded from the following link
http://www.oracle.com/technetwork/middleware/foundation-pack/downloads/fpdownloads-152617.html
Optional Softwares
- Oracle Enterprise Repository
- Oracle Service Registry
- Oracle Business Process Analysis Suite
Start the node manager .Than start the weblogic server.Than start your soa_server from the admin console using the node manager.For starting the soa_server using the admin console goto servers>control and than start the server.It is mandatory to start the soa_server using the node manager.Once the servers are running,run the Setup.exe for the foundation pack.
Enter the JDK path.Click on next and your installation is complete.
Note: I have not installed Oracle Service Registry and Oracle Service Repository so have skipped those screens while installation.
Subscribe to:
Posts (Atom)