Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-881

Embedded server gets broken after operation on embedded host controller

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Beta3
    • 2.0.0.Beta1
    • CLI, Management
    • None
    • Hide
      $ ./jboss-cli.sh 
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      
      [disconnected /] embed-host-controller 
      11:00:59,852 INFO  [org.jboss.modules] (AeshProcess: 1) JBoss Modules version 1.4.3.Final
      ...
      11:01:01,201 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) (Host Controller) started in 1256ms - Started 25 of 27 services (8 services are lazy, passive or on-demand)
      
      [domain@embedded /] /host=master:read-resource
      {
          "outcome" => "success",
      ...
      }
      
      [domain@embedded /] stop-embedded-host-controller
      11:01:13,778 INFO  [org.jboss.as] (MSC service thread 1-4) WFLYSRV0050: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) stopped in 6ms
      
      [disconnected /] embed-server
      11:01:20,517 INFO  [org.jboss.as] (MSC service thread 2-7) WFLYSRV0049: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) starting
      ...
      EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) started in 181ms - Started 35 of 48 services (19 services are lazy, passive or on-demand)
      
      [standalone@embedded /] stop-embedded-server
      Failed to handle 'stop-embedded-server': org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl cannot be cast to org.wildfly.core.embedded.HostController
      
      [standalone@embedded /] :read-attribute(name=server-state)
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      
      [standalone@embedded /] embed-server 
      11:02:11,386 ERROR [org.jboss.msc] (AeshProcess: 7) MSC000010: Failed to register MBean with MBeanServer: javax.management.InstanceAlreadyExistsException: jboss.msc:type=container,name=jboss-as
      	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
      	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
      	at org.jboss.msc.service.ServiceContainerImpl.<init>(ServiceContainerImpl.java:372)
      	at org.jboss.msc.service.ServiceContainer$Factory.create(ServiceContainer.java:258)
      	at org.jboss.as.server.BootstrapImpl$ShutdownHook.register(BootstrapImpl.java:208)
      	at org.jboss.as.server.BootstrapImpl$ShutdownHook.access$100(BootstrapImpl.java:198)
      	at org.jboss.as.server.BootstrapImpl.<init>(BootstrapImpl.java:62)
      	at org.jboss.as.server.Bootstrap$Factory.newInstance(Bootstrap.java:244)
      	at org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl.start(EmbeddedStandAloneServerFactory.java:275)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.wildfly.core.embedded.EmbeddedServerReference.invokeOnServer(EmbeddedServerReference.java:80)
      	at org.wildfly.core.embedded.EmbeddedServerReference.start(EmbeddedServerReference.java:55)
      	at org.jboss.as.cli.embedded.EmbedServerHandler.doHandle(EmbedServerHandler.java:200)
      	at org.jboss.as.cli.handlers.CommandHandlerWithHelp.handle(CommandHandlerWithHelp.java:88)
      	at org.jboss.as.cli.impl.CommandContextImpl.handle(CommandContextImpl.java:751)
      	at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImpl.java:774)
      	at org.jboss.as.cli.impl.CommandContextImpl$2.execute(CommandContextImpl.java:389)
      	at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:53)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
      11:02:11,388 INFO  [org.jboss.as] (MSC service thread 3-7) WFLYSRV0049: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) starting
      11:02:11,424 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'enabled' in the resource at address '/subsystem=datasources/data-source=ExampleDS' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
      11:02:11,474 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) started in 92ms - Started 35 of 48 services (19 services are lazy, passive or on-demand)
      
      [standalone@embedded /] stop-embedded-server 
      Failed to handle 'stop-embedded-server': org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl cannot be cast to org.wildfly.core.embedded.HostController
      
      Show
      $ ./jboss-cli.sh You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. [disconnected /] embed-host-controller 11:00:59,852 INFO [org.jboss.modules] (AeshProcess: 1) JBoss Modules version 1.4.3.Final ... 11:01:01,201 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) (Host Controller) started in 1256ms - Started 25 of 27 services (8 services are lazy, passive or on-demand) [domain@embedded /] /host=master:read-resource { "outcome" => "success", ... } [domain@embedded /] stop-embedded-host-controller 11:01:13,778 INFO [org.jboss.as] (MSC service thread 1-4) WFLYSRV0050: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) stopped in 6ms [disconnected /] embed-server 11:01:20,517 INFO [org.jboss.as] (MSC service thread 2-7) WFLYSRV0049: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) starting ... EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) started in 181ms - Started 35 of 48 services (19 services are lazy, passive or on-demand) [standalone@embedded /] stop-embedded-server Failed to handle 'stop-embedded-server': org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl cannot be cast to org.wildfly.core.embedded.HostController [standalone@embedded /] :read-attribute(name=server-state) You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. [standalone@embedded /] embed-server 11:02:11,386 ERROR [org.jboss.msc] (AeshProcess: 7) MSC000010: Failed to register MBean with MBeanServer: javax.management.InstanceAlreadyExistsException: jboss.msc:type=container,name=jboss-as at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) at org.jboss.msc.service.ServiceContainerImpl.<init>(ServiceContainerImpl.java:372) at org.jboss.msc.service.ServiceContainer$Factory.create(ServiceContainer.java:258) at org.jboss.as.server.BootstrapImpl$ShutdownHook.register(BootstrapImpl.java:208) at org.jboss.as.server.BootstrapImpl$ShutdownHook.access$100(BootstrapImpl.java:198) at org.jboss.as.server.BootstrapImpl.<init>(BootstrapImpl.java:62) at org.jboss.as.server.Bootstrap$Factory.newInstance(Bootstrap.java:244) at org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl.start(EmbeddedStandAloneServerFactory.java:275) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.wildfly.core.embedded.EmbeddedServerReference.invokeOnServer(EmbeddedServerReference.java:80) at org.wildfly.core.embedded.EmbeddedServerReference.start(EmbeddedServerReference.java:55) at org.jboss.as.cli.embedded.EmbedServerHandler.doHandle(EmbedServerHandler.java:200) at org.jboss.as.cli.handlers.CommandHandlerWithHelp.handle(CommandHandlerWithHelp.java:88) at org.jboss.as.cli.impl.CommandContextImpl.handle(CommandContextImpl.java:751) at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImpl.java:774) at org.jboss.as.cli.impl.CommandContextImpl$2.execute(CommandContextImpl.java:389) at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:53) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 11:02:11,388 INFO [org.jboss.as] (MSC service thread 3-7) WFLYSRV0049: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) starting 11:02:11,424 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'enabled' in the resource at address '/subsystem=datasources/data-source=ExampleDS' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 11:02:11,474 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.Beta1) started in 92ms - Started 35 of 48 services (19 services are lazy, passive or on-demand) [standalone@embedded /] stop-embedded-server Failed to handle 'stop-embedded-server': org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl cannot be cast to org.wildfly.core.embedded.HostController

      I am unable to use standalone embedded server once I invoke some operation on embedded host controller.

      Quick steps to reproduce:

      $ ./jboss-cli.sh 
      [disconnected /] embed-host-controller
      [domain@embedded /] /host=master:read-resource
      [domain@embedded /] stop-embedded-host-controller 
      [disconnected /] embed-server
      [standalone@embedded /] stop-embedded-server 
      Failed to handle 'stop-embedded-server': org.wildfly.core.embedded.EmbeddedStandAloneServerFactory$StandaloneServerImpl cannot be cast to org.wildfly.core.embedded.HostController
      

      Reproducible with wf-core 2.0.0.Beta1 build

              kwills@redhat.com Ken Wills
              pkremens@redhat.com Petr Kremensky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: