How to run ODI scenario from java?
I am new to java, need to do some testing on how to invoke ODI scenarios from java.
Can somebody drop me some simple code?
Thanks a lot,
Lei
Hi there
1. Start your agent (double click agent.bat)
2. generate scenario for ur package(right click ur package , select generate scenario)
3. Add the odi-sdk-invocation.jar file to your java project
ODIcmdScenario=new OdiCommandScenario();
ODIConnection=new OdiRepositoryConnection();
ODIConnection.setOdiUser("ur-username");
ODIConnection.setOdiPassword("ur-password");
ODIConnection.setJdbcDriver("Driverdetail");
ODIConnection.setJdbcUrl("url-details");
ODIConnection.setJdbcUser("dbusername");
ODIConnection.setJdbcPassword("dbpass");
ODIcmdScenario.setScenName("scenarioname");
ODIcmdScenario.setScenVersion("scenarioversion");
ODIcmdScenario.setLogLevel(5);
ODIcmdScenario.setContext("context");
ODIConnection.setWorkRepositoryCode("repository");
ODIInvocation = new OdiInvocation("hostname", 20910); //20910 default port
OdiInvocationResult result=ODIInvocation.invokeCommand(ODIcmdScenario,ODIConnection);
Hope this helps!
Cheers
Similar Messages
-
How to execute ODI scenario from a web application
Hi
I need to execute ODI scenario from ApEx form.
how to execute ODI scenario from application. Using 10.1.3.5.5
-appIn the SQL property of the TQuery object, enter the call as an anonymous block:
begin
pkg_name.procedure_name(true);
end; -
How to invoke odi scenario from bpel without passing plain text password
Hi
We have following requirement,we would like to invoke odi scenario from oracle bpel process.But one problem is we dont want to pass the odi password as plain text.Please let me know how do i achive this task.
Thanks
BajiHi,
Thanks its working now. I am facing another issue. I do not use parameters in my Scenario. Now when i run my scenario i m getting the following error. I think its because i have not assigned anything to the Variable element. I guess its taking null value for Variable element here and cheking if such a variable exists. Have you come accross such an issue? If so, please sugest remedy.
java.lang.Exception: Specified variable not found in the Repository : null
at com.sunopsis.dwg.dbobj.SnpSession.a(SnpSession.java)
at com.sunopsis.dwg.dbobj.SnpSession.y(SnpSession.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSessionPreTrt(SnpSession.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.h.y(h.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Thread.java:619)
Edited by: silas.john on May 13, 2009 1:29 AM -
ERROR WHILE RUNNING ODI SCENARIO FROM BAM ALERT
We are using oracle data integrator 11g and have created an ODI Scenario and able to run the scenario from ODI studio client.
We have done the configuration for BAM-ODI integration as mentioned in http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bam_odi.htm#BABEJIGD
We have started ODI Agent, soa and bam servers. Created a BAM alert -> select action - Run ODI Scenario -> selected the same scenario.
Alert ran at scheduled time but failed with following error:
java.io.IOException : truncated data integrator frame received
Error Message (if any)
[2012-08-06T11:24:21.046+05:30] [bam_server1] [WARNING] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Error occured while running a ODI Scenario.
[2012-08-06T11:24:21.250+05:30] [bam_server1] [ERROR] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Action exception: EEInstEv2 EEInstAct1 Rule
Id: 2 exception: java.io.IOException: truncated Data Integrator Frame
received
[2012-08-06T11:24:21.250+05:30] [bam_server1] [WARNING] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Exception stack trace: [[
at
oracle.bam.eventengine.engine.event.action.RunScenario.invokeScenario(RunScena
rio.java:145)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.runScenario(ActionP
rocessor.java:891)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.actionHandler(Actio
nProcessor.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.bam.system.Delegate$Sink.invoke(Delegate.java:80)
at oracle.bam.system.Delegate.dynamicInvoke(Delegate.java:186)
at
oracle.bam.common.threading.threadpool.ThreadPoolController$PoolQueueItem.proc
essWorkRequest(ThreadPoolController.java:155)
at
oracle.bam.common.threading.threadpool.ThreadPoolController$PoolQueueItem.run(
ThreadPoolController.java:128)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java
:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908
at java.lang.Thread.run(Thread.java:619)
Any help on this is highly appreciated...
Thanks
Rajdip MukherjeeHi,
Forgot to include the ODI classes RunScenario.invokeScenario() is invoking odi scenario using odi sdk api. Please see the below stack trace :-
java.io.IOException: truncated Data Integrator Frame received
at
oracle.odi.sdk.invocation.internal.AgentNetworkCmd.readCmd(AgentNetworkCmd.java:303)
at
oracle.odi.sdk.invocation.OdiInvocation.invokeCommand(OdiInvocation.java:176)
at
oracle.bam.eventengine.engine.event.action.RunScenario.invokeScenario(RunScenario.java:140)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.runScenario(ActionProcessor.java:891)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.actionHandler(ActionProcessor.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Thanks
Rajdip Mukherjee -
How to run SQL files from Java?
Hi,
Can someone point me towards a link on how to run sql files in Java? Thanks.
P.S...if I've been completely blind please go easy on me!Sorry forgot the formating code thingy
public static boolean executeScript(File script, Connection conn){
boolean success = true;
success = script.exists();
if(success){
DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
StringBuffer buffer = new StringBuffer();
success=readScript(script,buffer);
if(success){
try{
String creationScript = buffer.toString();
Statement st = conn.createStatement();
int start = 0;
int end = 0;
while (end != -1 && start < creationScript.length()) {
end = creationScript.indexOf("GO", start);
if (end != -1) {
DEBUG.print(creationScript.substring(start, end));
st.executeUpdate(creationScript.substring(start, end));
start = end + 2; //2 is the length of "GO"
st.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
}else{
DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
success=false;
return success;
public static boolean readScript(File script, StringBuffer buffer){
boolean success = true;
DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
try{
InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
int ch;
while ( (ch = isr.read()) > -1) {
buffer.append( (char) ch);
if (isr != null)
isr.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
return success;
} -
How to run ODI scenario using command prompt
Hi expets
Please let me know if we can run ODI scenario using command prompt or any way other than operator.
Regards
JanakiramGo to <ODI_HOME>/oracledi/bin in command prompt and invoke startscen command with teh below parameters.
Edited by: Guru Sankar on Feb 28, 2011 4:19 PM -
How to run .html file from .java file..?
Hi All,
I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
Thanks in advance.viswa07 wrote:
You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
[This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
db -
How to run a vi from Java application?
I am passing data to a vi from my java swing application using data socket bean but I have to manually open and run the vi. How can I programatically open and run the vi from my java application without using ActiveX automation server?
I don't know Java but if you can issue a shell command then you can run the VI with the command line:
"\labview.exe" ""
You have to set the VI to "Run when opened". The VI will run each time the command is issued, even if the VI is already opened.
LabVIEW, C'est LabVIEW -
How to run system commands from JAVA
Hi Friends,
How to run windows system commands from JAVA
Runtime r=Runtime.getRuntime();
r.exec("dir");
Throwing following Exception
CreateProcess :dir error=2
Thanks in advance
HamsaHi ,
in Windows NT this is not possible, you can use the following :
Runtime r=Runtime.getRuntime();
StringBuffer sbuf = new StringBuffer();
String dir = new String();
java.lang.Process proc = r.exec("cmd /c dir");
InputStream is = proc.getInputStream();
int ch ;
while((ch=is.read() ) != -1)
sbuf.append((char)ch);
is.close();
dir = sbuf.toString();
System.out.println(dir ); -
How to run Other application from Java
I want to run other applications such as IE.exe, notepad.exe from Java? How can I run?
Dear Friend, the following is the code to open IExplorer from Java Program
class RunTimeTest {
public static void main(String args[]) {
try {
Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.exe");
catch(Exception e) {
[\code]
ALL THE BEST
Shiva -
How to run perl file from java file..???
Hi All,
How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
Any help is appreciated.
Thanks in advance.viswa07 wrote:
Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project. -
How to run geniatagger.exe from java
Hi,
i'm trying to run geniatagger-1.0.exe from java on windows vista, using Process pr = Runtime.getRuntime().exec("C:/geniatagger-1.0/geniatagger-1.0.exe");
However, i keep on getting the same error. "Cannot run *.exe CreateProcess error=2" . I tried the same code with excel.exe which is installed in C:/ProgramFiles
and it worked. I also tried to create a path variable C:/geniatagger-1.0/geniatagger.exe;%path% and then run the same java code. Yet, nothing has changed.
I would really apreciate any helpdalab wrote:
Sorry, i didn't realise that the link was already sent! I found that earlier as well. I"I..." what?
"I ...figured it out"?
"I ... still need help"?
You're not a vampire named Trever are you? -
Error running ODI scenario from batch file
Hello, everyone!
I am loading data into Essbase 11.1.2 from MS SQL Server views using ODI 11.1.1.5.0 and Local agent. I created an interface which runs ok if launched manually from ODI.
Then I created the scenario named MyScenario for this interface and updated odiparams.bat file in *...\agent\bin* folder as follows:
set SECU_DRIVER=weblogic.jdbc.sqlserver.SQLServerDriver
set SECU_URL=jdbc:weblogic:sqlserver://<ServerName>:1433;databaseName=<DatabaseName>
set SECU_USER=<UserName for Master Repository>
set SECU_PASS=<encoded password for MasterRepository UserName>
set ODI_USER=SUPERVISOR
set ODI_PASS=<encoded password for SUPERVISOR>
set WORK_REPOSITORY=<Work Repository name>
Then I created the batch file in which I wrote: *...\agent\bin>startscen MyScenario 001 GLOBAL 5*
However the scenario is not executed with the following error message:
ERROR ODI-1132 Agent Internal encountered a warning: ODI-1414: Error connecting to agent Internal: a JDBC error occurs while connecting to the master repository. Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
I will be very grateful for any hints!A fundamental clarification : where is your master repository database located ? Is it on SQL Server as well ?
The MS SQL Server connection that you mentioned in the SECU_DRIVER, SECU_URL should point to the MR database.
Is the server name in SECU_URL a Fully Qualified domain name or just an IP Address reachable from localhost ?
startscen will spawn a new instance of local agent.
startcmd will reuse an existing agent (not local).
Not sure why your local agent is getting a Network Connection Error. -
How to execute ODI scenarios from command line in Unix
Hi Friends,
I am using ODI 11g.
I want to execute ODI senarios using the command line argument in Unix.
Please let me know how to proceed with this.
Thanks,
LonyHi,
unser the /your_ODI_HOME/agent/bin folder.
Excute this
sh startscen.sh REFRESH_ID 001 GLOBAL 5 -NAME=agent_ODI
REFRESH_ID=Your Scenario name
001:Version
GLOBAL:Context name
5=Log Level
agent_ODI=Your agent name
Regards -
How to run another concurrent from Java Concurrent Program?
Hi,
I have one Java Concurrent Program in ebs R12.
I need to run another Java Concurrent Program when first finished.
I can not find a way to start another request from JCP.
Thanks,
msHi ,
this is an example code to check the OS before running the command :
try{
int ch;
Process proc ;
Runtime r=Runtime.getRuntime();
StringBuffer sbuf = new StringBuffer();
String dir = new String();
String osname = System.getProperty("os.name");
if(osname.equals("Windows NT") )
proc = r.exec("cmd /c dir");
if(osname.startsWith("Linux") )
proc = r.exec("df -k");
InputStream is = proc.getInputStream();
while((ch=is.read() ) != -1)
sbuf.append((char)ch);
is.close();
dir = sbuf.toString();
System.out.println(dir );
}catch(Exception e){ System.out.println(e.getMessage());}
bye
Taha
Maybe you are looking for
-
I have bought movies from itunes and now they are on my computer why is it that each time I try to watch the movie it re downloads and uses up all my internet data? How do I prevent this and make it so it just plays from my stored version on my compu
-
How to Undo Multiple Actions in ActionScript [CS5]
I am wwriting an InDesign extension for CS5 using ActionScript. I want to be able to undo a group of actions as a sungle transaction. In JS, I would use doScript() for this purpose. How do I do it in ActionScript? TIA, mlavie
-
Java.rmi.UnmarshalException: Error unmarshaling return header
Hi, We are running an RMI server instance to serve data ( from memory) to clients. It works fine if fewer number of inquiries goes in. But when the number of inquiries are larger, I am getting some exceptions at the client side. The server crashes wi
-
Best Quality Preset/setting for 16:9 DVD
What do you think is the best quality preset for a DVD to be played at today´s LCD, Plasma or LED TVs? Actual film has been shot with a Panasonic DVX 100BE in 16:9 without black borders, Edited in Pr 5.5.
-
Test IR receiver on a MBP 13" 2011
How can i test my IR Receiver? Using two different Apple Remotes doesnt work, IR is enabled... Is there any sys diag, that shows, wether its funtioning or not? TIA Stef