Phase initialization failed with reason: XML ...FATAL ERROR

I am getting the following error while building the transformation configuration via Java API.

“Phase initialization failed with reason: XML …FATAL ERROR !”

In the Java program, I am trying to setup a simple transformation to read the XML using XMLExtract and read some records into the trash. I have followed the link on the wiki to come up with the program, bust still not sure where I am going wrong. Any help would be greatly appreciated.

Please find below the program that I am using and the generated log. I am using cloverETL 2.8.0.

		EngineInitializer.initEngine("plugins", null, "localhost");
		// runtime customization
		GraphRuntimeContext runtimeContext = new GraphRuntimeContext();
				 
		// create new instance of transformation graph class
		TransformationGraph graph = new TransformationGraph();
		// create graph phase
		Phase phase = new Phase(1);
		// create simple metadata
		
		DataRecordMetadata metadata=new DataRecordMetadata("RecordMetadata0",DataRecordMetadata.DELIMITED_RECORD);
		metadata.addField(new DataFieldMetadata("field1","\n"));
		
		//create edge
		Edge inEdge=new Edge("InEdge",metadata);
		
		//create nodes
		XMLExtract nodeXML=new XMLExtract("XML");
		nodeXML.setInputFile("D:/Downloads/doba/in/9Aisle/Azerty/SyncItemMaster.xml/SyncItemMaster.xml");
		Node nodeTrash=new Trash("Trash");
		
		
		//add phase to graph
		graph.addPhase(phase);
			
		//create Mapping
		XMLExtract.Mapping map=nodeXML.new Mapping("us:SyncItemMaster",0);
	
		nodeXML.addMapping(map);
		
		
		//connections
		nodeXML.addOutputPort(0, inEdge);
		nodeTrash.addInputPort(0, inEdge);
		
		//add nodes to phase
		phase.addNode(nodeXML);
		phase.addNode(nodeTrash);
		phase.addEdge(inEdge);
		
		EngineInitializer.initGraph(graph, runtimeContext);
		// graph running
		IThreadManager threadManager = new SimpleThreadManager();
		WatchDog watchDog = new WatchDog(graph, runtimeContext);
		threadManager.executeWatchDog(watchDog);
		// if we reached here =>> SUCCESS !!!

Also, please find below the log:

log4j:ERROR Could not connect to remote log4j server at [localhost]. We will try again later.
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at org.apache.log4j.net.SocketAppender.connect(SocketAppender.java:203)
at org.apache.log4j.net.SocketAppender.(SocketAppender.java:153)
at org.jetel.graph.runtime.EngineInitializer.initLogging(EngineInitializer.java:135)
at org.jetel.graph.runtime.EngineInitializer.initEngine(EngineInitializer.java:67)
at com.clover.test.CloverTransform.main(CloverTransform.java:31)
INFO [main] - Loading default properties from: defaultProperties
DEBUG [main] - Plugin org.jetel.bulkloader loaded.
id - org.jetel.bulkloader
version - 2.8.0
provider-name -
component { className = org.jetel.component.OracleDataWriter; type = ORACLE_DATA_WRITER; }
component { className = org.jetel.component.DB2DataWriter; type = DB2_DATA_WRITER; }
component { className = org.jetel.component.InformixDataWriter; type = INFORMIX_DATA_WRITER; }
component { className = org.jetel.component.MsSqlDataWriter; type = MS_SQL_DATA_WRITER; }
component { className = org.jetel.component.MysqlDataWriter; type = MYSQL_DATA_WRITER; }
component { className = org.jetel.component.PostgreSqlDataWriter; type = POSTGRESQL_DATA_WRITER; }

