[ 
https://wso2.org/jira/browse/ESBJAVA-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

indika kumara resolved ESBJAVA-440.
-----------------------------------

    Resolution: Fixed

This is not related to the DB mediators. DB mediator never sets any null value 
to the message context. What was happen here, is , getproperty('yValue') XPath 
has been return  a null value (Because there is no such a property in the 
message context).Within Switch case  this null value has been passed to the as 
a case condition parameter and when try to access it,  throws NPE.

Adds the null check and return as false when condition parameter is null  and 
gives warn



> NullPointException thrown when the sql statement inside the DBLookup/DBreport 
> mediator returns a null value
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: ESBJAVA-440
>                 URL: https://wso2.org/jira/browse/ESBJAVA-440
>             Project: WSO2 ESB
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Ubuntu7.04, JDK1.5.0_14, Firefox 2.0.0.12
>            Reporter: Evanthika Amarasiri
>            Assignee: indika kumara
>             Fix For: 1.7
>
>
> Created a Sequence with a DBLookup mediator which connects to a MySQL 
> database and retrieves a value.
> When the SQL statement returns a null value from the query provided, a 
> NullPointerException is thrown on the ESB console.
> ***************************************************************************************************************************************************************
> 2008-02-15 13:55:25,579 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] 
> DEBUG SwitchMediator XPath : get-property('yValue') evaluates to : null
> Exception in thread "HttpServerWorker-10" java.lang.NullPointerException
>         at java.util.regex.Matcher.getTextLength(Matcher.java:1127)
>         at java.util.regex.Matcher.reset(Matcher.java:284)
>         at java.util.regex.Matcher.<init>(Matcher.java:205)
>         at java.util.regex.Pattern.matcher(Pattern.java:879)
>         at 
> org.apache.synapse.config.xml.SwitchCase.matches(SwitchCase.java:99)
>         at 
> org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:91)
>         at 
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
>         at 
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)
>         at 
> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:131)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
>         at 
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
>         at 
> org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:226)
>         at 
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:190)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to