WebSphere Application Server & Liberty

 View Only
Expand all | Collapse all

javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager

  • 1.  javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager

    Posted Wed February 23, 2022 12:14 PM
    Edited by Larry LeFever Wed February 23, 2022 12:19 PM
    I've successfully created and executed a Jython script to install a particular war-file.  But, then, when I try to do similarly to start it, I get the error below.

    I've checked the appName.  I did, at first, have an issue, such that, whereas in most places in the script the actual war-file name is used, in one place the dots in the name seem to have to be converted into underscores.  And, at first, I saw that I'd installed the war-file with appName containing dots instead of underscores.  But, even after I re-installed with the name having underscores instead of dots, the start-script still failed with the error below.

    Does the following error mean that the ApplicationManager isn't found?  Or that the specified war-file isn't found?  Because, when I run the AdminApp.list() command, it includes in the list of installed apps the one I'm trying to programmatically start (with the underscores in the name).

    I also tried what some of the log-info from the command suggested: namely, using the option for running with the older version of Jython ("-usejython21 true"), but that didn't change anything.

    Here's the command:

    AdminControl.invoke( 'WebSphere: name=ApplicationManager, process=WAS90QA, platform=proxy, node=QA_WAS90QA, version=9.0.5.10, type=ApplicationManager, mbeanIdentifier=ApplicationManager, cell=QA_WAS90QA, spec=1.0', 'startApplication', '[{name_with_underscores_ommitted}]'

    Any feedback would be much appreciated.


    [2/23/22 11:32:07:578 EST] 00000001 AbstractShell A WASX7091I: Executing script: "warStart.py"
    [2/23/22 11:32:07:634 EST] 00000001 AbstractShell E WASX7120E: Diagnostic information from exception with text "javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager, process=WAS90QA, platform=proxy, node=QA_WAS90QA, version=9.0.5.10, type=ApplicationManager, mbeanIdentifier=ApplicationManager, cell=QA_WAS90QA, spec=1.0
    " follows:

    javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager, process=WAS90QA, platform=proxy, node=QA_WAS90QA, version=9.0.5.10, type=ApplicationManager, mbeanIdentifier=ApplicationManager, cell=QA_WAS90QA, spec=1.0
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.handleAdminFault(SOAPConnectorClient.java:970)
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplateOnce(SOAPConnectorClient.java:935)
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplate(SOAPConnectorClient.java:699)
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplate(SOAPConnectorClient.java:689)
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.getMBeanInfo(SOAPConnectorClient.java:620)
    at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnectorClient.java:538)
    at com.sun.proxy.$Proxy7.getMBeanInfo(Unknown Source)
    at com.ibm.ws.management.AdminClientImpl.getMBeanInfo(AdminClientImpl.java:134)
    at com.ibm.ws.scripting.AdminControlClient.signature(AdminControlClient.java:2577)
    at com.ibm.ws.scripting.AdminControlClient.invoke(AdminControlClient.java:1523)
    at com.ibm.ws.scripting.AdminControlClient.invoke(AdminControlClient.java:1434)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
    at org.python.core.PyObject.__call__(PyObject.java:515)
    at org.python.core.PyObject.__call__(PyObject.java:521)
    at org.python.core.PyMethod.__call__(PyMethod.java:171)
    at org.python.pycode._pyx59.f$0(<string>:1)
    at org.python.pycode._pyx59.call_function(<string>)
    at org.python.core.PyTableCode.call(PyTableCode.java:167)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1386)
    at org.python.core.Py.exec(Py.java:1430)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:267)
    at com.ibm.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:120)
    at com.ibm.bsf.BSFManager$6.run(Unknown Source)
    at java.security.AccessController.doPrivileged(AccessController.java:738)
    at com.ibm.bsf.BSFManager.exec(Unknown Source)
    at com.ibm.ws.scripting.AbstractShell.executeScript(AbstractShell.java:1291)
    at com.ibm.ws.scripting.AbstractShell.run(AbstractShell.java:2395)
    at com.ibm.ws.scripting.WasxShell.main(WasxShell.java:1256)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234)
    at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:101)
    at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:82)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
    at org.eclipse.core.launcher.Main.run(Main.java:981)
    at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:422)
    at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:179)

    [2/23/22 11:32:07:648 EST] 00000001 AbstractShell W The wsadmin is running with Jython V2.7 and it might not work with your script properly. You can modify your script or switch to Jython V2.1 by running wsadmin command '-usejython21 true'.
    [2/23/22 11:32:07:650 EST] 00000001 AbstractShell A WASX7093I: Issuing message: "WASX7017E: Exception received while running file "warStart.py"; exception information: javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager, process=WAS90QA, platform=proxy, node=QA_WAS90QA, version=9.0.5.10, type=ApplicationManager, mbeanIdentifier=ApplicationManager, cell=QA_WAS90QA, spec=1.0

    ------------------------------
    Larry LeFever
    ------------------------------


  • 2.  RE: javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager

    IBM Champion
    Posted Thu February 24, 2022 06:02 AM
    Hello Larry,
    does it work if you run the command from the `wsadmin.sh` shell? Actually you are passing the application name as a list containing a set (`'[{name_with_underscores_ommitted}]'`). Sure that's right? I've checked one of my scrips and there I'm invoking the command like the following: `AdminControl.invoke(appManagerMBean, "startApplication", appName)` 

    From the error message you have pasted: `javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager, process=WAS90QA, platform=proxy, node=QA_WAS90QA, version=9.0.5.10, type=ApplicationManager, mbeanIdentifier=ApplicationManager, cell=QA_WAS90QA, spec=1.0` is seems however that your problem is that the AppManager MBean is incorrect. Please can you check and verify that this is correct and exists?

    Thanks - Hermann


    ------------------------------
    Hermann Huebler
    2innovate IT Consulting GmbH
    Vienna
    Austria

    #IBMChampion
    ------------------------------



  • 3.  RE: javax.management.InstanceNotFoundException: WebSphere: name=ApplicationManager

    Posted Thu November 16, 2023 03:06 PM

    For people who have landed on this page googling for 'InstanceNotFoundException' :)

    As Hermann mentioned, the problem is that MBean can not be found (identified).

    You might consider using command completeObjectName to create a string representation of a MBean that is based on a fragment. Please note that if the system finds several MBeans that match the fragment, the command returns the first one.

    So the solution could be:

    objNameString = AdminControl.completeObjectName("WebSphere:name=ApplicationManager,*")
    AdminControl.invoke(objNameString, 'startApplication', '[{name_with_underscores_ommitted}]')

    In our case it helped with invoking a function by AdminControl.



    ------------------------------
    Anna van den Akker
    ------------------------------