Issue while deploying bundle using maven plugin

Not applicable

Hi,

I have created a maven application for building and deploying api bundle. Followed steps given in document. I am facing below issues. Can someone help please...?

  1. Deploying new proxy: If I am deploying proxy for the first time (that means there is no existing proxy available Apigee Edge). Apigee api web link returns error message as below:

GET https://api.enterprise.apigee.com/v1/organizations/bdhanashetti/apis/json-formatter/deployments accept: application/json accept-encoding: gzip authorization: Basic [Not shown in log] [ERROR] 404 Not Found { "code" : "messaging.config.beans.ApplicationDoesNotExist", "message" : "APIProxy named json-formatter does not exist in organization bdhanashetti", "contexts" : [ ]

}

-----------------------------------------

2. Since I am facing above error, I have imported the ZIP file using UI application (this works wonderfully !!!). Then I have gone for re-deployment using maven deploy command. This command corrupts the proxy link. Error on proxy link says there is no revision attached to it (as shown in below image).

image

Here is link for the test project (https://github.com/basavarajdhanashetti/mands) for review.

Thanks, Basavaraj

0 12 1,164
12 REPLIES 12

Not applicable

Hi Maruti,

I am trying to deploy the bundle using maven deploy command (using Apigee edge maven plugin).

Even maven deploy command tries same details as you said. Here is the message.

=============Initializing Maven Deployment================ [DEBUG] Request prepared for the server ************************** GET https://api.enterprise.apigee.com/v1/organizations/bdhanashetti/apis/json-formatter/deployments accept: application/json accept-encoding: gzip authorization: Basic [Not shown in log] [ERROR] 404 Not Found { "code" : "messaging.config.beans.ApplicationDoesNotExist", "message" : "APIProxy named json-formatter does not exist in organization bdhanashetti", "contexts" : [ ] } [INFO] No active revision for testenvironment. Nothing to delete

Thanks,

Basavaraj

If you look at the steps , it tries to get the active revision , undeploy and deploys a new revision .

As you were deploying for the first time you will see 404 for GET which is not a problem .

It is a problem if the bundle doesn't get deployed .

Are you saying that the bundle did not get deployed ? in that case what is the error you see for deploy API call ?

Hi Maruti,

It just stop plugin execution after I get above http response (error response).

Here I am attaching maven execution logs.

-----------------------------------------------------------------------------------------------------

D:\Programs\Apigee_Projects\mands>mvn apigee-enterprise:deploy -Ptest -Dusername=XXXXXXXXXX -Dpassword=XXXXXXXXXX [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] parent-pom [INFO] json-formatter [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building parent-pom 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ parent-pom >>> [INFO] [INFO] --- maven-resources-plugin:2.3:copy-resources (copy-resources-step) @ parent-pom --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\Programs\Apigee_Projects\mands\apiproxy [INFO] [INFO] <<< apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ parent-pom <<< [INFO] [INFO] --- apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ parent-pom --- [INFO] =============Initializing Maven Deployment================ [ERROR] 404 Not Found { "code" : "messaging.config.beans.ApplicationDoesNotExist", "message" : "APIProxy named parent-pom does not exist in organization bdhanashetti", "contexts" : [ ] } [INFO] No active revision for testenvironment. Nothing to delete [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building json-formatter 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ json-formatter >>> [INFO] [INFO] --- maven-clean-plugin:2.5:clean (auto-clean) @ json-formatter --- [INFO] Deleting D:\Programs\Apigee_Projects\mands\json-formatter\target [INFO] [INFO] --- maven-resources-plugin:2.6:copy-resources (copy-resources-step) @ json-formatter --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 6 resources [INFO] [INFO] --- apigee-edge-maven-plugin:1.0.0:configure (configure-bundle-step) @ json-formatter --- [INFO] ============= Reading the config file located at ================ D:\Programs\Apigee_Projects\mands\json-formatter\config.json [INFO] =============Replacing config tokens for Environment test, for proxy file name default.xml================ [INFO] ============= to apply the following config tokens ================ { "name": "default.xml", "tokens": [ { "xpath": "/ProxyEndpoint/HTTPProxyConnection/BasePath", "value": "/json-formatter" } ] } [INFO] =============Replacing config tokens for Environment test, for policy file name default.xml================ [INFO] ============= to apply the following config tokens ================ { "name": "default.xml", "tokens": [ { "xpath": "/TargetEndpoint/HTTPTargetConnection/ResourceURL", "value": "node://json-formatter.js" } ] } [INFO] =============Now zipping the App Bundle================ [INFO] [INFO] <<< apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ json-formatter <<< [INFO] [INFO] --- apigee-edge-maven-plugin:1.0.0:deploy (default-cli) @ json-formatter --- [INFO] =============Initializing Maven Deployment================ [ERROR] 404 Not Found { "code" : "messaging.config.beans.ApplicationDoesNotExist", "message" : "APIProxy named json-formatter does not exist in organization bdhanashetti", "contexts" : [ ] } [INFO] No active revision for testenvironment. Nothing to delete [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] parent-pom ........................................ SUCCESS [6.134s] [INFO] json-formatter .................................... SUCCESS [3.891s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.795s [INFO] Finished at: Fri Jul 31 10:39:24 IST 2015 [INFO] Final Memory: 10M/122M [INFO] ------------------------------------------------------------------------ D:\Programs\Apigee_Projects\mands>

vijay
Participant I

Looks like apiproxy 'json-formatter' is not available under organizations bdhanashetti.

If you list the apiproxies under this org ('https://api.enterprise.apigee.com/v1/organizations/bdhanashetti/apis/') , you can verify it's existence.

Regards,

Vijayakumar.

Hi Vijay,

Bundle doesn't exist because I am trying to deploy new proxy using maven deploy command.

Maven plugin should allow to upload new or update existing proxy with incremented revision number.

You can try the sample project I have attached (https://github.com/basavarajdhanashetti/mands).

You may need to change the organizations name in pom.xml

Thanks,

Basavaraj

Not applicable

I ran into the same issue - did you ever figure this out?

Nope.. issue not resolve.

So you just use apigee tool instead of maven now?

Yes I used that for providing POC. But Maven is much required for project execution when you have many apis.

I checked the pom.xml and figured out that you have used <apigee.options>clean,validate</apigee.options> in your test profile .

clean means deleting the deployed version and deploying again. If you remove the clean option , then it should work.

simply use :

<apigee.options>validate</apigee.options>

Still doesnt work.

Command issued:

mvn apigee-enterprise:deploy -P test -Dusername=xyz@abc.com -Dpassword=******
Request prepared for the server
 **************************
POST  https://api.enterprise.apigee.com/v1/organizations/raj-org/apis?action=import&name=auto-deploy-test-...
accept: application/json
accept-encoding: gzip
authorization: Basic [Not shown in log]
content-type: application/octet-stream
 [Request body contains data, not shown]

[ERROR] 400 Bad Request { "code" : "messaging.config.beans.InvalidBundle", "message" : "Bundle is invalid. Unable to read/find APIProxy contents", "contexts" : [ ] } [ERROR]
* * * * * * * * * * *
This deployment could have failed for a variety of reasons.
* * * * * * * * * * *

I tried using URL present in log and uploaded Zip file using Postman. That works good. This means there is no problem with Zip file.

Not sure how why not from maven plugin. Correct me anything wrong.