Skip to content
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

Customer try to call RoleEnviroment failed. #239

Closed
gcheng opened this issue Feb 11, 2013 · 7 comments
Closed

Customer try to call RoleEnviroment failed. #239

gcheng opened this issue Feb 11, 2013 · 7 comments

Comments

@gcheng
Copy link

gcheng commented Feb 11, 2013

Dev estimate: 3
Test estimate: 3

http://stackoverflow.com/questions/9415237/java-sdk-for-azure-error-with-roleenvironment-getcurrentroleinstance

I'm using the Azure SDK for java (github.com/WindowsAzure/azure-sdk-for-java)

Problem is that Tomcat throws an error when I call the following:

RoleEnvironment.getCurrentRoleInstance().getId()

@ghost ghost assigned gcheng Feb 11, 2013
@gcheng
Copy link
Author

gcheng commented Feb 11, 2013

I think the root cause is that customer's code is not running as a Azure Worker Role. He(She) needs to run it from within the worker role. Let me try to repro his issue.

@gcheng
Copy link
Author

gcheng commented Feb 12, 2013

validated, following the tutorial on the msdn, the RoleEnviroment works properly.

@gcheng
Copy link
Author

gcheng commented Feb 12, 2013

The reason is that the named pipe would only exists if the process is started from ProgramEntryPoint. Otherwise, .NET program has a different mechanism to obtain the RoleEnviroment.

@gcheng
Copy link
Author

gcheng commented Feb 15, 2013

tried to use AzureRunMe, wrote a blog to record AzureRunMe, it can do some unique tasks. .

@gcheng
Copy link
Author

gcheng commented Feb 15, 2013

I validated that Java SDK ServiceRuntime RoleEnviroment is working properly.

@gcheng
Copy link
Author

gcheng commented Feb 15, 2013

I answered the question according to Service Runtime team's recommendation(s) here http://stackoverflow.com/questions/9415237/java-sdk-for-azure-error-with-roleenvironment-getcurrentroleinstance/14900834#14900834

@jcookems
Copy link
Contributor

Looks good! Good writeup too!

sima-zhu pushed a commit to sima-zhu/azure-sdk-for-java that referenced this issue Mar 21, 2019
Make ExpectedResponses annotation not required
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants