1

I am trying my first ODI (Oracle Data Integrator) SDK java program. (below). It just tries to connect.

package docOdi;
import oracle.odi.core.OdiInstance;
import oracle.odi.core.config.MasterRepositoryDbInfo;
import oracle.odi.core.config.OdiInstanceConfig;
import oracle.odi.core.config.PoolingAttributes;
import oracle.odi.core.config.WorkRepositoryDbInfo;
public class Test {
  public static void main(String[] args) {

  System.out.println("Creating Master and Work Repo objects...");

  MasterRepositoryDbInfo masterInfo = new MasterRepositoryDbInfo(
  OdiBean.Url, OdiBean.Driver,
  OdiBean.Master_User, OdiBean.Master_Pass.toCharArray(),
  new PoolingAttributes());

  WorkRepositoryDbInfo workInfo = new WorkRepositoryDbInfo(
  OdiBean.WorkRepoName, new PoolingAttributes());

  System.out.println("Creating Odi Config...");
  OdiInstanceConfig odiCfg = new OdiInstanceConfig(masterInfo,workInfo);


  System.out.println("Connecting");
  OdiInstance odiInstance=OdiInstance.createInstance(odiCfg);  // <<< this line error: java.lang.NoClassDefFoundError: org/eclipse/persistence/sessions/Session
  }
}

However, I get this error: java.lang.NoClassDefFoundError: org/eclipse/persistence/sessions/Session

here are the jars I am using enter image description here

I am not sure why this small/test program is trying to use org/eclipse/persisence/session

I did not see that class in ANY of my odi jars in this folder C:\Oracle\Middleware\ODI\odi\sdk\lib

I welcome feedback.

Doc
  • 435
  • 1
  • 5
  • 15
  • Hey @Doc, this error is not something ODI SDK specific, I suggest you to check java questions also like this one https://stackoverflow.com/questions/17973970/how-to-solve-java-lang-noclassdeffounderror . If I found an answer I will update my comment, or send an answer here. – Canburak Tümer Jun 22 '17 at 04:16
  • I guess it is related to [Hibernate_framework](https://en.wikipedia.org/wiki/Hibernate_(framework)). SessionFactory implicitly create an instance of Session class. – Naeel Maqsudov Jul 18 '17 at 05:36
  • Hi Guys, I have similar problem but code is not giving any error, it hangs, Any suggestions.? – Rahul Patel Sep 28 '17 at 07:46
  • Hi @CanburakTümer I have the exact same problem. Did you find a solution? – Cyriaque Pin Mar 02 '20 at 16:49
  • Hi @CyriaquePin unfortunately I don't have a solution. – Canburak Tümer Mar 03 '20 at 09:10

1 Answers1

0

so it seems the way to create java programs using the oracle.odi.* packages is to simply add all the jar's in the following folder to your classpath

[your_ODI_HOME]\odi\sdk\lib

As there are many layers of dependencies in the odi java classes

fyi: Below is a listing of the jars for my v12 ODI install

activation.jar, 
aopalliance.jar, 
bsf.jar, 
bsh-2.0b4.jar, 
commons-beanutils-1.7.0.jar, 
commons-codec-1.3.jar, 
commons-collections-3.2.2.jar, 
commons-discovery-0.4.jar, 
commons-httpclient-3.1.jar, 
commons-io-2.2.jar, 
commons-lang-2.2.jar, 
commons-logging-1.1.1.jar, 
commons-net-3.3.jar, 
commons-vfs-1.0.jar, 
commons-vfs2-2.0.jar, 
connector.jar, 
cpld.jar, 
enterprise_data_quality.jar, 
gson-2.6.2.jar, 
hsqldb.jar, 
jakarta-oro-2.0.8.jar, 
javolution.jar, 
jms.jar, 
jsch-0.1.53.jar, 
json-path-2.2.0.jar, 
jython.jar, 
jzlib-1.07.jar, 
log4j-1.2.16.jar, 
odi-core.jar, 
odi-sap.jar, 
odi-wls-template-gen.jar, 
odihapp_common.jar, 
odihapp_essbase.jar, 
odihapp_planning.jar, 
ogg_jmx_interface.jar, 
oracle.odi-jaxrsri.jar, 
oracle.odi-sdk-jse.jar, 
org.eclipse.jgit_3.6.2.201501210735-r.jar, 
pop3.jar, 
sapjco.jar, 
sapjco3.jar, 
slf4j-api-1.7.5.jar, 
spring-aop.jar, 
spring-beans.jar, 
spring-context-support.jar, 
spring-context.jar, 
spring-core.jar, 
spring-expression.jar, 
spring-instrument-tomcat.jar, 
spring-instrument.jar, 
spring-jdbc.jar, 
spring-jms.jar, 
spring-orm.jar, 
spring-oxm.jar, 
spring-struts.jar, 
spring-test.jar, 
spring-tx.jar, 
spring-web.jar, 
spring-webmvc-portlet.jar, 
spring-webmvc.jar, 
svnkit-1.8.3.jar, 
trilead-ssh2-1.0.0-build217.jar, 
trove.jar, 
woodstox.jar, 
XmlSchema-1.4.2.jar, 
Doc
  • 435
  • 1
  • 5
  • 15