DEBUG [main] - Plugin org.jetel.component loaded.
id - org.jetel.component
version - 2.8.0
provider-name - null
component { className = org.jetel.component.DataReader; type = DATA_READER; }
component { className = org.jetel.component.DataWriter; type = DATA_WRITER; }
component { className = org.jetel.component.DelimitedDataReader; type = DELIMITED_DATA_READER; }
component { className = org.jetel.component.DelimitedDataWriter; type = DELIMITED_DATA_WRITER; }
component { className = org.jetel.component.SimpleCopy; type = SIMPLE_COPY; }
component { className = org.jetel.component.Concatenate; type = CONCATENATE; }
component { className = org.jetel.component.SimpleGather; type = SIMPLE_GATHER; }
component { className = org.jetel.component.Reformat; type = REFORMAT; }
component { className = org.jetel.component.DBInputTable; type = DB_INPUT_TABLE; }
component { className = org.jetel.component.Sort; type = SORT; }
component { className = org.jetel.component.DBOutputTable; type = DB_OUTPUT_TABLE; }
component { className = org.jetel.component.FixLenDataWriter; type = FIXLEN_DATA_WRITER; }
component { className = org.jetel.component.Dedup; type = DEDUP; }
component { className = org.jetel.component.FixLenDataReader; type = FIXLEN_DATA_READER; }
component { className = org.jetel.component.Merge; type = MERGE; }
component { className = org.jetel.component.MergeJoin; type = MERGE_JOIN; }
component { className = org.jetel.component.MergeJoin; type = EXT_MERGE_JOIN; }
component { className = org.jetel.component.MergeJoin; type = SORTED_JOIN; }
component { className = org.jetel.component.Trash; type = TRASH; }
component { className = org.jetel.component.DBExecute; type = DB_EXECUTE; }
component { className = org.jetel.component.HashJoin; type = HASH_JOIN; }
component { className = org.jetel.component.HashJoin; type = EXT_HASH_JOIN; }
component { className = org.jetel.component.CheckForeignKey; type = CHECK_FOREIGN_KEY; }
component { className = org.jetel.component.DBFDataReader; type = DBF_DATA_READER; }
component { className = org.jetel.component.ExtFilter; type = EXT_FILTER; }
component { className = org.jetel.component.ExtSort; type = EXT_SORT; }
component { className = org.jetel.component.SortWithinGroups; type = SORT_WITHIN_GROUPS; }
component { className = org.jetel.component.Partition; type = PARTITION; }
component { className = org.jetel.component.DataIntersection; type = DATA_INTERSECTION; }
component { className = org.jetel.component.Aggregate; type = AGGREGATE; }
component { className = org.jetel.component.SystemExecute; type = SYS_EXECUTE; }
component { className = org.jetel.component.RunGraph; type = RUN_GRAPH; }
component { className = org.jetel.component.KeyGenerator; type = KEY_GEN; }
component { className = org.jetel.component.AproxMergeJoin; type = APROX_MERGE_JOIN; }
component { className = org.jetel.component.DBJoin; type = DBJOIN; }
component { className = org.jetel.component.XLSReader; type = XLS_READER; }
component { className = org.jetel.component.XLSWriter; type = XLS_WRITER; }
component { className = org.jetel.component.CloverDataWriter; type = CLOVER_WRITER; }
component { className = org.jetel.component.CloverDataReader; type = CLOVER_READER; }
component { className = org.jetel.component.StructureWriter; type = STRUCTURE_WRITER; }
component { className = org.jetel.component.Normalizer; type = NORMALIZER; }
component { className = org.jetel.component.Denormalizer; type = DENORMALIZER; }
component { className = org.jetel.component.Rollup; type = ROLLUP; }
component { className = org.jetel.component.JmsReader; type = JMS_READER; }
component { className = org.jetel.component.JmsWriter; type = JMS_WRITER; }
component { className = org.jetel.component.LookupJoin; type = LOOKUP_JOIN; }
component { className = org.jetel.component.LookupTableReaderWriter; type = LOOKUP_TABLE_READER_WRITER; }
component { className = org.jetel.component.DataGenerator; type = DATA_GENERATOR; }
component { className = org.jetel.component.SequenceChecker; type = SEQUENCE_CHECKER; }
component { className = org.jetel.component.TextTableWriter; type = TEXT_TABLE_WRITER; }
component { className = org.jetel.component.XmlXPathReader; type = XML_XPATH_READER; }
component { className = org.jetel.component.XMLExtract; type = XML_EXTRACT; }
component { className = org.jetel.component.Pacemaker; type = PACEMAKER; }
component { className = org.jetel.component.SpeedLimiter; type = SPEED_LIMITER; }
component { className = org.jetel.component.JavaExecute; type = JAVA_EXECUTE; }
component { className = org.jetel.component.XmlWriter; type = XML_WRITER; }
component { className = org.jetel.component.XSLDataTransformer; type = XSL_TRANSFORMER; }
component { className = org.jetel.component.HttpConnector; type = HTTP_CONNECTOR; }

DEBUG [main] - Plugin org.jetel.connection loaded.
id - org.jetel.connection
version - 2.8.0
provider-name - null
connection { className = org.jetel.connection.jdbc.DBConnection; type = JDBC; }
connection { className = org.jetel.connection.jms.JmsConnection; type = JMS; }

DEBUG [main] - Plugin org.jetel.ctlfunction loaded.
id - org.jetel.ctlfunction
version - 2.5.2
provider-name - null
ctlfunction { libraryName = math; className = org.jetel.ctl.extensions.MathLib; }
ctlfunction { libraryName = date; className = org.jetel.ctl.extensions.DateLib; }
ctlfunction { libraryName = string; className = org.jetel.ctl.extensions.StringLib; }
ctlfunction { libraryName = convert; className = org.jetel.ctl.extensions.ConvertLib; }
ctlfunction { libraryName = container; className = org.jetel.ctl.extensions.ContainerLib; }

DEBUG [main] - Plugin org.jetel.engine loaded.
id - org.jetel.engine
version - 2.8.0
provider-name - null
dictionaryType { className = org.jetel.graph.dictionary.StringDictionaryType; type = string; }
dictionaryType { className = org.jetel.graph.dictionary.ObjectDictionaryType; type = object; }
dictionaryType { className = org.jetel.graph.dictionary.ReadableChannelDictionaryType; type = readable.channel; }
dictionaryType { className = org.jetel.graph.dictionary.WritableChannelDictionaryType; type = writable.channel; }
tlCompiler { className = org.jetel.ctl.TLCompiler; type = simple.compiler; }

