Bug 1328839 - Pre-processing Example
Summary: Pre-processing Example
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: doc-Smooks_Guide
Version: 5.3.1
Hardware: x86_64
OS: Windows
unspecified
urgent
Target Milestone: ---
: ---
Assignee: David Le Sage
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 12:01 UTC by Muthu
Modified: 2016-04-21 13:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Instance Name: Not Defined Build: CSProcessor Builder Version 1.7 Build Name: 9506, Smooks User Guide-5-5.3.1 Build Date: 06-02-2013 10:31:47
Last Closed: 2016-04-21 13:54:59 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Eclipse Project 1 0 None None None 2016-04-20 12:01:13 UTC

Description Muthu 2016-04-20 12:01:13 UTC
Description of problem:

I need to have a bean to decode string value.Before decoding it needs to replace the apostrophie contents.The variable firstname is a string

How to preform this action.
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
      xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd"
      xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd">

<jb:bean beanId="insuredPersonName"
            class="com.cognizant.insurance.general.domain.party.partyname.PersonName"
            createOnElement="Insured BasicDetails">
            <jb:value property="title" data="Insured BasicDetails salutation" />
            <jb:value property="givenName" data="Insured BasicDetails firstName" decoder="String">
            <jb:decodeParam name="valuePreprocess">
            value=value.replace("'","&#39;")
                                              </jb:decodeParam>
                          </jb:value>
            <jb:value property="surname" data="Insured BasicDetails lastName" />
            <jb:wiring property="transTrackingId" beanIdRef="transTrackingID" />
      </jb:bean>
</smooks-resource-list>
The above Code Throws below error:-

Caused by: org.milyn.SmooksException: Failed to filter source.
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
	at org.milyn.Smooks._filter(Smooks.java:526)
	at org.milyn.Smooks.filterSource(Smooks.java:482)
	at com.cognizant.insurance.general.core.smooks.LifeEngageSmooksHolder.parseJson(LifeEngageSmooksHolder.java:138)
	... 91 more
Caused by: org.milyn.SmooksException: Error in 'org.milyn.smooks.scripting.groovy.SmooksVisitor_27015246_7' while processing the visitAfter event.
	at org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:573)
	at org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:559)
	at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:396)
	at org.milyn.delivery.sax.SAXHandler.endElement(SAXHandler.java:204)
	at org.milyn.delivery.SmooksContentHandler.endElement(SmooksContentHandler.java:96)
	at org.milyn.json.JSONReader.endElement(JSONReader.java:389)
	at org.milyn.json.JSONReader.endElement(JSONReader.java:385)
	at org.milyn.json.JSONReader.parse(JSONReader.java:299)
	at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
	... 95 more
Caused by: java.lang.IllegalArgumentException: null 'bean' arg in method call.
	at org.milyn.assertion.AssertArgument.isNotNull(AssertArgument.java:42)

Comment 2 Muthu 2016-04-21 07:50:29 UTC
Is there any update for this. I need your help in this 

(In reply to Muthu from comment #0)
> Description of problem:
> 
> I need to have a bean to decode string value.Before decoding it needs to
> replace the apostrophie contents.The variable firstname is a string
> 
> How to preform this action.
> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
>       xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd"
> xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd"
>       xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd">
> 
> <jb:bean beanId="insuredPersonName"
>            
> class="com.cognizant.insurance.general.domain.party.partyname.PersonName"
>             createOnElement="Insured BasicDetails">
>             <jb:value property="title" data="Insured BasicDetails
> salutation" />
>             <jb:value property="givenName" data="Insured BasicDetails
> firstName" decoder="String">
>             <jb:decodeParam name="valuePreprocess">
>             value=value.replace("'","&#39;")
>                                               </jb:decodeParam>
>                           </jb:value>
>             <jb:value property="surname" data="Insured BasicDetails
> lastName" />
>             <jb:wiring property="transTrackingId"
> beanIdRef="transTrackingID" />
>       </jb:bean>
> </smooks-resource-list>
> The above Code Throws below error:-
> 
> Caused by: org.milyn.SmooksException: Failed to filter source.
> 	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
> 	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
> 	at org.milyn.Smooks._filter(Smooks.java:526)
> 	at org.milyn.Smooks.filterSource(Smooks.java:482)
> 	at
> com.cognizant.insurance.general.core.smooks.LifeEngageSmooksHolder.
> parseJson(LifeEngageSmooksHolder.java:138)
> 	... 91 more
> Caused by: org.milyn.SmooksException: Error in
> 'org.milyn.smooks.scripting.groovy.SmooksVisitor_27015246_7' while
> processing the visitAfter event.
> 	at
> org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:
> 573)
> 	at
> org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:
> 559)
> 	at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:396)
> 	at org.milyn.delivery.sax.SAXHandler.endElement(SAXHandler.java:204)
> 	at
> org.milyn.delivery.SmooksContentHandler.endElement(SmooksContentHandler.java:
> 96)
> 	at org.milyn.json.JSONReader.endElement(JSONReader.java:389)
> 	at org.milyn.json.JSONReader.endElement(JSONReader.java:385)
> 	at org.milyn.json.JSONReader.parse(JSONReader.java:299)
> 	at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
> 	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
> 	... 95 more
> Caused by: java.lang.IllegalArgumentException: null 'bean' arg in method
> call.
> 	at org.milyn.assertion.AssertArgument.isNotNull(AssertArgument.java:42)

Comment 3 Rick Wagner 2016-04-21 13:54:59 UTC
Hello,

My name is Rick, I am a support engineer working with the Fuse family of products.  I'll be happy to help with this.

Red Hat supplies commercial support (with SLAs) for our products.  If you are a holder of such an entitlement, you are welcome to open a support ticket at the Red Hat Customer portal.  From there, your ticket will be picked up by a support engineer who will begin a dialogue to resolve the issue.

If you do not have a support entitlement, the usual way to seek assistance is to ask on the open source community support forums.  In this case, you might go to the Smooks community or perhaps the Camel or JBossESB community.

Please consider these, choose the most appropriate channel for moving forward.  I will now close this Bugzilla tracker, it is not an appropriate place to seek help for such an issue.  Please do open a dialogue on one of the above channels.

Regards,

Rick


Note You need to log in before you can comment on or make changes to this bug.