# JDBC error when embedding graph

**URL:** <https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691>\
**Category:** CloverDX Platform\
**Created:** [April 5, 2010, 12:00am UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691 "2010-04-05T00:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnderr](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jnderr](https://forum.cloverdx.com/u/jnderr)\
**Post date:** [April 5, 2010, 12:00am UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691/1 "2010-04-05T00:00:00Z")

</div>

Hello,

I am having an issue with a JDBC connection when running a graph embedded in java.

The graph runs fine from the gui designer in eclipse and from the command line using the clover engine.

When running it embedded in java it fails. I am using a postgres database for this project

Here is the error message that I am getting.  
ERROR org.jetel.component.ComponentFactory - Unknown connection: JDBC class: JDBC  
2010-04-05 13:32:55,327 [http-8443-7] ERROR com.matrixretail.etl.CloverHelper - Failed to run Clover graph  
java.lang.RuntimeException: Unknown connection: JDBC class: JDBC  
at org.jetel.database.ConnectionFactory.getConnectionClass(ConnectionFactory.java:107)  
at org.jetel.database.ConnectionFactory.createConnection(ConnectionFactory.java:118)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateDBConnections(TransformationGraphXMLReaderWriter.java:646)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:338)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:286)

Relevant code as follows:

env is a tomcat properties file resource bundle

```auto

	log.debug("Initializing Clover Engine");
	EngineInitializer.initEngine(env.getString("paths.clover.engine") + "plugins", env.getString("paths.clover.project") + "workspace.prm", null);
	EngineInitializer.forceActivateAllPlugins();

	GraphRuntimeContext runtimeContext = new GraphRuntimeContext();
	TransformationGraph graph = null;
	InputStream graphInputStream = null;
	InputStream propsInputStream = null;
	Properties props = new Properties();

	try
	{
		log.debug("Getting graph input stream");
		graphInputStream = new FileInputStream(pathToGraph);
		
		if (pathToProps != null)
		{
			log.debug("Props file passed in, loading");
			propsInputStream = new FileInputStream(pathToProps);
			props.load(propsInputStream);
		}
		
		log.debug("Adding project directory to props");
		props.put("PROJECT_DIR", env.getString("paths.clover.project"));
	
		log.debug("Loading Graph");
		TransformationGraphXMLReaderWriter graphReader = new TransformationGraphXMLReaderWriter(props);
		graph = graphReader.read(graphInputStream);
		
		log.debug("Initializing Graph");
		graph.init();
				
		log.debug("Running Graph");
		WatchDog watchDog = new WatchDog(graph, runtimeContext);
		IThreadManager threadManager = new SimpleThreadManager();
		Future<Result> futureResult = threadManager.executeWatchDog(watchDog);
		
		Result result = Result.N_A;
			
		result = futureResult.get();
		log.debug("Finished, result:" + result.toString());
	}
	catch (Exception ex)
	{
		log.error("Failed to run Clover graph", ex);
	}

	

```

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [April 6, 2010, 8:06am UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691/2 "2010-04-06T08:06:24Z")

</div>

Hello,  
this error indicates, that connection plug-in is not loaded. Check the _paths.clover.engine_ path and if this variable ends with /.

---

<div class="post-metadata">

**Author:** ![jnderr](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jnderr](https://forum.cloverdx.com/u/jnderr)\
**Post date:** [April 7, 2010, 2:55pm UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691/3 "2010-04-07T14:55:59Z")

</div>

Thank you for the reply adding “/” at the end of that property got me further.

I now get this error:

2010-04-07 10:48:31,506 [http-8443-2] ERROR org.jetel.component.ComponentFactory - Can’t create object of type DATA\_READER with reason: org/jetel/util/property/RefResFlag  
2010-04-07 10:48:31,506 [http-8443-2] ERROR com.matrixretail.etl.CloverHelper - Failed to run Clover graph  
java.lang.RuntimeException: Can’t create object of type DATA\_READER with reason: org/jetel/util/property/RefResFlag  
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:134)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:478)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:441)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:356)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:286)

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [April 8, 2010, 8:31am UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691/4 "2010-04-08T08:31:58Z")

</div>

Can you show the graph? I don’t see an easy reason of the error. Check if you use the same version of CloverETL Engine and plug-ins when running the graph.

---

<div class="post-metadata">

**Author:** ![jnderr](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jnderr](https://forum.cloverdx.com/u/jnderr)\
**Post date:** [April 8, 2010, 3:36pm UTC](https://forum.cloverdx.com/t/jdbc-error-when-embedding-graph/691/5 "2010-04-08T15:36:01Z")

</div>

I was using 2 different versions of clover, once I updated the version in my java project, everything works.

Thank you for your help.