DEBUG [main] - Plugin org.jetel.jdbc loaded.
id - org.jetel.jdbc
version - 2.8.0
provider-name - null
jdbcSpecific { name = DB2; class = org.jetel.connection.jdbc.specific.impl.DB2Specific; database = DB2; }
jdbcSpecific { name = Informix; class = org.jetel.connection.jdbc.specific.impl.InformixSpecific; database = INFORMIX; }
jdbcSpecific { name = MS SQL Server 2008; class = org.jetel.connection.jdbc.specific.impl.MSSQLSpecific; database = MSSQL; }
jdbcSpecific { name = MS SQL Server 2000-2005; class = org.jetel.connection.jdbc.specific.impl.MSSQLSpecific2005; database = MSSQL2005; }
jdbcSpecific { name = MySQL; class = org.jetel.connection.jdbc.specific.impl.MySQLSpecific; database = MYSQL; }
jdbcSpecific { name = Oracle; class = org.jetel.connection.jdbc.specific.impl.OracleSpecific; database = ORACLE; }
jdbcSpecific { name = PostgreSQL; class = org.jetel.connection.jdbc.specific.impl.PostgreSpecific; database = POSTGRE; }
jdbcSpecific { name = Sybase; class = org.jetel.connection.jdbc.specific.impl.SybaseSpecific; database = SYBASE; }
jdbcDriver { driverLibrary = lib/mysql/mysql-connector-java-5.1.7-bin.jar; jdbcSpecific = MYSQL; name = MySQL; dbDriver = org.gjt.mm.mysql.Driver; jdbc.zeroDateTimeBehavior = convertToNull; urlHint = jdbc:mysql://hostname:3306/database; database = MYSQL; }
jdbcDriver { driverLibrary = lib/postgre/postgresql-8.3-603.jdbc3.jar; jdbcSpecific = POSTGRE; name = PostgreSQL; dbDriver = org.postgresql.Driver; urlHint = jdbc:postgresql://hostname/database; database = POSTGRE; }

DEBUG [main] - Plugin org.jetel.lookup loaded.
id - org.jetel.lookup
version - 2.8.0
provider-name - null
lookup { className = org.jetel.lookup.SimpleLookupTable; type = simpleLookup; }
lookup { className = org.jetel.lookup.DBLookupTable; type = dbLookup; }
lookup { className = org.jetel.lookup.RangeLookupTable; type = rangeLookup; }

DEBUG [main] - Plugin org.jetel.sequence loaded.
id - org.jetel.sequence
version - 2.8.0
provider-name - null
sequence { className = org.jetel.sequence.SimpleSequence; type = SIMPLE_SEQUENCE; }
sequence { className = org.jetel.sequence.PrimitiveSequence; type = PRIMITIVE_SEQUENCE; }

DEBUG [main] - Plugin org.jetel.thirdparty loaded.
id - org.jetel.thirdparty
version - 2.8.0
provider-name - null
component { className = org.jetel.component.Filter; type = FILTER; }
component { className = com.linagora.component.LdapReader; type = LDAP_READER; }
component { className = com.linagora.component.LdapWriter; type = LDAP_WRITER; }

DEBUG [main] - Plugin org.jetel.tlfunction loaded.
id - org.jetel.tlfunction
version - 2.8.0
provider-name - null
tlfunction { libraryName = math; className = org.jetel.interpreter.extensions.MathLib; function = sqrt,log,log10,exp,round,pow,pi,e,random,random_gaussian,random_boolean,random_int,random_long,abs,bit_and,bit_or,bit_xor,bit_set,bit_invert,bit_is_set,bit_lshift,bit_rshift; }
tlfunction { libraryName = date; className = org.jetel.interpreter.extensions.DateLib; function = today,dateadd,datediff,trunc,trunc_date,random_date; }
tlfunction { libraryName = string; className = org.jetel.interpreter.extensions.StringLib; function = concat,uppercase,lowercase,substring,left,right,trim,length,soundex,replace,split,char_at,is_blank,is_ascii,is_number,is_integer,is_long,is_date,remove_diacritic,remove_blank_space,get_alphanumeric_chars,translate,join,index_of,count_char,chop,remove_nonprintable,remove_nonascii,find,cut,edit_distance,metaphone,NYSIIS,random_string; }
tlfunction { libraryName = convert; className = org.jetel.interpreter.extensions.ConvertLib; function = num2str,date2str,str2date,date2num,str2num,try_convert,base64byte,byte2base64,bits2str,str2bits,hex2byte,byte2hex,num2num,num2bool,bool2num,str2bool,long2date,date2long,to_string,md5,sha,long2pacdecimal,pacdecimal2long; }
tlfunction { libraryName = container; className = org.jetel.interpreter.extensions.ContainerLib; function = remove_all,push,pop,poll,remove,insert,sort,copy,reverse; }

DEBUG [main] - create PluginClassLoader:[file:/D:/9AisleWorkspace/CloverTest3/plugins/org.jetel.ctlfunction/cloveretl.ctlfunction.jar]
INFO [main] - Checking graph configuration…
INFO [main] - Graph configuration is valid.
INFO [main] - Graph initialization (null)
INFO [main] - register MBean with name:org.jetel.graph.runtime:type=CLOVERJMX_DEFAULT_GRAPH_ID_0
INFO [WatchDog] - [Clover] Initializing phase: 1
DEBUG [WatchDog] - initializing edges:
DEBUG [WatchDog] - all edges initialized successfully…
DEBUG [WatchDog] - initializing nodes:
WARN [WatchDog] - Graph element [XML] is not checked by checkConfig() method. Please call TransformationGraph.checkConfig() first.
ERROR [WatchDog] - Phase initialization failed with reason: XML …FATAL ERROR !
Reason: null
XML …FATAL ERROR !
Reason: null
at org.jetel.graph.Phase.init(Phase.java:163)
at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:437)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:179)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:62)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.jetel.component.XMLExtract.init(XMLExtract.java:1389)
at org.jetel.graph.Phase.init(Phase.java:154)
… 6 more
ERROR [WatchDog] - !!! Phase finished with error - stopping graph run !!!
INFO [WatchDog] - ----------------------** Final tracking Log for phase [1] **---------------------
INFO [WatchDog] - Time: 24/08/09 22:50:03
INFO [WatchDog] - Node Status Port #Records #KB Rec/s KB/s
INFO [WatchDog] - ---------------------------------------------------------------------------------
INFO [WatchDog] - XML ERROR
INFO [WatchDog] - %cpu:… Out:0 0 0 0 0
INFO [WatchDog] - Trash N/A
INFO [WatchDog] - %cpu:… In:0 0 0 0 0
INFO [WatchDog] - ---------------------------------** End of Log **--------------------------------
INFO [WatchDog] - Execution of phase [1] successfully finished - elapsed time(sec): 0
INFO [WatchDog] - -----------------------** Summary of Phases execution **---------------------
INFO [WatchDog] - Phase# Finished Status RunTime(sec) MemoryAllocation(KB)
INFO [WatchDog] - 1 ERROR 0 1370
INFO [WatchDog] - ------------------------------** End of Summary **---------------------------
INFO [WatchDog] - WatchDog thread finished - total execution time: 0 (sec)

