ODIExperts.com

The blog for Oracle Data Integrator ( ODI )

ODI SDK Setup and Config in Eclipse

ODI SDK gives ODI 11g a big edge and a large possibility of automation , smarter coding and cut down in development time . In this post I am going to use Eclipse to configure and setup the the SDK so we can start writing faster and smarter codes. Although there are many other tools to do the job , its just my preference and ease of use which made me use eclipse and write this post.

Setup Eclipse

Weblogic comes with Oracle Enterprise pack for Eclipse else you can Download the Eclipse Classic –http://www.eclipse.org/downloads/

Once Download , Extract the folder and double click the Eclipse.exe and you will be prompted for a Workspace folder. You can use the default or Create a new Folder  use as the workspace.

Workspace is where Eclipse stores all the projects.

image

Now click on the icon as shown in the image and click on the Project .

image

Select Java Project and click Next

image

Provide a Project Name and eclipse would automatically select the default JRE in case it doesn’t you can click on Configure JREs and select the java folder . Finally click Next.

image

Go to the Libraries tab and click on the Add External JAR

image

Add JAR Files

Go and find the folder in oracledi.sdklib and select all the jar files under this folder. Although the main jar is odi-core.jar but it have some link with other jar inside and in order to avoid the confusion  I have just selected all the jar inside the folder .

For my example the directory is – >

C:OracleMiddlewareOracle_ODI1oracledi.sdklib

image

Apart from the above jar files , we also need to include the database jar file where the ODI repository resides. For my example ODI Master and Work repository is on Oracle 11.2 version so ojdbc6.jar file .

image

Finally click the Finish button. Now we are ready to start our coding .

image

Creating First Code

Lets start creating out First piece of Code. Our first piece of code is to create a Project and a Folder.
To do so , Right click on Folder and select New and then Class

image

I have created a package called odi.sdk , you can use the main src or create a separate package which is recommended.

Provide the Class Name and select the option as show in the below image

image

copy paste this standard codes as this code will be the main skeleton for all ODI SDK development after this

public static void main (String [] args ) { << paste the below codes and change the connection credentials >> }

final SimpleOdiInstanceHandle odiInstanceHandle = SimpleOdiInstanceHandle.create
("jdbc:oracle:thin:@localhost:1521:XE",
"oracle.jdbc.OracleDriver",
"ODI_MASTER_11G",
"ODI_MASTER_11G",
"WORKREP1",
"SUPERVISOR",
"SUNOPSIS");

// Allocate an odisinstance of the name
final OdiInstance odiInstance = odiInstanceHandle.getOdiInstance();
try
  {
     TransactionTemplate tx = new TransactionTemplate(odiInstance.getTransactionManager());
     tx.execute(new TransactionCallbackWithoutResult()
        {
         protected void doInTransactionWithoutResult(ITransactionStatus pStatus)
         {

        /*
         *  <<  ODI SDK Codes goes here >>
         */

          } });
     }

finally
        {
         odiInstanceHandle.release();
        }

For ODI 11.1.1.3 and later

        /****** Please change these Parameters *********/

        String Url = "jdbc:oracle:thin:@localhost:1521:xe";
        String Driver="oracle.jdbc.OracleDriver";
        String Master_User="ODI_MASTER_11G";
        String Master_Pass="ODI_MASTER_11G";
        String WorkRep="WORKREP1";
        String Odi_User="SUPERVISOR";
        String Odi_Pass="SUNOPSIS";

// Connection
MasterRepositoryDbInfo masterInfo = new MasterRepositoryDbInfo(Url, Driver, Master_User,Master_Pass.toCharArray(), new PoolingAttributes());
WorkRepositoryDbInfo workInfo = new WorkRepositoryDbInfo(WorkRep, new PoolingAttributes());
OdiInstance odiInstance=OdiInstance.createInstance(new OdiInstanceConfig(masterInfo,workInfo));
Authentication auth = odiInstance.getSecurityManager().createAuthentication(Odi_User,Odi_Pass.toCharArray());
odiInstance.getSecurityManager().setCurrentThreadAuthentication(auth);
ITransactionStatus trans = odiInstance.getTransactionManager().getTransaction(new DefaultTransactionDefinition());

        /*
         *  <<  ODI SDK Codes goes here >>
         */

// Finally close the Instance
        odiInstance.getTransactionManager().commit(trans);
        odiInstance.close();

image

As you can see some read mark on some of the codes and that is because we have not imported the required java libraries .

Importing library is just a matter of click now. Just place your mouse on the red underlined code . you will see options as shown in the image . Now click on the Import SimpleOdiInstanceHandle. Keep doing so for other underlined codes and eclipse will import automatically .

image

After doing that as you can see that eclipse has neatly and smartly import the required libraries.

image

Now go and change the connection properties and change it accordingly to connect to your Master and Work Repository.

Lets first make sure if we are connected and we can start playing around with more ODI SDK codes.

In order to test the connection and if I am connected I always use this code to test it .

OdiTechnology oracleTechnology =((IOdiTechnologyFinder)odiInstance.getTransactionalEntityManager().
getFinder(OdiTechnology.class)).findByCode("ORACLE");

System.out.println(oracleTechnology.getName());

As you can see the output will be like this , which mean the credentials are correct and now we are ready to write more codes.

image

Creating  Project, Folder and Context

Lets start with creating a Project , Folder and Context and setting the Context as Default.

Also you would need this API document in better understanding arguments to be passed.

http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e17060/toc.htm

OdiProject proj = new OdiProject("XMT", "XMT");
//OdiProject(java.lang.String pName, java.lang.String pCode)

OdiContext context=new OdiContext("XMT");
//OdiContext(java.lang.String pCode)

context.setDefaultContext(true);

Searching the Classes

Lets see how to find the required class .

To search go to the above link (http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e17060/toc.htm ) and press find depending on your browser and type odiproject and browser will show the required alternative and click the class you were looking for .

As you can see for this example i searched for odiproject and found the class OdiProject and on the right side i can see all the Methods and Constructor and use the same in writing the SDK codes.

The Constructor of the OdiProject is

OdiProject(java.lang.String pName, java.lang.String pCode).

Here i am replacing the Name and code with XMT  and so the codes will be

  • OdiProject proj = new OdiProject(“XMT”, “XMT”);

The Constructor for OdiContext is OdiContext(java.lang.String pCode)

  • OdiContext context=new OdiContext(“XMT”);

I also wanted to see the new context as the default context , so add the method setDefaultContext(boolean);

  •  context.setDefaultContext(true);

Eclipse can help you in writing the arguments .

image

Eclipse will show more method once you press (period) and as show in the below image, but we always need the help of the API so we can pass the correct arguments.

image

image

Lets Execute the code and lets see if the codes have been reflected in the ODI .

image

image

Its blank . hmm so we are missing something . We are missing the Persist .

Persist is like saving the codes into the Repository, so make sure we add the persist as required  .

Lets add the persist  and run it again.

image

As you can see the execution got successful and we can see the Project, Folder and Context  in the ODI Designer.

image image

IFinder

IFinder is used to find different ODI objects according to ODI object and there are different IFinder to find the respective ODI objects

For Ex – IOdiCKMFinder, IOdiColumnFinder, IOdiConditionFinder, IOdiContextFinder, IOdiContextualAgentMappingFinder, IOdiContextualSchemaMappingFinder

Writing the IFinder codes are very easy . Let me share with you the technique i use.

project = ((IOdiProjectFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiProject.class))

Have a default template as shown above and accordingly change the Object type . Lets say if i want to search for OdiFolder

Replace the OdiProjectFinder to OdiFolderFinder and
OdiProject.class to OdiFolder.class and replace the variable project to folder etc.

Lets look at this simple example where I am using the IOdiProjectFinder to list all the project in the work repository.

// List all the projects

Object[] project = ((IOdiProjectFinder)odiInstance.getTransactionalEntityManager().
getFinder(OdiProject.class)).findAll().toArray();

 for ( int i =0 ;i <project.length ; i++ )  {
    OdiProject pro1=(OdiProject) project[i];
   // We need to cast the object project accordingly, for this example OdiProject
 System.out.println("Project Name "+pro1.getName());
}

// (or)

