I try to import VCO plug-in in VCO through REST client, it always through below listed error
Exception in thread "main" org.springframework.web.client.HttpServerErrorException: 500 Internal Server Error
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:92)
at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:494)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:451)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:423)
at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:328)
at com.vmware.o11n.sdk.rest.client.services.PluginService.importPlugin(PluginService.java:65)
at com.vmware.o11n.sdk.rest.client.services.PluginService.importPluginFromFile(PluginService.java:53)
at FileUploadAdv100.uploadVCOPluginsList(FileUploadAdv100.java:53)
at FileUploadAdv100.main(FileUploadAdv100.java:26)
My code is here in
| File pluginFile = new File("D:\\vcoplugins\\JAVARESTSDK_Examples\\o11nplugin-powershell-1.0.1.vmoapp"); | ||
| boolean overwrite = false; | ||
| VcoSessionFactory sessionFactory = createSessionFactory(); | ||
| Authentication auth = createAuthentication(sessionFactory); | ||
| VcoSession session = sessionFactory.newSession(auth); | ||
| PluginService pluginService = new PluginService(session); | ||
| pluginService.importPluginFromFile(pluginFile, overwrite); |
Regards
AVR
Hi AVR,
PluginService.importPluginFromFile() supports only importing of plug-ins from .dar files, not from .vmoapp files.
The good news is that you can extract the .dar file from the .vmoapp file. Just open the .vmoapp file with some program which can open .ZIP archives (like WinRar, WinZip, 7-zip, etc.) and extract the .dar file. Then modify your code to pass the path to .dar file (the first line of your code).
Another option would be to try PluginService.importApplicationFromFile(), which should support importing from .vmoapp files.
Hope this helps,
-Ilian
Hi AVR,
PluginService.importPluginFromFile() supports only importing of plug-ins from .dar files, not from .vmoapp files.
The good news is that you can extract the .dar file from the .vmoapp file. Just open the .vmoapp file with some program which can open .ZIP archives (like WinRar, WinZip, 7-zip, etc.) and extract the .dar file. Then modify your code to pass the path to .dar file (the first line of your code).
Another option would be to try PluginService.importApplicationFromFile(), which should support importing from .vmoapp files.
Hope this helps,
-Ilian
Thanks for your valuable and promt suggestion it works for me.
-AVR