Hi, which command line arguments are you using? I suspect you’re using the “-loghost” argument, which should be used only when running a CloverETL graph from the CloverETL Designer.

Jaro

ok, Thanks for the reply.

I went back to the code and altered the engine initialization code to the following, but still got the same error. Are there any other values that I need to give for engine initialization?

EngineInitializer.initEngine("plugins", null, null);

Hi,
I’ve tried your modified code (without the localhost loghost) and I don’t get the logging initialization error. Are you sure you’re running and building it correctly?

Jaro

Thanks a lot for the prompt reply Jurban.

I am running this code in eclipse as a main program, and trying to build the transformation graph and execute it to consume a XML file. The project has clover etl engine version 2.8.0 added as a dependency library and other supporting libraries. The eclipse environment is also having the evaluatation version of clover ETL designer installed.

I am trying to build a graph of XMLExtract reading a XML file and dumping it into the Trash, but I am getting the error when the program execution reaches the line

threadManager.executeWatchDog(watchDog);

On further looking into the source code, I am getting the error while performing an initialization of XMLExtract component. The error is a NUllPointerException in the XMLExtract.init() method. The source of XMLExtract.java did not match the compiled binary of 2.8.0, so it is hard for me to say which line of the code has been causing problem.

Some of the issues that might be causing the problems may be
1. Some missing configuration that might be required. While I debugged more into the XMLExtract.java using the debug variables console, I say the projectURL variable to be null, could this cause the problem ?
2. Can the Clover Designer plugin libraries conflict in any way in eclipse environment?
3. Here is the list of dependencies I have in the eclipse project, am I missing any dependency?
xmlbeans-2.3.0.jar
annotations.jar
commons-cli-1.1.jar
commons-net-1.4.1.jar
dom4j-1.6.1.jar
icu4j-normalizer.jar
jakarta-oro-2.0.8.jar
janino.jar
javolution.jar
jms.jar
joda-time-1.6.jar
jsch-0.1.39.jar
jsr173_1.0_api.jar
jxl.jar
ooxml-schemas-1.0.jar
openxml4j-1.0-beta.jar
poi-3.5-beta4-20081128.jar
poi-ooxml-3.5-beta4-20081128.jar
tar.jar
cloveretl.engine.jar
commons-logging.jar

I would greatly appreciate some more clues on the same, Thanks again for your prompt support Jurban.

Hi,

I am eagerly waiting for a solution to the above issue, I am not worried about the logger error, but if we scroll down the log uploaded above the execution is failing in the XMLExtract.init() method, for which I need help.

Please help me get past this issue, Thanks.

Regards
Pankaj

Ok I was able to get a solution around the issue.

I used the 2.7.2 set of clover engine, component jar and the third part jar. Surprisingly the XMLExtract is found in the thirdparty jar for 2.7.2 version of clover engine.

Everything is running great after adding the required dependency.

So most probably something went wrong while the XMLExtract was made a part of the component .jar in version 2.8.0, and I hope this finding helps clover to release another minor version of clover engine with issues like these fixed.

But I would definitely would like to thank Jurban for his prompt support, nevertheless issues like these would need to be fixed asap, before more users face issues like these. Thanks.

Regards
Pankaj