[GLASSFISH-15571] Create Resource Adapter Config is throwing an exception if jms is already started Created: 14/Jan/11  Updated: 21/Sep/15

Status: Open
Project: glassfish
Component/s: orb
Affects Version/s: None
Fix Version/s: 4.1.1

Type: Bug Priority: Major
Reporter: sumasri Assignee: Harshad Vilekar
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1-next, 3_1-release-note-added, 3_1-release-notes, 3_1_2-exclude

 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



 Comments   
Comment by Jagadish [ 14/Jan/11 ]

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

Comment by Ken Cavanaugh [ 14/Jan/11 ]

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.

Comment by Jagadish [ 17/Jan/11 ]

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 ?

Comment by Jagadish [ 17/Jan/11 ]

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

Comment by Scott Fordin [ 23/Mar/11 ]

Need more info to add issue to 3.1 Release Notes.

Comment by Jagadish [ 31/Mar/11 ]

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.

Comment by Scott Fordin [ 13/Apr/11 ]

Added issue to 3.1. Release Notes.

Comment by Nazrul [ 21/Apr/11 ]

It would be useful to look into this issue during 3.1.1

Comment by scatari [ 25/Jun/11 ]

Marking it as to be considered after 3.1.1.

Comment by Tom Mueller [ 07/Feb/13 ]

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

Generated at Fri Apr 28 18:03:28 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.