-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error deploying ARM template using local json file with java SDK 1.0.0-beta1 release. #923
Comments
any idea on this? |
This should be fixed in 1.0.0-beta2. Please verify. |
Hi Jianghaolu, I am getting exact same error with 1.0.0-beta2 as well. Can you please help here. Thanks, |
Hi jianghaolu, I'm trying to create IoT hub using local json files. (template file and parameter file). And I'm getting following StackOverflow error. Don't have any idea about root cause. I'm using 1.0.0-beta2 version. java.lang.StackOverflowError Thanks, |
Hi @vimukthir can you share a code snippet that throws this exception? If I can reproduce it I should be able to fix it. Thanks! |
Hi jianghaolu, My code snippet and template files are as follow. Main Class========
Util Class=======
#Creating Iot hub
Please find the attachments of template and parameter files which I used for creating Iot hub. As .json format not allowed to send as attachment here I changed them to .txt format. Thanks, |
Hi @vimukthir, thanks for posting this detailed code snippet! This is super helpful. I see you have this in your Deployment construction: DeploymentInner deploymentInner = new DeploymentInner().withProperties(new DeploymentProperties()
.withMode(DeploymentMode.COMPLETE)
.withTemplate(template)
.withParameters(parameters)); Are You can try to read the whole file into a string and call them as following: String template = readFile("template.txt");
String parameters = readFile("parameters.txt");
ResourceManager resourceManager = ResourceManager.authenticate(credentials).withSubscription(subscriptionId);
Deployment deployment = resourceManager.deployments
.define("deploymentName")
.withTemplate(template)
.withParameters(parameters)
.withMode(DeploymentMode.COMPLETE)
.create(); |
Hi Jianghaolu, Thanks for replying. But seems that there are some functionality mismatch between your proposed code and the java SDK which I am using (1.0.0-beta2). With this SDK I'm allowed to write the following code.
I can't access deployments property (resourceManager.deployments) in ResourceManager as it has private access. Any ideas? |
This is the |
HI jianghaolu, I was trying with following code. It is bit similar to way you suggested. But now I'm getting different type of error. Is this because json parsing error. I validated two json files and they are ok.
Thanks, Regards, |
How are you constructing |
Hi jianghaolu, But now another problem has come to the picture. While creating the resource (IoT hub in my case) creation failing due to following error. com.microsoft.azure.CloudException: Async operation failed The code is as follow
As you can see this is not the Async call I have used to create the resource. Any idea? Thanks, |
Hi jianghaolu, The previous error I was talking about happens due to wrong parameter value in the template file. I fixed it and now IoT hub is creating successfully. Many thanks to you for all the support given. Regards, |
Sounds good @vimukthir |
This worked for me as well.. thanks, |
Error deploying ARM template using local json file with java SDK 1.0.0-beta1 release.
Getting below error while deploying ARM template. Please advise.
Exception in thread "main" java.lang.StackOverflowError
at com.google.common.reflect.TypeToken$TypeCollector$2.getSuperclass(TypeToken.java:1097)
at com.google.common.reflect.TypeToken$TypeCollector$2.getSuperclass(TypeToken.java:1086)
at com.google.common.reflect.TypeToken$TypeCollector$ForwardingTypeCollector.getSuperclass(TypeToken.java:1189)
at com.google.common.reflect.TypeToken$TypeCollector.collectTypes(TypeToken.java:1145)
at com.google.common.reflect.TypeToken$TypeCollector.collectTypes(TypeToken.java:1127)
at com.google.common.reflect.TypeToken$TypeCollector$3.collectTypes(TypeToken.java:1114)
at com.google.common.reflect.TypeToken$ClassSet.rawTypes(TypeToken.java:664)
at com.microsoft.rest.Validator.validate(Validator.java:59)
at com.microsoft.rest.Validator.validate(Validator.java:94)
at com.microsoft.rest.Validator.validate(Validator.java:94)
Below is the code snippet. Is it expected to have a pojo for template and pass that object?
The text was updated successfully, but these errors were encountered: