OK, thanks so much for that info, Min! I am quite new to using VMware APIs. :)
On Mon, Mar 18, 2013 at 10:35 PM, Min Chen <min.c...@citrix.com> wrote: > Hi Mike, > > From your sample code and your screenshot, I can see that the code is > written to use old vmware SDK (4.x) which is using Axis to implement java > stub. In that version of vim25.jar, RuntimeFault is extended from > MethodFault, which is then extended from AxisFault, which is indeed an > Exception, that is why you need to catch it. For your information, VI Java ( > http://vijava.sourceforge.net/) is an open source project that is built > on top of Vmware SDK and trying to provide another ease-to-use java API > layer to work with VSphere. > In your eclipse project, what version of vim25.jar does it depend on? > 5.1 or 4.1? If you are using 5.1 version, then you cannot use those AppUtil > class anymore. > > Thanks > -min > ________________________________________ > From: Mike Tutkowski [mike.tutkow...@solidfire.com] > Sent: Monday, March 18, 2013 9:03 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: VMware and RuntimeFault class > > Here is a screen shot of what I'm seeing: > > http://snag.gy/RQyxY.jpg > > In the getProperties method, Eclipse is saying I have an unhandled > exception. However, that method throws Throwable, so I should be good to > go. > > If I look at the referenced RuntimeFault class, it does not extend > Throwable (either directly or indirectly). > > Thanks! > > > On Mon, Mar 18, 2013 at 8:57 PM, Mike Tutkowski < > mike.tutkow...@solidfire.com> wrote: > > > Here's a good example: > > > > public abstract interface com.vmware.vim.VimPortType extends > > java.rmi.Remote > > > > { > > > > // Method descriptor #107 > > > (Lcom/vmware/vim/ManagedObjectReference;Ljava/lang/String;)Lcom/vmware/vim/ManagedObjectReference; > > > > public abstract com.vmware.vim.ManagedObjectReference > > findByInventoryPath(com.vmware.vim.ManagedObjectReference arg0, > > java.lang.String arg1) throws java.rmi.RemoteException, > > com.vmware.vim.RuntimeFault; > > > > // bunch more abstract methods > > > > } > > > > When I looked up com.vmware.vim.RuntimeFault, I found the following: > > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/net.java.dev.vcc.thirdparty/vi-api/4.0.0-4/com/vmware/vim/RuntimeFault.java > > > > It extends a class called MethodFault, which extends Object. There is no > > Throwable in the hierarchy yet findByInventoryPath (above) throws it. > > > > I don't understand this. > > > > > > On Mon, Mar 18, 2013 at 7:45 PM, Mike Tutkowski < > > mike.tutkow...@solidfire.com> wrote: > > > >> It looks like there are two RuntimeFault classes (one of which extends > >> Throwable indirectly). > >> > >> com.vmware.vim.RuntimeFault is not a Throwable. > >> com.vmware.vim25.RuntimeFault is a Throwable. > >> > >> The funny part is the sample code I have is not using com.vmware.vim25 > at > >> all, yet it uses RuntimeFault as a Throwable. > >> > >> > >> On Mon, Mar 18, 2013 at 7:15 PM, Mike Tutkowski < > >> mike.tutkow...@solidfire.com> wrote: > >> > >>> This person had the same problem, but I don't really understand the > >>> solution: > >>> > >>> http://communities.vmware.com/message/1896784 > >>> > >>> > >>> On Mon, Mar 18, 2013 at 7:12 PM, Mike Tutkowski < > >>> mike.tutkow...@solidfire.com> wrote: > >>> > >>>> Hi Min, > >>>> > >>>> I think this is VI Java...I'm just learning about that (haven't used > it > >>>> before). > >>>> > >>>> I guess maybe I don't understand what VI Java is. Is it not expected > >>>> to conform to normal Java compile rules (like any exception you throw > must > >>>> be a Throwable)? > >>>> > >>>> Thanks for clarifying this for me! > >>>> > >>>> > >>>> On Mon, Mar 18, 2013 at 5:12 PM, Min Chen <min.c...@citrix.com> > wrote: > >>>> > >>>>> Which sample code are you looking at? I am looking at sample files > >>>>> coming > >>>>> with 5.1 vim25.jar, they always throw RuntimeFaultFaultMsg. Can you > >>>>> tell > >>>>> me the java file name you are looking at? Maybe you are using VI > java, > >>>>> not > >>>>> VMware SDK jar? > >>>>> > >>>>> Thanks > >>>>> -min > >>>>> > >>>>> On 3/18/13 4:06 PM, "Mike Tutkowski" <mike.tutkow...@solidfire.com> > >>>>> wrote: > >>>>> > >>>>> >Here is some of the problematic sample code: > >>>>> > > >>>>> > ObjectContent[] ocs = service.retrieveProperties( > >>>>> > > >>>>> > content.getPropertyCollector(), > >>>>> > > >>>>> > new PropertyFilterSpec[] {pfSpec}); > >>>>> > > >>>>> > > >>>>> >It claims to throw a RuntimeFault exception. However, when I look > at > >>>>> the > >>>>> >API docs for RuntimeFault, as you say, it does not extend Throwable. > >>>>> > > >>>>> > > >>>>> >Why then is the method claiming to throw RuntimeFault? > >>>>> > > >>>>> > > >>>>> >Do you know about that, Min? > >>>>> > > >>>>> > > >>>>> >Thanks! > >>>>> > > >>>>> > > >>>>> >On Mon, Mar 18, 2013 at 5:01 PM, Min Chen <min.c...@citrix.com> > >>>>> wrote: > >>>>> > > >>>>> >> In Vmware 5.1 SDK, RuntimeFaultFaultMsg is the exception class for > >>>>> >> RuntimeFault. RuntimeFault itself is not extended from Throwable. > >>>>> >> > >>>>> >> Thanks > >>>>> >> -min > >>>>> >> > >>>>> >> On 3/18/13 3:39 PM, "Mike Tutkowski" < > mike.tutkow...@solidfire.com> > >>>>> >>wrote: > >>>>> >> > >>>>> >> >Hi, > >>>>> >> > > >>>>> >> >I've been playing around with VMware API commands to create a > >>>>> >>datastore. > >>>>> >> > > >>>>> >> >In sample code I've found, they are throwing a RuntimeFault > >>>>> exception. > >>>>> >> > > >>>>> >> >The problem is this class does not extend Throwable. > >>>>> >> > > >>>>> >> >I admit...I'm totally confused about this. How are they throwing > >>>>> an > >>>>> >> >exception that doesn't extend Throwable? When I ask Eclipse to > >>>>> create > >>>>> >>a > >>>>> >> >try/catch block for me, it seems confused, as well? > >>>>> >> > > >>>>> >> >Anyone know anything about this? > >>>>> >> > > >>>>> >> >Thanks! > >>>>> >> > > >>>>> >> >-- > >>>>> >> >*Mike Tutkowski* > >>>>> >> >*Senior CloudStack Developer, SolidFire Inc.* > >>>>> >> >e: mike.tutkow...@solidfire.com > >>>>> >> >o: 303.746.7302 > >>>>> >> >Advancing the way the world uses the > >>>>> >> >cloud<http://solidfire.com/solution/overview/?video=play> > >>>>> >> >* * > >>>>> >> > >>>>> >> > >>>>> > > >>>>> > > >>>>> >-- > >>>>> >*Mike Tutkowski* > >>>>> >*Senior CloudStack Developer, SolidFire Inc.* > >>>>> >e: mike.tutkow...@solidfire.com > >>>>> >o: 303.746.7302 > >>>>> >Advancing the way the world uses the > >>>>> >cloud<http://solidfire.com/solution/overview/?video=play> > >>>>> >* * > >>>>> > >>>>> > >>>> > >>>> > >>>> -- > >>>> *Mike Tutkowski* > >>>> *Senior CloudStack Developer, SolidFire Inc.* > >>>> e: mike.tutkow...@solidfire.com > >>>> o: 303.746.7302 > >>>> Advancing the way the world uses the cloud< > http://solidfire.com/solution/overview/?video=play> > >>>> *™* > >>>> > >>> > >>> > >>> > >>> -- > >>> *Mike Tutkowski* > >>> *Senior CloudStack Developer, SolidFire Inc.* > >>> e: mike.tutkow...@solidfire.com > >>> o: 303.746.7302 > >>> Advancing the way the world uses the cloud< > http://solidfire.com/solution/overview/?video=play> > >>> *™* > >>> > >> > >> > >> > >> -- > >> *Mike Tutkowski* > >> *Senior CloudStack Developer, SolidFire Inc.* > >> e: mike.tutkow...@solidfire.com > >> o: 303.746.7302 > >> Advancing the way the world uses the cloud< > http://solidfire.com/solution/overview/?video=play> > >> *™* > >> > > > > > > > > -- > > *Mike Tutkowski* > > *Senior CloudStack Developer, SolidFire Inc.* > > e: mike.tutkow...@solidfire.com > > o: 303.746.7302 > > Advancing the way the world uses the cloud< > http://solidfire.com/solution/overview/?video=play> > > *™* > > > > > > -- > *Mike Tutkowski* > *Senior CloudStack Developer, SolidFire Inc.* > e: mike.tutkow...@solidfire.com > o: 303.746.7302 > Advancing the way the world uses the > cloud<http://solidfire.com/solution/overview/?video=play> > *™* > -- *Mike Tutkowski* *Senior CloudStack Developer, SolidFire Inc.* e: mike.tutkow...@solidfire.com o: 303.746.7302 Advancing the way the world uses the cloud<http://solidfire.com/solution/overview/?video=play> *™*