VMware {code} Community
OwainNorth
Contributor
Contributor
Jump to solution

Vm.GetGuestCustomizationSection() - Unexpected JAXB Exception

Again apologies, I originally put this in the main VCD forum but haven't had any luck, probably should have been in here.

What previously worked fine in v1.0 is now throwing an exception, even when I've stripped it down to essentially nothing. I'm trying to update Guest Customisation for a Vm.

Vapp NewerVApp = Vapp.GetVappByReference(_VCloudManager.VCDClient, VCDVdc.GetVappRefByName(Name));
VM Vm = NewerVApp.GetChildrenVms()[0];
GuestCustomizationSectionType Guest = Vm.GetGuestCustomizationSection();
Vm.UpdateSection(Guest).WaitForTask(10000);

But no, for some reason it doesn't like the XML.
com.vmware.vcloud.sdk.utility.VCloudException: Bad request  - Unexpected JAXB Exception  - unexpected element {http://schemas.dmtf.org/ovf/envelope/1}Section
   at com.vmware.vcloud.sdk.VM.UpdateSection(Section_Type sectionType)
   at <path>.CreateVApp(String Name, Int16 NumCpus, Int16 MemoryMb) in G:\<path>.cs:line 147
   at VCloudDevConsole.Program.Main(String[] args) in G:\<path>\Program.cs:line 24

Any ideas anyone?
Cheers
O.
0 Kudos
33 Replies
OwainNorth
Contributor
Contributor
Jump to solution

Any updates on this?

0 Kudos
daveniu
Contributor
Contributor
Jump to solution

Does anyone have any idea when the patch is going to be released?

The posts suggested it would be last week, this is really causing me a problem now 😞

Regards

Dave

0 Kudos
daveniu
Contributor
Contributor
Jump to solution

Hi

I am sorry to keep on, but does anyone have any news on this patch, I am desperate now and will happily test a pre-release patch if there is one in test at the moment.

If not can anyone suggest how I get around my original problem?

I am deploying a Vapp from a master catalogue and need to set the org network once I have deployed the Vapp before I power it on etc..... I am using the suggestion posted on the following forum post. (http://communities.vmware.com/message/1772021?tstart=0) but come up against this bug when I update the vm network section.

Regards and thanks in advance

David

0 Kudos
OwainNorth
Contributor
Contributor
Jump to solution

I have been assured by PM that we'll hear from them tomorrow.

0 Kudos
rkamal
VMware Employee
VMware Employee
Jump to solution

http://communities.vmware.com/community/vmtn/developer/forums/vcloudsdk-net

You can download the patch.

Regards,

Rajesh Kamal.

0 Kudos
OwainNorth
Contributor
Contributor
Jump to solution

Fantastic, we can all get on with our lives! Smiley Wink

Cheers Rajesh, much appreciated.

0 Kudos
daveniu
Contributor
Contributor
Jump to solution

Thnaks  Rajesh, the patch has fixed my problem 🙂

0 Kudos
imex1
Contributor
Contributor
Jump to solution

Can anyone confirm this will really work? I download and use the new SDK dll. But still gets the same "Bad request  - Unexpected JAXB Exception  - unexpected element {http://schemas.dmtf.org/ovf/envelope/1}Section" exception when I do vm.UpdateSection(vm.GetGuestCustomizationSection()).

By the way, I check the version of the VcloudSDK_V1_5.dll and it still the 1.5.0.0 instead of 1.5.0.1. The last modified date is 10/18/2011 2:30PM.

0 Kudos
rkamal
VMware Employee
VMware Employee
Jump to solution

Hi,

The version of the dll's for the patch are still VcloudSDK_V1_5.dll.

The same issue was reported to be fixed for others who reported this issue.

Make sure you remove and add the new dlls.

Regards,

Rajesh Kamal.

0 Kudos
imex1
Contributor
Contributor
Jump to solution

Just report that this version still does not work for me. But never mind I am now doing the REST myself to replace the GetGuestCustomizationSection method in the API.

0 Kudos
OwainNorth
Contributor
Contributor
Jump to solution

So you're saying that if you cut down your code completely, you still get the exception?

Vapp v = Vapp.GetVappByReference(client,vapp.Reference);
VM vm = v.GetChildrenVms().First();

vm.UpdateSection(vm.GetGuestCustomisationSection());

If so, it really does sound as if you haven't replaced the DLLs properly.

0 Kudos
abassoonkid
Contributor
Contributor
Jump to solution

I'm getting it in the Java SDK as well. Is it possible that the bug exists there as well? I haven't seen any update to the Java SDK release.

0 Kudos
johanneshiemer
Enthusiast
Enthusiast
Jump to solution

Hi,

I am not really sure what you are doing, but on my side the GuestCustomization is working fine. Here is my snippet:

GuestCustomizationSectionType guestCustomizationSection = vm.getGuestCustomizationSection();

guestCustomizationSection.setEnabled(enable);

guestCustomizationSection.setChangeSid(sidChange);

Task customizeVMTask = vm.updateSection(guestCustomizationSection);

try {

     Task.waitForTask(getVcloudClient(), customizeVMTask.getReference(), creationTaskDurationTimeout);

} catch (TimeoutException e) {

     result = false;

     e.printStackTrace();

}

If you have further questions, please let me know.

0 Kudos
abassoonkid
Contributor
Contributor
Jump to solution

Well, here's my code if you find something wrong. It worked when I was just modifying the hostname. It was after I changed the script that it started messing up. I had to add the extra "try" as per this discussion.

GuestCustomizationSectionType gcs= vm.getGuestCustomizationSection();
gcs.setEnabled(enable);

String script = gcs.getCustomizationScript().replaceAll(findString, replaceString);

gcs.setCustomizationScript(script);
gcs.setComputerName(computerName);

try {
     try {
          vm.updateSection(gcs).waitForTask(0);
     } catch (VCloudException e) {
          if (e.getMessage().contains("adminPassword")) {
               gcs.setAdminPassword(null);
               vm.updateSection(gcs).waitForTask(0);
          } else {
               return e.getMessage();
          }
     }
} catch (TimeoutException e) {
     return e.getMessage();
}
0 Kudos