Hi. I'm getting this error : Exception in component tJDBCInput_1 java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) The jdbc component causes the error with Oracle database but not with DB2. The property "Driver JAR > Jar name" it set dinamically using a context variable. If I add a new "do nothing" general jdbc component (for example a connection) connecting to a different Oracle database the drivers are loaded and the job works fine. The only thing I notice is that when I created the Database Connection I've also created the context using the "Export as context" button specifying a db2 jdbc driver. When I try to use this connection I change the cotext value dinamically using the Oracle parameters. Thank a lot. Andrea
Hi, actually you can, but you will have to use a workaround: when you create a General JDBC connection, even using the Export as Context button, you have to specify the JDBC Driver JAR (let's assume you chose a DB2 JDBC Driver). Then, in the corresponding Context Group, you can change the driver to use it with other DB Types (for example, selecting an Oracle JDBC Driver), BUT if you use it in your job the componente won't load correctly the new driver when you run the job, causing the error you posted. But if you add a General JDBC component to your Job with a JDBC connection orignally created with an Oracle JDBC Driver and configured with a JDBC Oracle Driver in its Context Group, then your job will run correctly! Please note that the second General JDBC "Oracle" Component (let's call it the DUMMY_CONNECTION) hasn't to be configured with a "real" connection. You can leave all of his contexts blank (or default) except for jdbc driver and class. To avoid errors, you can put a DO_NOTHING tJava component linked with an impossible "if" condition (see picture)
I know it's a workaround, but I haven't figured out any other solution, it seems to be a Talend bug. You can even create a DUMMY Connection job, where you can put as many Dummy DB components as the DB types you want your project to work with, and then add this job with the tRunJob component to all of your project jobs (see pictures below). I hasn't to be linked to anything.