• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using AWS APIs - Exception in thread "main" java.lang.VerifyError: Bad type on operand stack

 
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have been working with AWS APIs and I have written this code to run and AWS EC2 instance.




What am i possibly doing wrong?
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From these 2 lines....


... I suspect it's because your class "com.amazonaws.services.ec2.model.StartInstancesRequest" is "shadowing" the EC2 SDK's class of the same name, due to classloader order.

Now unless you are an employee of Amazon, I don't see any good reason why your class should be in "com.amazonaws.services.ec2.model" package.
Can you change your package name and/or class name to not match any SDK class, rebuild and retry?

[PS: Please enclose all code snippets in code tags in future for better readability. This link shows how. I've done it for you this time.]
 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Karthik Shiraly wrote:

I am working with the AWS SDK only, So I have to use the packages and class names provided by AWS.
And thank you for the suggestion. I'll keep that in mind in the future.

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am working with the AWS SDK only, So I have to use the packages and class names provided by AWS.


If you are working on an application that simply uses the AWS SDK, then you don't have to use SDK's packages and class names for the classes written by you.

If you are working on the AWS SDK project itself, then your class definition does not match the documented definition but I guess you'd already know that.

In either case, you can test the shadowing hypothesis easily by simply changing your class name (to something like "MyStartInsancesRequest") and verify if that works.
 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Karthik Shiraly wrote:

Thanks for the help. I changed the class and package names and it works fine now.

 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic