# Steps to reproduce

* Start `localstack` (version 0.10.3).
* Don't create any lambda functions.
* Run:

```sh
AWS_ACCESS_KEY_ID='a' AWS_SECRET_ACCESS_KEY='b' \
aws lambda invoke \
  --function-name 'my-func' \
  --qualifier='qual' \
  --endpoint http://localhost:4574 test.out
```

* Expected behaviour — a `ResourceNotFoundException` from `aws-cli`.
* Actual behaviour — `An error occurred (500) when calling the Invoke operation` message and a 500 response.

This bug only appears if a `qualifier` is included in the request.
bytes_io = BytesIO()
        try:
            s3_client.download_fileobj(function_code['S3Bucket'], function_code['S3Key'], bytes_io)
            zip_file_content = bytes_io.getvalue()
        except Exception as e:
            raise ClientError('Unable to fetch Lambda archive from S3: %s' % e, 404)
    elif 'ZipFile' in function_code:
        zip_file_content = function_code['ZipFile']
        zip_file_content = base64.b64decode(zip_file_content)
    else:
        raise ClientError('No valid Lambda archive specified.')
    return zip_file_content
def get_java_handler(zip_file_content, handler, main_file):
    """Creates a Java handler from an uploaded ZIP or JAR.
    :type zip_file_content: bytes
    :param zip_file_content: ZIP file bytes.
    :type handler: str
    :param handler: The lambda handler path.
    :type main_file: str
    :param main_file: Filepath to the uploaded ZIP or JAR file.
    :returns: function or flask.Response
    """
    if not is_jar_archive(zip_file_content):
        with zipfile.ZipFile(BytesIO(zip_file_content)) as zip_ref:
            jar_entries = [e for e in zip_ref.infolist() if e.filename.endswith('.jar')]
            if len(jar_entries) != 1:
                raise ClientError('Expected exactly one *.jar entry in zip file, found %s' % len(jar_entries))
            zip_file_content = zip_ref.read(jar_entries[0].filename)
            LOG.info('Found jar file %s with %s bytes in Lambda zip archive' %
                     (jar_entries[0].filename, len(zip_file_content)))