glassfish
  1. glassfish
  2. GLASSFISH-15571

Create Resource Adapter Config is throwing an exception if jms is already started

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Component/s: orb
    • Labels:
      None

      Description

      Start the JMS. In GUI, try to create a resource adapter config using jmsra and thread pool as "http-thread-pool".
      It is throwing an exception in the server log.

      Steps to reproduce the issue :

      1)./bin/asadmin jms-ping
      2) In GUI, create a resource adapter config with resource adapter name as jmsra and thread pool as http-thread-pool. Then, it throws an exception.

      Exception in server log :

      [#|2011-01-14T14:55:14.369+0530|SEVERE|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.work|_ThreadID=333;_ThreadName=Thread-2;|Thread-pool [ http-thread-pool ] not found|#]

      [#|2011-01-14T14:55:14.370+0530|SEVERE|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.work|_ThreadID=333;_ThreadName=Thread-2;|An error occurred during instantiation of the work manager for resource-adapter [ jmsra ]
      com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
      at com.sun.enterprise.connectors.work.CommonWorkManager.<init>(CommonWorkManager.java:118)
      at com.sun.enterprise.connectors.work.WorkManagerFactory.createWorkManager(WorkManagerFactory.java:125)
      at com.sun.enterprise.connectors.work.WorkManagerFactory.getWorkManagerProxy(WorkManagerFactory.java:196)
      at com.sun.enterprise.connectors.ConnectorRuntime.getWorkManagerProxy(ConnectorRuntime.java:1129)
      at com.sun.enterprise.connectors.BootstrapContextImpl.initializeWorkManager(BootstrapContextImpl.java:161)
      at com.sun.enterprise.connectors.BootstrapContextImpl.<init>(BootstrapContextImpl.java:103)
      at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:126)
      at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
      at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
      at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:211)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:345)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.reCreateActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:541)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.addResourceAdapterConfig(ResourceAdapterAdminServiceImpl.java:494)
      at com.sun.enterprise.connectors.ConnectorRuntime.addResourceAdapterConfig(ConnectorRuntime.java:1195)
      at com.sun.enterprise.resource.deployer.ResourceAdapterConfigDeployer.deployResource(ResourceAdapterConfigDeployer.java:86)
      at com.sun.enterprise.resource.deployer.ResourceAdapterConfigDeployer.redeployResource(ResourceAdapterConfigDeployer.java:117)
      at org.glassfish.javaee.services.ResourceManager$PropertyChangeHandler.handleChangeEvent(ResourceManager.java:378)
      at org.glassfish.javaee.services.ResourceManager$PropertyChangeHandler.changed(ResourceManager.java:328)
      at org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:329)
      at org.glassfish.javaee.services.ResourceManager.changed(ResourceManager.java:275)
      at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:376)
      at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:366)
      at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:256)
      at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:254)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: com.sun.corba.ee.spi.orbutil.threadpool.NoSuchThreadPoolException
      at org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager.getThreadPool(S1ASThreadPoolManager.java:217)
      at com.sun.enterprise.connectors.work.CommonWorkManager.<init>(CommonWorkManager.java:111)
      ... 29 more

        Activity

        Hide
        Jagadish added a comment - - edited

        ThreadPoolManager.getThreadPool() seems to throw the exception.

        ThreadPoolManager only has "thread-pool-1" when the method "getThreadPool" is called.

        Transferring to Ken for further investigation.

        Steps to reproduce :

        asadmin jms-ping
        asadmin create-resource-adapter-config --threadpoolid http-thread-pool jmsra

        will show the reported exception in server.log

        Show
        Jagadish added a comment - - edited ThreadPoolManager.getThreadPool() seems to throw the exception. ThreadPoolManager only has "thread-pool-1" when the method "getThreadPool" is called. Transferring to Ken for further investigation. Steps to reproduce : asadmin jms-ping asadmin create-resource-adapter-config --threadpoolid http-thread-pool jmsra will show the reported exception in server.log
        Hide
        Ken Cavanaugh added a comment -

        It looks like the issue may be in S1ASThreadPoolManager (which is in orb/orb-connector).
        This class has a static initializer that reads the ThreadPool config data from
        the iiop service and network listener config beans. But there is no way to
        add a new ORB threadpool after the initial configuration is read.

        It is also not clear to me from the test case how you expect "http-thread-pool" to be created.
        Is this an ORB threadpool or a Grizzly threadpool? GF 3.1 has TWO distinct threadpool implementations currently.
        Which one does create-resource-adapter-config expect to use?
        How does the http-thread-pool get created if it does not already exist?

        I am excluding this from 3.1 because I cannot investigate it or fix it before
        the RC1 deadline. It is not even clear if this is something that should be fixed at this point.

        Show
        Ken Cavanaugh added a comment - It looks like the issue may be in S1ASThreadPoolManager (which is in orb/orb-connector). This class has a static initializer that reads the ThreadPool config data from the iiop service and network listener config beans. But there is no way to add a new ORB threadpool after the initial configuration is read. It is also not clear to me from the test case how you expect "http-thread-pool" to be created. Is this an ORB threadpool or a Grizzly threadpool? GF 3.1 has TWO distinct threadpool implementations currently. Which one does create-resource-adapter-config expect to use? How does the http-thread-pool get created if it does not already exist? I am excluding this from 3.1 because I cannot investigate it or fix it before the RC1 deadline. It is not even clear if this is something that should be fixed at this point.
        Hide
        Jagadish added a comment -

        Hi Ken,

        > It looks like the issue may be in S1ASThreadPoolManager (which is in orb/orb-connector).
        > This class has a static initializer that reads the ThreadPool config data from
        > the iiop service and network listener config beans. But there is no way to
        > add a new ORB threadpool after the initial configuration is read.

        Yes, whenever we create a thread-pool, we restart the server.

        > It is also not clear to me from the test case how you expect "http-thread-pool" to be created.
        > Is this an ORB threadpool or a Grizzly threadpool?
        Connector container uses ORB thread pool (work) API and hence its always ORB thread pool.
        > GF 3.1 has TWO distinct threadpool implementations currently.
        > Which one does create-resource-adapter-config expect to use?
        ORB thread pool.
        In GlassFish 2.x and before, a resource-adapter can use any of the configured thread-pools in the system.

        > How does the http-thread-pool get created if it does not already exist?
        http-thread-pool configuration is present in a all domains by default.

        > I am excluding this from 3.1 because I cannot investigate it or fix it before
        > the RC1 deadline. It is not even clear if this is something that should be fixed at this point.

        I am able to create a new thread pool, restart server, configure the resource-adapter to use new thread pool successfully. However, I do not see http-thread-pool and admin-thread-pool in the list of thread pools of S1ASThreadPoolManager. Is this by design ?
        If it is by design, probably we should document it.

        eg: Following thread-pools are grizzly thread pools and will not be available for ORB thread pool clients/users.
        http-thread-pool, admin-thread-pool

        I am adding '3_1-release-notes' tag to the issue so that it is documented/release-noted.

        Could you please provide appropriate documentation changes for the same ?

        Show
        Jagadish added a comment - Hi Ken, > It looks like the issue may be in S1ASThreadPoolManager (which is in orb/orb-connector). > This class has a static initializer that reads the ThreadPool config data from > the iiop service and network listener config beans. But there is no way to > add a new ORB threadpool after the initial configuration is read. Yes, whenever we create a thread-pool, we restart the server. > It is also not clear to me from the test case how you expect "http-thread-pool" to be created. > Is this an ORB threadpool or a Grizzly threadpool? Connector container uses ORB thread pool (work) API and hence its always ORB thread pool. > GF 3.1 has TWO distinct threadpool implementations currently. > Which one does create-resource-adapter-config expect to use? ORB thread pool. In GlassFish 2.x and before, a resource-adapter can use any of the configured thread-pools in the system. > How does the http-thread-pool get created if it does not already exist? http-thread-pool configuration is present in a all domains by default. > I am excluding this from 3.1 because I cannot investigate it or fix it before > the RC1 deadline. It is not even clear if this is something that should be fixed at this point. I am able to create a new thread pool, restart server, configure the resource-adapter to use new thread pool successfully. However, I do not see http-thread-pool and admin-thread-pool in the list of thread pools of S1ASThreadPoolManager. Is this by design ? If it is by design, probably we should document it. eg: Following thread-pools are grizzly thread pools and will not be available for ORB thread pool clients/users. http-thread-pool, admin-thread-pool I am adding '3_1-release-notes' tag to the issue so that it is documented/release-noted. Could you please provide appropriate documentation changes for the same ?
        Hide
        Jagadish added a comment -

        Update : I see that IIOPUtils exluding thread-pools that are used by http-listener (network-listener) while initializing ORB thread-pools.

        Show
        Jagadish added a comment - Update : I see that IIOPUtils exluding thread-pools that are used by http-listener (network-listener) while initializing ORB thread-pools.
        Hide
        Scott Fordin added a comment -

        Need more info to add issue to 3.1 Release Notes.

        Show
        Scott Fordin added a comment - Need more info to add issue to 3.1 Release Notes.
        Hide
        Jagadish added a comment -

        There are two thread pool implementations from GlassFish 3.0 ie., grizzly based thread-pool and ORB based thread-pool.

        "create-resource-adapter-config" takes a thread-pool id as parameter which is based on ORB thread-pool.
        Also refer, create-thread-pool command to create new thread-pools.

        ORB thread-pool, when initialized will verify whether an "thread-pool" is used by grizzly and will initialize the thread-pool only if grizzly is already not using the configuration.

        So, there need to be a documentation stating that ORB thread pool manager will exclude any defined thread-pool configuration in the system if its already used by grizzly thread pool manager.

        Show
        Jagadish added a comment - There are two thread pool implementations from GlassFish 3.0 ie., grizzly based thread-pool and ORB based thread-pool. "create-resource-adapter-config" takes a thread-pool id as parameter which is based on ORB thread-pool. Also refer, create-thread-pool command to create new thread-pools. ORB thread-pool, when initialized will verify whether an "thread-pool" is used by grizzly and will initialize the thread-pool only if grizzly is already not using the configuration. So, there need to be a documentation stating that ORB thread pool manager will exclude any defined thread-pool configuration in the system if its already used by grizzly thread pool manager.
        Hide
        Scott Fordin added a comment -

        Added issue to 3.1. Release Notes.

        Show
        Scott Fordin added a comment - Added issue to 3.1. Release Notes.
        Hide
        Nazrul added a comment -

        It would be useful to look into this issue during 3.1.1

        Show
        Nazrul added a comment - It would be useful to look into this issue during 3.1.1
        Hide
        scatari added a comment -

        Marking it as to be considered after 3.1.1.

        Show
        scatari added a comment - Marking it as to be considered after 3.1.1.
        Hide
        Tom Mueller added a comment -

        Targeting for 4.0.1 as bugs related to the orb do not need to be fixed for the RI/SDK.

        Show
        Tom Mueller added a comment - Targeting for 4.0.1 as bugs related to the orb do not need to be fixed for the RI/SDK.

          People

          • Assignee:
            Harshad Vilekar
            Reporter:
            sumasri
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: