Sunday 15 April 2012

ibm sterling - Exception in thread "main" java.lang.ExceptionInInitializerError while trying to run ST312_TestMain class -



ibm sterling - Exception in thread "main" java.lang.ExceptionInInitializerError while trying to run ST312_TestMain class -

i trying phone call "getorderlist" st312_testmain class. getting java.lang.exceptionininitializererror below mentioned class.

package com.main; import org.w3c.dom.document; import com.yantra.ycp.core.ycpcontext; import com.main.xmlutil; import com.main.sterlingutil; public class st312_testmain { public static void main(string[] args) throws exception { string servicename = "getorderlist"; string sserviceflag = "n"; document dtemplate = null; //servicename = "senddn"; //sserviceflag = "y"; document inputxml=null; inputxml = xmlutil.getdocument("<order orderheaderkey='201407181105267340509' />"); //inputxml = xmlutil.getxmlfromfile("src/test.xml"); dtemplate = xmlutil.getdocument("<order orderheaderkey='' orderno=''/>"); if (args.length == 3) { servicename = args[0]; sserviceflag = args[1].equals("y") ? "y" : "n"; inputxml = xmlutil.getxmlfromfile(args[2]); } else { system.out .println("usage: testmain <api/service name> <api/service(n/y)> <input xml file>"); system.out .println("no input received using preset xml phone call preset service"); system.out.println("service name=" + servicename); } ***ycpcontext env = new ycpcontext("admin", "admin");*** system.out.println("input xml \n" + xmlutil.getxmlstring(inputxml)); seek { document outputxml = null; if ("y".equals(sserviceflag)) { outputxml = sterlingutil.callservice(env, inputxml, servicename, null); } else { outputxml = sterlingutil.callapi(env, inputxml, servicename, dtemplate); } env.commit(); } grab (exception ex) { ex.printstacktrace(); system.out.println("service invocation failed"); } } }

the exception follows:

class="lang-none prettyprint-override">usage: testmain <api/service name> <api/service(n/y)> <input xml file> no input received using preset xml phone call preset service service name=getorderlist log4j:warn no appenders found logger (com.yantra.ycp.core.ycpcontext). log4j:warn please initialize log4j scheme properly. exception in thread "main" java.lang.exceptionininitializererror @ com.sterlingcommerce.woodstock.util.frame.manager.getproperty(manager.java:1365) @ com.yantra.yfc.util.yfcconfigurator.setstandalone(yfcconfigurator.java:37) @ com.yantra.yfs.core.yfssystem.init(yfssystem.java:62) @ com.yantra.yfs.core.yfssystem.<clinit>(yfssystem.java:47) @ com.yantra.ycp.core.ycpcontext.<init>(ycpcontext.java:288) @ com.yantra.ycp.core.ycpcontext.<init>(ycpcontext.java:276) @ com.main.st312_testmain.main(st312_testmain.java:31) caused by: java.lang.nullpointerexception @ com.sterlingcommerce.woodstock.util.frame.log.base.scilogbaseconfig.doconfigure(scilogbaseconfig.java:35) @ com.sterlingcommerce.woodstock.util.frame.log.logservice.<clinit>(logservice.java:110) ... 7 more

please help me on problem, since not sure how handle ycpcontext object. ("ycpcontext env = new ycpcontext("admin", "admin");"). in advance.

request back upwards ibm this.

no matter mistakes may have made configuring (if any), sterling code should not throwing npe @ you.

java ibm-sterling

No comments:

Post a Comment