简体   繁体   中英

Unable to find BeanIO mapping file when uploading Lambda function

I have a java program that writes to a file using beanIO. The program runs fine on my local environment and acts as expected. I first wrote this program on my local environment, and then have been uploading it as an AWS Lambda function, so it was not initially created as an AWS Lambda function.

I use an Eclipse plugin to upload my code as an AWS Lambda function and test it using console.aws.amazon.com online. When I test it, I get an exception returned back:

org.beanio.BeanIOConfigurationException: BeanIO mapping file 'foo.xml' not 
found on classpath\n\tat 

The line that the error occurs on is this:

StreamFactory sf = StreamFactory.newInstance();
sf.loadResource("foo.xml"); // right here

I have tried putting foo.xml in the same package as the new

I'm new to beanIO and AWS Lambda. Do I need to configure the location of foo.xml differently to have it be referenced properly when uploading to Lambda? Since it works fine on my local environment, I am confused as to what else to do.

Ended up fixing the issue by removing the source folder of foo.xml and adding it as a source again. I'm not sure why it messed up in the first place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM