So you want to get access to the fault message? This is AFAIK not possible with a catch all. You can use a <catch> and define a faultVariable, to which the fault details will be assigned.
HTH, Tammo On Mon, Dec 2, 2013 at 2:08 PM, Kharche, Jitendra < [email protected]> wrote: > Thanks Tammo. > > You are right. > > But as I mentioned > If I explicitly initialize the variable TestWSPLException with some > default values, then I do not get any error on the tomcat console, but the > actual failure message coming from the web service in the fault is lost and > I get the mail with the default values I have set during initialization of > the variable. > > Regards, > Jitendra > > -----Original Message----- > From: Tammo van Lessen [mailto:[email protected]] > Sent: Monday, December 02, 2013 6:17 PM > To: user > Subject: Re: Initializing fault variable > > Hi Jitendra, > > thanks for the attachment. Apparently the variable TestWSPLException is > never written and thus not initialized. This is causing the > selectionFailure in the 4th copy statement in the catch all. I think if you > make sure that some data is written to this variable, you should be fine. > > Best, > Tammo > > > On Mon, Dec 2, 2013 at 1:30 PM, Kharche, Jitendra < > [email protected]> wrote: > > > Thanks Tammo for quick reply. > > Please find attached the BPEL and Web Service. > > > > Regards, > > > > > > -----Original Message----- > > From: Tammo van Lessen [mailto:[email protected]] > > Sent: Monday, December 02, 2013 5:32 PM > > To: user > > Subject: Re: Initializing fault variable > > > > Hi Jitendra, > > > > could you attach your bpel process, ideally the whole deployable? That > > would make it easier to analyze the issue. It looks like you're using > > an xpath expression in the to-spec of an assign. This only works if > > the variable is prepopulated with the XML structure. > > > > Thanks, > > Tammo > > > > > > On Mon, Dec 2, 2013 at 11:16 AM, jk <[email protected]> wrote: > > > > > Hi, > > > > > > I have a BPEL process deployed in ODE 1.3.6 on Tomcat 7.0.42. > > > This process invokes a web service that throws an exception. > > > In the process I have used a FaultHandler having a CatchAll on that > > > invoke activity. > > > In this CatchAll, I assign 2 variables "mailSubject" and "mailMessage" > > > that I use later to send failure mail notificatrion. > > > However when the web service fault message is received I get > > > following exception on the tomcat console. > > > > > > *org.apache.ode.bpel.common.FaultException: The variable > > > TestWSPLException isn't properly initialized.* > > > > > > I have declared the variable TestWSPLException in BPEL with the > > > messageType equal to the exception thrown by the web service. > > > > > > Why ODE is not initializing the variable on receiving the fault? > > > If I explicitely initialize the variable TestWSPLException with some > > > default values, then I do not get any error on the tomcat console, > > > but the actual failure message coming from the web service in the > > > fault is lost and I get the mail with the dafault values I have set > > > during initialization of the variable. > > > > > > I am attaching both the BPEL and WebService files. > > > The complete startck trace is given below. > > > > > > 15:38:28,341 WARN [ExternalService] Fault response: > > > faultName=WSException > > > faultType={http://testws1.ws.test.jk/}WSException > > > <?xml version="1.0" encoding="UTF-8"?> > > > <message><WSException><ns2:WSException > > > xmlns:ns2="http://testws1.ws.test.jk/" > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/ > > > "><id>0</id><message>Hel > > > per failed. Reason: > > > Failed</message></ns2:WSException></WSException></message> > > > 15:38:28,356 ERROR [JaxenContexts] bpws:getVariableValue threw > > > FaultException > > > org.apache.ode.bpel.common.FaultException: The variable > > > TestWSPLException isn't properly initialized. > > > at > > > > > > > > org.apache.ode.bpel.runtime.ScopeFrame.fetchVariableData(ScopeFrame.ja > > va:199) > > > at > > > > > > > > org.apache.ode.bpel.runtime.ScopeFrame.fetchVariableData(ScopeFrame.ja > > va:209) > > > at > > > > > > > > org.apache.ode.bpel.runtime.ExprEvaluationContextImpl.readVariable(Exp > > rEvaluationContextImpl.java:96) > > > at > > > > > > > > org.apache.ode.bpel.elang.xpath10.runtime.JaxenContexts.getVariableVal > > ue(JaxenContexts.java:173) > > > at > > > org.jaxen.ContextSupport.getVariableValue(ContextSupport.java:215) > > > at org.jaxen.Context.getVariableValue(Context.java:196) > > > at > > > > > > > > org.jaxen.expr.DefaultVariableReferenceExpr.evaluate(DefaultVariableRe > > ferenceExpr.java:106) > > > at > > > org.jaxen.expr.DefaultPathExpr.evaluate(DefaultPathExpr.java:137) > > > at > > > > > > > > org.jaxen.expr.DefaultFunctionCallExpr.evaluateParams(DefaultFunctionC > > allExpr.java:195) > > > at > > > > > > > > org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExp > > r.java:179) > > > at > > > org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102) > > > at > org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:677) > > > at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:216) > > > at > > > > > > > > org.apache.ode.bpel.elang.xpath10.runtime.XPath10ExpressionRuntime.eva > > luate(XPath10ExpressionRuntime.java:103) > > > at > > > > > > > > org.apache.ode.bpel.runtime.ExpressionLanguageRuntimeRegistry.evaluate > > (ExpressionLanguageRuntimeRegistry.java:80) > > > at > org.apache.ode.bpel.runtime.ASSIGN.evalRValue(ASSIGN.java:225) > > > at org.apache.ode.bpel.runtime.ASSIGN.copy(ASSIGN.java:399) > > > at org.apache.ode.bpel.runtime.ASSIGN.run(ASSIGN.java:87) > > > at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) > > > at > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess > > orImpl.java:25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > at > > > > org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451) > > > at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139) > > > at > > > > > > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeC > > ontextImpl.java:978) > > > at > > > > > > > > org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.ja > > va:456) > > > at > > > > > > > > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImp > > l.java:460) > > > at > > > > > > > > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImp > > l.java:450) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSc > > heduler.java:523) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSc > > heduler.java:517) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(Simple > > Scheduler.java:289) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(Simple > > Scheduler.java:244) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSche > > duler.java:517) > > > at > > > > > > > > org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSche > > duler.java:501) > > > at > > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > > > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > > > at > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu > > tor.java:886) > > > at > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. > > java:908) > > > at java.lang.Thread.run(Thread.java:662) > > > TestProcess.zip > > > <http://apache-ode.996305.n3.nabble.com/file/n16976/TestProcess.zip> > > > TestWS1.war < > > > http://apache-ode.996305.n3.nabble.com/file/n16976/TestWS1.war> > > > > > > > > > > > > -- > > > View this message in context: > > > http://apache-ode.996305.n3.nabble.com/Initializing-fault-variable-t > > > p1 6976.html Sent from the Apache Ode User mailing list archive at > > > Nabble.com. > > > > > > > > > > > -- > > Tammo van Lessen - http://www.taval.de > > > > > > -- > Tammo van Lessen - http://www.taval.de > -- Tammo van Lessen - http://www.taval.de