for (Object object : project) {
     OdiProject pro2=(OdiProject) object;
     // Here i am casting the object as OdiProject
     System.out.println("Project Name "+pro2.getName());
}

 //Reading the List of the Folder under a Project
//

 Collection fold1 = ((IOdiFolderFinder)odiInstance.getTransactionalEntityManager().
getFinder(OdiFolder.class)).findByProject("XMT");

for (Iterator iterator = fold1.iterator(); iterator.hasNext();) {
     OdiFolder object = (OdiFolder) iterator.next();
     System.out.println("Folder Name "+object.getName());
}

image

Eclipse can help to write the for loop too.

To do so

type – for and press ( control + space keys ) and eclipse will show automatically the option and since we are writing for the collection select the required for loop and change the Object to OdiFolder .

image

Creating  Data Server , Physical Schema and Logical Schema .

// Create a Data Server , Physical Schema, Logical Schema

// First lets make sure if we have the Oracle Technology

OdiTechnology oracleTechnology = ((IOdiTechnologyFinder) odiInstance
.getTransactionalEntityManager().getFinder(OdiTechnology.class)).findByCode("ORACLE");
// using the IOdiTechnologyFinder to finder the required technology
if (oracleTechnology != null) {
    oracleDataServer = new OdiDataServer(oracleTechnology,"ORCL_TARGET");

// connection settings
//Providing the  Url and Driver
oracleDataServer.setConnectionSettings(new OdiDataServer.JdbcSettings(
"jdbc:oracle:thin:@localhost:1521:orcl",
"oracle.jdbc.driver.OracleDriver"));

// UserName and Password
oracleDataServer.setUsername("HR");
oracleDataServer.setPassword(ObfuscatedString.obfuscate("HR"));
// ObfuscatedString.obfuscate will save the password in the encrypted format
}

// Creating a New Physical Schema
OdiPhysicalSchema oraclePhysicalSchema = new OdiPhysicalSchema(oracleDataServer);

// Set additional information on the schema
oraclePhysicalSchema.setSchemaName("HR");
oraclePhysicalSchema.setWorkSchemaName("ODI_TEMP_11G");

// Create the logical schema and the mapping to it in the context

OdiLogicalSchema oracleLogicalSchema = new OdiLogicalSchema(oracleTechnology, "HR");
new OdiContextualSchemaMapping(context,oracleLogicalSchema, oraclePhysicalSchema);

// Saving the Data Server , Physical and Logical Schema in  ODI

odiInstance.getTransactionalEntityManager().persist(oracleTechnology);

As we have mentioned before we need API documentation to pass the correct arguments . After execution of the above codes

as you can see that Data Server , Physical and Logical schema is created and the connection is successful.

image

image

This post was more about getting started with ODI SDK codes and as odiexperts have always tried to provide the easy tutorial to make ODI an easy experience and this post was meant to get started with configuration and setup of ODI SDK in eclipse  to write more easy and  fun SDK codes.

More SDK codes are coming soon.  🙂

The Complete code

package odi.sdk;

import oracle.odi.core.OdiInstance;
import oracle.odi.core.persistence.transaction.ITransactionStatus;
import oracle.odi.core.persistence.transaction.support.TransactionCallbackWithoutResult;
import oracle.odi.core.persistence.transaction.support.TransactionTemplate;
import oracle.odi.domain.project.OdiFolder;
import oracle.odi.domain.project.OdiProject;
import oracle.odi.domain.topology.OdiContext;
import oracle.odi.domain.topology.OdiContextualSchemaMapping;
import oracle.odi.domain.topology.OdiDataServer;
import oracle.odi.domain.topology.OdiLogicalSchema;
import oracle.odi.domain.topology.OdiPhysicalSchema;
import oracle.odi.domain.topology.OdiTechnology;
import oracle.odi.domain.topology.finder.IOdiTechnologyFinder;
import oracle.odi.domain.util.ObfuscatedString;
import oracle.odi.publicapi.samples.SimpleOdiInstanceHandle;

public class MyFirstSKDCode {

private static OdiDataServer oracleDataServer;
protected static String pStringToObfuscate;
protected static OdiContext context;

/**
* @param args
*/
public static void main(String[] args) {

final SimpleOdiInstanceHandle odiInstanceHandle = SimpleOdiInstanceHandle
.create("jdbc:oracle:thin:@localhost:1521:orcl",
"oracle.jdbc.OracleDriver",
"ODI_MASTER_11G",
"ODI_MASTER_11G",
"WORKREP1",
"SUPERVISOR",
"SUNOPSIS");

final OdiInstance odiInstance = odiInstanceHandle.getOdiInstance();
try {
TransactionTemplate tx = new TransactionTemplate(odiInstance.getTransactionManager());
tx.execute(new TransactionCallbackWithoutResult()
{
   protected void doInTransactionWithoutResult(ITransactionStatus pStatus)
   {

      //
     //  ODI SDK Codes goes here
    //

OdiProject proj = new OdiProject("XMT", "XMT");

OdiContext context = new OdiContext("XMT"); // New Context
context.setDefaultContext(true);

 // Creating a New Folder

OdiFolder fold = new OdiFolder(proj, "FOLDER");

 // Persist Project and Context

odiInstance.getTransactionalEntityManager().persist(proj);
odiInstance.getTransactionalEntityManager().persist(context);

 // create a Data Server , Physical Schema, Logical Schema

 // First lets make sure if we have the Oracle Technology

OdiTechnology oracleTechnology = ((IOdiTechnologyFinder) odiInstance
.getTransactionalEntityManager().getFinder(
OdiTechnology.class)).findByCode("ORACLE");
if (oracleTechnology != null)

{
     oracleDataServer = new OdiDataServer(oracleTechnology,"ORCL_TARGET");

    // connection settings
    oracleDataServer.setConnectionSettings(new OdiDataServer.JdbcSettings(
       "jdbc:oracle:thin:@localhost:1521:orcl","oracle.jdbc.driver.OracleDriver"));

   // UserName and Password
   oracleDataServer.setUsername("HR");
   oracleDataServer.setPassword(ObfuscatedString.obfuscate("HR"));

}

// Creating a New Physical Schema

OdiPhysicalSchema oraclePhysicalSchema = new OdiPhysicalSchema(
oracleDataServer);
// Set additional information on the schema
oraclePhysicalSchema.setSchemaName("HR");
oraclePhysicalSchema.setWorkSchemaName("ODI_TEMP_11G");

// Create the logical schema and the mapping to it in the
// context
OdiLogicalSchema oracleLogicalSchema = new OdiLogicalSchema(oracleTechnology, "HR");
new OdiContextualSchemaMapping(context,oracleLogicalSchema, oraclePhysicalSchema);

// Persist the Data Server , Physical and Logical Schema

odiInstance.getTransactionalEntityManager().persist(oracleTechnology);

System.out.println("Done");

}
});
}

finally

{
odiInstanceHandle.release();
}

}

}

16 Comments

  1. Hello Expert,

    I need an ODI SDK code that delete/detach work repository from Master and from database!!
    I need the method that does this! Topology=>Repository=>Right clic on work rep=>delete from database

    Thanks

  2. Can anyone please help me by telling me when can I find a zip file with all the needed jar files. I’m still stuck on that step.

  3. Hi Experts!!
    That is my first code and it doesnt work. I think that the problem is with conection but im not sure why.

    I can connect perfectly with ODI operator but i cant from Eclipse. I going to paste the error code.

    Exception in thread “main” oracle.odi.core.config.MasterRepositoryResourceFailureException: ODI-10182: Excepción sin categorizar durante el acceso al repositorio.
    Could not get JDBC Connection; nested exception is java.sql.SQLException: No se ha podido iniciar Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: No se puede obtener la conexión del origen de datos: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS:no appropriate service handler found

    at oracle.odi.core.repository.Repository.getMasterRepository(Repository.java:100)
    at oracle.odi.core.OdiInstance.createMasterRepository(OdiInstance.java:518)
    at oracle.odi.core.OdiInstance.(OdiInstance.java:641)
    at oracle.odi.core.OdiInstance.createInstance(OdiInstance.java:609)
    at oracle.odi.core.OdiInstance.createInstance(OdiInstance.java:548)
    at odi.sdk.MyFirstSDKCode.main(MyFirstSDKCode.java:42)
    Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: No se ha podido iniciar Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: No se puede obtener la conexión del origen de datos: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS:no appropriate service handler found

    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:524)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:588)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:613)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:645)
    at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:111)
    at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:121)
    at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:136)
    at oracle.odi.core.repository.support.RepositoryUtils$RepositoryInfoSource.loadRepositoryInfo(RepositoryUtils.java:182)
    at oracle.odi.core.repository.support.RepositoryUtils.loadMasterRepositoryInfo(RepositoryUtils.java:376)
    at oracle.odi.core.repository.Repository.getMasterRepository(Repository.java:78)
    … 5 more
    Caused by: java.sql.SQLException: No se ha podido iniciar Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: No se puede obtener la conexión del origen de datos: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS:no appropriate service handler found

    at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:488)
    at oracle.ucp.util.UCPErrorHandler.throwSQLException(UCPErrorHandler.java:163)
    at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:654)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:922)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:873)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:863)
    at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:99)
    at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
    … 15 more
    Caused by: oracle.ucp.UniversalConnectionPoolException: No se puede obtener la conexión del origen de datos: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS:no appropriate service handler found

    at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:368)
    at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:49)
    at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:80)
    at oracle.ucp.jdbc.DriverConnectionFactoryAdapter.createConnection(DriverConnectionFactoryAdapter.java:122)
    at oracle.ucp.common.UniversalConnectionPoolImpl$UniversalConnectionPoolInternal.createOnePooledConnectionInternal(UniversalConnectionPoolImpl.java:1641)
    at oracle.ucp.common.UniversalConnectionPoolImpl$UniversalConnectionPoolInternal.access$600(UniversalConnectionPoolImpl.java:1477)
    at oracle.ucp.common.UniversalConnectionPoolImpl.createOnePooledConnection(UniversalConnectionPoolImpl.java:545)
    at oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.createOnePooledConnection(OracleJDBCConnectionPool.java:129)
    at oracle.ucp.common.UniversalConnectionPoolImpl.addNewConnections(UniversalConnectionPoolImpl.java:1031)
    at oracle.ucp.common.UniversalConnectionPoolBase.getInitialConnections(UniversalConnectionPoolBase.java:549)
    at oracle.ucp.common.UniversalConnectionPoolBase.start(UniversalConnectionPoolBase.java:657)
    at oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.start(OracleJDBCConnectionPool.java:151)
    at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:648)
    … 22 more

    Thanks!!

    • HI!!!

      Finally I found the problem with that. The problem is timeout to connect the repositories…

      Anyone knows where can I change the timeout?

  4. Hi,

    I am new to oracle fusion middle-ware applications. I am currently working on creating ODI scheduler for Load Plans and Scenarios with java code. For creating Scheduler I found all required classes provided in odi-core.jar library which is available in ODI installation directory at C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib path. However in order to delete scheduler I need to create an object of the scheduler with the help of the class oracle.as.scheduler.MetadataObjectId. I tried to search where I can find its jar. Got some clue that it is available in ess.jar file which comes usually with any Oracle Enterprise application.

    I tried to search the installation directory with the name ess.jar but it gave no result. Can anyone help me to locate library for oracle.as.scheduler.MetadataObjectId class or if I can download it from anywhere else?

    There is another option to delete schedulers.

    delete from snp_var_plan_agent;
    delete from snp_plan_agent;

    Are these delete statement safe to execute? I am not sure if it may cause some sort of inconsistency. Hence looking for option to delete with java API function only.

    Thanks,
    Badri

  5. Hi

    Thank you very much for the Detail approach. We are using the ODI 12c now and I have tried the above approach substituting the SDK for 12c.

    I have already a master and work repository defined and I am able to connect it through studio.

    And I am doing this step from java,

    MasterRepositoryDbInfo masterInfo = new MasterRepositoryDbInfo(pMasterReposUrl, pMasterReposDriver, pMasterReposUser, pMasterReposPassword.toCharArray(), new PoolingAttributes());
    WorkRepositoryDbInfo workInfo = null;
    if (pWorkReposName != null)
    workInfo = new WorkRepositoryDbInfo(pWorkReposName, new PoolingAttributes());

    OdiInstance inst = OdiInstance.createInstance(new OdiInstanceConfig(masterInfo, workInfo));

    However, immediately after the last line to connect to repository, the programme is getting terminated.
    There is no error message or exception raised.

    Is there anything differently we have to do in ODI 12c.

    Please let me know if there is any sample/url available on 12c for SDK approach.

    Regards
    Debashish

    • hi,

      Were you able to figure out the issue ? I am getting similar issue with ODI 11.1.1.9 with my application on weblogic 12.1.3

  6. Hi,

    I am trying above code through a groovy script using eclipse, and I am gettng below exception. However the same script works fine whenI am executing it through ODI. I am using ODI 12c. Let me know if I need to do some other settings for this.

    Aug 19, 2014 4:23:07 PM oracle.odi.core.datasource.DataSourceDefinitionUtils createDriverManagerDataSourceDefinition
    INFO: New data source: [ODI_POC_MASTER/*******@jdbc:oracle:thin:@localhost:1521:xe]
    Caught: oracle.odi.core.config.UncategorizedConfigurationException: ODI-10181: Uncategorized configuration exception.
    Bad password format. Make sure that it’s an encrypted password.
    oracle.odi.core.config.UncategorizedConfigurationException: ODI-10181: Uncategorized configuration exception.
    Bad password format. Make sure that it’s an encrypted password.
    at oracle.odi.core.OdiInstance$2.doAction(OdiInstance.java:530)
    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:173)
    at oracle.odi.core.OdiInstance.loadWorkDataSourceFromSnpConnect(OdiInstance.java:515)
    at oracle.odi.core.OdiInstance.createDataSourceDefinition(OdiInstance.java:431)
    at oracle.odi.core.OdiInstance.(OdiInstance.java:707)
    at oracle.odi.core.OdiInstance.createInstance(OdiInstance.java:572)
    at oracle.odi.core.OdiInstance$createInstance.call(Unknown Source)
    at Env.run(Env.groovy:22)
    at generateLogicalMapping.run(generateLogicalMapping.groovy:46)
    Caused by: java.lang.IllegalArgumentException: Bad password format. Make sure that it’s an encrypted password.
    at com.sunopsis.tools.core.SnpsStringTools.snpsDecode(SnpsStringTools.java:1331)
    at com.sunopsis.tools.core.SnpsStringTools.snpsDecode(SnpsStringTools.java:1293)
    at com.sunopsis.tools.core.SnpsStringTools.snpsDecode(SnpsStringTools.java:1220)
    at com.sunopsis.dwg.DwgObject.snpsDecode(DwgObject.java:4677)
    at com.sunopsis.dwg.DwgObject.snpsDecypher(DwgObject.java:4661)
    at oracle.odi.core.datasource.DataSourceDefinitionUtils.decodeNullSafe(DataSourceDefinitionUtils.java:51)
    at oracle.odi.core.datasource.DataSourceDefinitionUtils.createDriverManagerDataSourceDefinition(DataSourceDefinitionUtils.java:101)
    at oracle.odi.core.OdiInstance$2.doAction(OdiInstance.java:524)
    … 8 more

  7. Hi,

    We need to create a new physical schema within an existing data server . Can you please let me know the code or java classes to be used for the same ?

    Regards,
    Neeraj

  8. Thanks, for the solution kdevendr

    Wanted to ask that is all jars are to be included in project from ODISDK or any specific one….

    Thanks,
    Sachin

    • Mostly few specific jars are needed .I don’t have the exact list so to make my life easy i just select all the jars so i don’t miss any dependency

  9. Hi ..

    Above code is not running at my end .
    Giving following exception

    Exception in thread “main” java.lang.NoClassDefFoundError: oracle/security/jps/JpsException
    at oracle.odi.publicapi.samples.SimpleOdiInstanceHandle.create(SimpleOdiInstanceHandle.java:33)
    at odi.sdk.MyfirstSDKCode.main(MyfirstSDKCode.java:15)
    Caused by: java.lang.ClassNotFoundException: oracle.security.jps.JpsException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    … 2 more

Leave a Reply

Required fields are marked *.