VMware {code} Community
KarthikLella
Contributor
Contributor

VCSA 6.0 Custom web-client plugin Startup Servlet not working

Hello,

We have a Web-client plugin which works in VCSA 5.5 and when we upgraded to VCSA 6.0, the web-client plugin is not working as expected. In our custom Plugin which is deployed @ (/etc/vmware/vsphere-client/vc-packages/vsphere-client-serenity) we have a war called customDaemon.war  which  has a StartupServlet which loads on Startup when the Plugin is loaded and performs certain actions. This StartupServlet's init gets called in VCSA 5.5 but not in VCSA 6.0 . In looking at the VSphere-client logs, there is no error and it says the Bundle has properly Started .(BundleEvent STARTED), but the StartupServlet doesnt get invoked. Can you please let us know if any of the functionality related to custom Plugins has changed in VCSA 6.0

0 Kudos
5 Replies
laurentsd
VMware Employee
VMware Employee

What is the purpose of your deamon?  This is not a recommended practice but I can't think of anything specific that would have changed this behavior.

If you can isolate some code and reproduce this using of the SDK samples that would be ideal for us to have a look.

0 Kudos
KarthikLella
Contributor
Contributor

Hi laurent,

The purpose of the daemon is to capture some events and do some processing.All we have done in the war file is have one HelloWorldServlet class with that servlet definition in web.xml and having it as load-on-startup so that when the war gets deployed , the HelloWorldServlet init method gets invoked.The logs says the Bundle of the war is Started properly, but the Servlet init method is not called, which was happening in 5.5

0 Kudos
myelaman
Enthusiast
Enthusiast

Laurent,

            We have init() method inside our servlet:

public class StartUpServlet extends HttpServlet {

  private static final long serialVersionUID = 1L;

  public StartUpServlet() {

        super();

      

    }

   

  @Override

  public void init() throws ServletException {

  super.init();

  System.out.println(" Initalizing the Custom Daemon");

  }

}

The print statement never gets called in 6.0 but it gets called in 5.5

here is the logs in 6.0 :

[2015-09-23T16:20:45.886Z] [INFO ]  Connection(9)-172.20.100.91 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'sun.misc.Launcher$AppClassLoader@55672313' pushed and set to 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]'

[2015-09-23T16:20:45.887Z] [INFO ]  Connection(9)-172.20.100.91  o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' popped and set to 'sun.misc.Launcher$AppClassLoader@55672313'

