JDBC error when embedding graph

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



	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.

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

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)

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.

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

Thank you for your help.