[ 
https://issues.apache.org/jira/browse/CAMEL-8745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530048#comment-14530048
 ] 

Thomas Diesler commented on CAMEL-8745:
---------------------------------------

While you're at it, this code seems fishy

{code}
    val server: MBeanServer = ManagementFactory.getPlatformMBeanServer
    val names = server.queryNames(new ObjectName("*:type=context,*"), null)
    for (name <- names.asScala) {
      val on = name.asInstanceOf[ObjectName]
      val id: String = on.getKeyProperty("name")
      if (camelId == null || camelId.equals(id)) {
        found = on
      }
    }
{code}

If the the config does not explicitly give a camelId, it iterates over all 
MBeans and always uses the last even if the last MBean does not return a valid 
invocation result

> Swagger requires context name with quotes 
> ------------------------------------------
>
>                 Key: CAMEL-8745
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8745
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-swagger
>    Affects Versions: 2.15.1
>            Reporter: Thomas Diesler
>            Assignee: Willem Jiang
>
> {code}
>     <servlet>
>         <servlet-name>ApiDeclarationServlet</servlet-name>
>         
> <servlet-class>org.apache.camel.component.swagger.DefaultCamelSwaggerServlet</servlet-class>
>         <init-param>
>             <param-name>base.path</param-name>
>             <param-value>rest</param-value>
>         </init-param>
>         <init-param>
>             <param-name>api.path</param-name>
>             <param-value>api-docs</param-value>
>         </init-param>
>         <init-param>
>             <param-name>api.version</param-name>
>             <param-value>1.2.3</param-value>
>         </init-param>
>         <init-param>
>             <param-name>api.title</param-name>
>             <param-value>User Services</param-value>
>         </init-param>
>         <init-param>
>             <param-name>api.description</param-name>
>             <param-value>Camel Rest Example with Swagger that provides an 
> User REST service</param-value>
>         </init-param>
>         <init-param>
>             <param-name>camelId</param-name>
>             <param-value>"swagger-test"</param-value>
>         </init-param>
>         <load-on-startup>2</load-on-startup>
>     </servlet>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to