WSO2 EI - fileconnector.readSpecifiedLines not working properly - wso2

we are using WSO2 EI version 6.1.1 and fileconnector 2.0.10
We are trying to use the readSpecifiedLine operation from file connector but it always read the entire file. In this particular case we are trying to read a CSV skipping the header.
<fileconnector.readSpecifiedLines>
<source>{$ctx:sourceFile}</source>
<contentType>text/plain</contentType>
<start>2</start>
<end>3</end>
</fileconnector.readSpecifiedLines>
Did someone was able to use this operation successfully, can't find much on google either. thanks.

This issue is fixed with the version 2.0.12. Please download and redeploy the latest connector [1] from WSO2 store.
[1] https://store.wso2.com/store/assets/esbconnector/details/5d6de1a4-1fa7-434e-863f-95c8533d3df2

This is already a bug. Reported bug Jira Id.
https://wso2.org/jira/browse/ESBCONNECT-271

Related

WSo2 XSLT Parser Issue

WSO2 XSLT mediator Parsing Issue in the below line
<xsl:template match="Id[some $sib in preceding-sibling::Id satisfies deep-equal(., $sib)]"/>
We have two servers in one server there is no issue and the transformation has happened successfully without node-set(). In the another WSO2 server there is an parser Issue. Unable to pase $ expected ] and it is asking for a node-set() in XSLT.
I have compared the conf files and repository files between the two servers and both are same. Even dropins and lib files are also same. We are just confused to sort out the issue since it is asking for node-set() in one server and in another server it is throwing exception because of node-set(). Kindly help on it.
Is it possible to copy the working instance from one server to another server and then try testing.
If that is not possible then can you confirm whether other XSLT's are working fine or not.
Hi the issue has been solved. Since we were using Linux environment it was taking the Saxon processor by default where as in Windows wso2 takes the xalon processor to process the xslt. So in linux we have pointed manually in the wso2server.sh file to manually point to xalon processor and it is working fine. Thanks..,

WSO2 Tomcat deployment logs

I need your help.
How can I get logs in WSO2 EI while WAR is deploying?
I want to see the process and get the errors like in standalone Tomcat instance.
Is it possible?
I've tried to change log level at log4j.properties, catalina-server.xml and many others. But there is still no result.
Kind Regards,
Kirill
I found the next solution:
In file /opt/ame-a/repository/conf/log4j.properties
set
log4j.logger.org.apache.catalina=DEBUG
This way you will be able to implement logging realization inside your application and put application logs wherever you need, for example, I put it to
/opt/ame-a/lib/tomcat/logs/monitor.log
You need to setthe log level in the logging-bridge.properties file.
Open wso2as/repository/conf/etc/logging-bridge.properties file and put org.apache.catalina.level=FINEST

VFS lock files are not removed after processing

We are using WSO2 ESB 4.8.1. We have developed a proxy for reading a CSV file and inserting into a database table. File is configured to be MOVED to a history folder after processing. When the file is dropped in the FTP folder, a lock file would be created. It normally will be removed when the processing is over. But now it never gets deleted and the lock file stays as it is in the input folder. We couldn't find out the reason for the same. Please help to solve this issue.
You can also try to set transport.vfs.Locking parameter to disable creation of a .lock file when its processed.
Hope that helps
This is a known error in ESB 4.8.1. There is a patch available from WSO2 support, but that requires having a support contract. You can also use a newer version of the ESB since 4.8.1 is already quite dated, using 4.9 or 5.0 you should not run into these problems anymore.

Solutions within WSo2 ESB for Processing Zip files

I have the following requirement :
“Copy a Zip file from a sftp server to a directory on a local server, then unzip the file and extract 2 Xml files from inside it to process in our message service we have setup within our ESB.”
I have done some several searches over the past week on the internet, as well as read several topics in the Wso2 documentation but I cannot find a clean way to implement this requirement. I found this question asked on stackoverflow already - https://stackoverflow.com/questions/27806557/wso2-esb-extracting-and-processing-zip-files
However, I did not see where there were any suggestions/solutions provided. My first thought is to build a sequence with a class mediator to handle the extraction of the 2 xml files I need from the zip file, but maybe there is a better approach?
Is there any recommendations, links, or other references that folks could provide or suggest that would help me move forward with implementing this requirement? Or is this something I will need to handle outside of ESB via script with cron control?
Please kindly note that I'm assuming that you are using ESB 4.8.1
Since this is a specific requirement we don't have an out of the box solution for your scenario. However, you can easily do this using WSO2's VFS transport and a custom class mediator. The procedure would be:
Read your zip file using VFS Transport and save it in your local server.
Next, create a class mediator which unzip your zip file and then read your XML files. For more details about how to write a class mediator please refer Class Mediator.
If you need more help regarding this issue please let me know.
Thanks,
Upul
In the newer version of the ESB, the File Connector supports zip/unzip operations: https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the+File+Connector+Version+2

Can't get --supported-products option to work with Amazon's elastic-mapreduce Ruby client for Karmasphere Analytics

I am trying to use Karmaspere Analytics with AWS. This page says to use --supported-products with the ruby client. However, when I run the command (exactly as entered on that page), I get an error "Error: invalid option: --supported-products"
I am using Version 2010-11-11, downloaded from http://aws.amazon.com/developertools/2264 (that page says it was last updated on Aug 11, 2011, but running ./elastic-mapreduce --version I get "Version 2010-11-11" as output)
Thanks!
I think there is mistake in documentation. Its --with-supported-products. If you run ruby client without any arguments you will see the correct options to use.
Thank you for bringing this documentation error to light. The fix is, as Pratik indicated, to use --with-supported-products. I've updated the Amazon Elastic MapReduce documentation to reflect this: http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Karmasphere.html