Jerry Cwiklik created UIMA-5714:
-----------------------------------
Summary: UIMA-AS: JMX registration of MBean fails when name is
invalid
Key: UIMA-5714
URL: https://issues.apache.org/jira/browse/UIMA-5714
Project: UIMA
Issue Type: Bug
Components: Async Scaleout
Reporter: Jerry Cwiklik
Assignee: Jerry Cwiklik
Fix For: future-Uima-AS
When registering UIMA-AS MBean with JMX a unique name (ObjectName) is
constructed at runtime. Part of this name comes from AE resource specifier and
fetched via
((ResourceCreationSpecifier) resourceSpecifier).getMetaData().getName();
Since users can type whatever they want for the name, this string has to be
sanitized to remove chars that are not compatible with jmx ObjectName.
In one concrete scenario, a user included comma in the name which is not a
legal char for ObjectName. This caused an exception during initialization of a
service:
|Caused by: org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl]:
Constructor threw exception; nested exception is
javax.management.MalformedObjectNameException: Invalid character ',' in key
part of property
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
... 17 more
Caused by: javax.management.MalformedObjectNameException: Invalid character ','
in key part of property
at javax.management.ObjectName.construct(ObjectName.java:562)
at javax.management.ObjectName.<init>(ObjectName.java:1393)
at
org.apache.uima.aae.controller.BaseAnalysisEngineController.<init>(BaseAnalysisEngineController.java:462)
at
org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl.<init>(PrimitiveAnalysisEngineController_impl.java:173)
at
org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl.<init>(PrimitiveAnalysisEngineController_impl.java:161)
at
org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl.<init>(PrimitiveAnalysisEngineController_impl.java:134)
at
org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl.<init>(PrimitiveAnalysisEngineController_impl.java:125)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 19 more|
In BaseAnalysisEngineController.setupName() make sure the name contains only
valid chars for ObjectName. Code in question is this:
String serviceName = ((ResourceCreationSpecifier)
resourceSpecifier).getMetaData().getName();
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)