[2015-09-23T16:20:45.887Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.virgo.kernel.install.environment.internal.StandardInstallLog  process exit with installGraph '%s' (source 'bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0' in scope 'null'<>')

[2015-09-23T16:20:45.887Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.virgo.kernel.install.environment.internal.StandardInstallLog  process exit with installGraph '%s' (source 'bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0' in scope 'null'<>')

[2015-09-23T16:20:45.888Z] [INFO ]  Connection(9)-172.20.100.91 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'sun.misc.Launcher$AppClassLoader@55672313' pushed and set to 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]'

[2015-09-23T16:20:45.888Z] [INFO ]  Connection(9)-172.20.100.91 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' pushed and set to 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]'

[2015-09-23T16:20:45.889Z] [INFO ]  Connection(9)-172.20.100.91 org.eclipse.virgo.nano.core.internal.BundleStartTracker Adding signal 'org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal@389748cd' for bundle 'com.cisco.vts.vwcplugin.custom_1.0.0 [333]'

[2015-09-23T16:20:45.894Z] [DEBUG]  Connection(9)-172.20.100.91 c.v.vise.extensionfw.impl.InstallArtifactLifecycleListenerHelper  Artifact Stage / Name: Starting / com.cisco.vts.vwcplugin.custom

[2015-09-23T16:20:45.894Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.v.k.i.a.internal.AtomicInstallArtifactLifecycleListener Processing atomic starting event for bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0' in scope 'null'

[2015-09-23T16:20:45.894Z] [INFO ]  Connection(9)-172.20.100.91 org.eclipse.virgo.medic.eventlog.default DE0004I Starting bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0'.

[2015-09-23T16:20:45.895Z] [INFO ]  Connection(9)-172.20.100.91 org.eclipse.virgo.nano.core.internal.BundleStartTracker Non-Spring DM powered bundle 'com.cisco.vts.vwcplugin.custom_1.0.0 [333]' has started. Driving signals '[org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal@389748cd]'.

[2015-09-23T16:20:45.897Z] [INFO ] start-signalling-1 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'org.eclipse.core.runtime.internal.adaptor.ContextFinder@b852ae5' pushed and set to 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]'

[2015-09-23T16:20:45.899Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.g.blueprint.extender.internal.activator.LifecycleManager Inspecting bundle [vsphere-customstartupservlet (com.cisco.vts.vwcplugin.custom)]

[2015-09-23T16:20:45.899Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.g.blueprint.extender.internal.activator.LifecycleManager No application context created for bundle [vsphere-customstartupservlet (com.cisco.vts.vwcplugin.custom)]

[2015-09-23T16:20:45.899Z] [DEBUG] start-signalling-1 c.v.vise.extensionfw.impl.InstallArtifactLifecycleListenerHelper  Artifact Stage / Name: Started / com.cisco.vts.vwcplugin.custom

[2015-09-23T16:20:45.899Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.g.blueprint.extender.internal.activator.LifecycleManager Inspecting bundle [vsphere-customstartupservlet (com.cisco.vts.vwcplugin.custom)]

[2015-09-23T16:20:45.899Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.g.b.e.i.b.activator.support.BlueprintContainerCreator No blueprint configuration found in bundle vsphere-customstartupservlet (com.cisco.vts.vwcplugin.custom); ignoring it...

[2015-09-23T16:20:45.899Z] [DEBUG]  Connection(9)-172.20.100.91 o.e.g.blueprint.extender.internal.activator.LifecycleManager No application context created for bundle [vsphere-customstartupservlet (com.cisco.vts.vwcplugin.custom)]

[2015-09-23T16:20:45.899Z] [INFO ]  Connection(9)-172.20.100.91  o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' popped and set to 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]'

[2015-09-23T16:20:45.900Z] [INFO ]  Connection(9)-172.20.100.91 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' popped and set to 'sun.misc.Launcher$AppClassLoader@55672313'

[2015-09-23T16:20:45.900Z] [INFO ] start-signalling-1 org.eclipse.virgo.medic.eventlog.default DE0005I Started bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0'.

[2015-09-23T16:20:45.900Z] [INFO ] start-signalling-1 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' popped and set to 'org.eclipse.core.runtime.internal.adaptor.ContextFinder@b852ae5'

[2015-09-23T16:20:45.901Z] [INFO ] iLogServiceListener@7f646501 org.osgi.service.log.LogService Bundle com.cisco.vts.vwcplugin.custom_1.0.0, BundleEvent STARTED





but the log in 5.5:



2015-09-23 11:19:43.225] [INFO ] Connection(7)-172.20.100.141  o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager     Thread context class loader 'KernelBundleClassLoader: [bundle=com.cisco.vts.vwcplugin.custom_1.0.0]' popped and set to 'sun.misc.Launcher$AppClassLoader@45a8a7e'

[2015-09-23 11:19:43.226] [INFO ] iLogServiceListener@21fd3d92  org.osgi.service.log.LogService                                   Bundle com.cisco.vts.vwcplugin.custom_1.0.0, BundleEvent INSTALLED

[2015-09-23 11:19:43.226] [INFO ] iLogServiceListener@21fd3d92  org.osgi.service.log.LogService                                   Bundle com.cisco.vts.vwcplugin.custom_1.0.0, BundleEvent RESOLVED

[2015-09-23 11:19:43.226] [INFO ] iLogServiceListener@21fd3d92  org.osgi.service.log.LogService                                   Bundle com.cisco.vts.vwcplugin.custom_1.0.0, BundleEvent STARTED

[2015-09-23 11:19:43.456] [INFO ] start-signalling-2           System.out                                                         Initalizing the Custom Daemon

[2015-09-23 11:19:43.458] [INFO ] iLogServiceListener@21fd3d92  org.osgi.service.log.LogService                                   Bundle com.cisco.vts.vwcplugin.custom_1.0.0, Service 626, ServiceEvent REGISTERED

[2015-09-23 11:19:43.459] [INFO ] start-signalling-2            org.eclipse.virgo.medic.eventlog.default                         WE0001I Started web bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0' with context path '/customDaemon'.

[2015-09-23 11:19:43.459] [INFO ] start-signalling-2            org.eclipse.virgo.medic.eventlog.default                         DE0005I Started bundle 'com.cisco.vts.vwcplugin.custom' version '1.0.0'.

we need the servlet to get started as we need to listen few events

Marianne

0 Kudos
laurentsd
VMware Employee
VMware Employee

There is usually no reason for a Web Client plugin to perform any background processing in the Virgo JVM.  Your java code should only be a thin layer used to get data from your back-end and to process commands from the UI (see the Architecture section at the top of docs/FAQ.html)

We recommend all business logic to be done in your own JVM on your server to avoid affecting performance of the Web Client.

I assume the Servlet work-around you used in 5.5 is no longer available in 6.0 for security reasons.

If you have a specific use case where you really need some processing to be done in the plugin's java layer, please provide additional details. Thanks.

0 Kudos
Peter_Ivanov
VMware Employee
VMware Employee

Between the releases we have changed the version of the virgo web server. This might be the reason for the behavior change.

A few questions:

  • Have you tried to debug the code (using remote java debug) to see whether the code is actually not invoked?
  • Is other code inside this servlet invoked? Constructor, some public  methods?
  • Do you see some errors or warnings in the log related to your plugin or class?
0 Kudos