Apigee命令行导入使用NullPointerException返回500

时间:2014-05-08 13:42:01

标签: apigee

我正在尝试自定义部署脚本,以允许我从命令行部署我的四个API代理中的每一个。它看起来非常类似于Github上的示例中提供的那个:

#!/bin/bash

if [[ $# -eq 0 ]] ; then
    echo 'Must provide proxy name.'
    exit 0
fi

dirname=$1
proxyname="teamname-"$dirname

source ./setup/setenv.sh

echo "Enter your password for user $username in the Apigee Enterprise organization $org, followed by [ENTER]:"

read -s password

echo Deploying $proxyname to $env on $url using $username and $org

./tools/deploy.py -n $proxyname -u $username:$password -o $org -h $url -e $env -p / -d ./$dirname

echo "If 'State: deployed', then your API Proxy is ready to be invoked."
echo "Run '$ sh invoke.sh'"
echo "If you get errors, make sure you have set the proper account settings in /setup/setenv.sh"

然而,当我运行它时,我得到以下响应:

Deploying teamname-gameassets to int on https://api.enterprise.apigee.com using my-email-address and org-name
Writing ./gameassets/teamname-gameassets.xml to ./teamname-gameassets.xml
Writing ./gameassets/policies/Add-CORS.xml to policies/Add-CORS.xml
Writing ./gameassets/proxies/default.xml to proxies/default.xml
Writing ./gameassets/targets/development.xml to targets/development.xml
Writing ./gameassets/targets/production.xml to targets/production.xml
Import failed to /v1/organizations/org-name/apis?action=import&name=teamname-gameassets with status 500:
{
  "code" : "messaging.config.beans.ImportFailed",
  "message" : "Failed to import the bundle : java.lang.NullPointerException",
  "contexts" : [ ],
  "cause" : {
    "contexts" : [ ]
  }
}

在部署过程中收到错误时,我应该如何进行调试?登录Apigee后,我可以查看某种控制台吗?

1 个答案:

答案 0 :(得分:0)

我不确定您的代理是如何以这种方式结束的,但看起来顶层目录名为“gameassets”。它应该被命名为“apiproxy”。如果重命名此目录,则应该看到成功部署。

此外,在您自定义太多之前,请尝试“apigeetool”,这是一个更灵活的命令行工具,用于部署代理:

https://github.com/apigee/api-platform-tools