0

My environment is:

servicemix 5.4.1 [system.properties has property "hawtio.authenticationEnabled=false"]
jolokia agent 1.6.2
standalone hawtio 2.10
apache camel 2.14.3

First I start servicemix

Then I use "java -jar jolokia-jvm-1.6.2-agent.jar list" to find karaf process ID
and "java -jar jolokia-jvm-1.6.2-agent.jar --port 7777 start 21284" to attach jolokia to karaf JVM

Then "java -jar hawtio-app-2.10.0.jar" to start standlone hawtio app

When I go to Debug panel of my camel route, there is a message "Debugging is not allowed for this user"

I'm using Blueprint DSL

My Camel endpoint is

<camelcxf:cxfEndpoint
        id="cxfOrderEndpointService"
        wsdlURL="wsdl/order.wsdl"
        xmlns:s="http://order.camelinaction"
        address="/orderservice"
        serviceClass="camelinaction.order.OrderInterface"
        endpointName="s:orderServicePort"
        serviceName="s:orderService"/>

my CamelContext is

<camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint" trace="true">
    <route>
        <from uri="cxf:bean:cxfOrderEndpointService"/>
        <log message="hello from OrderEndpointService"/>
        <to uri="bean:helloBean?method=Hello"/>
        <to uri="bean:helloBean?method=Bye"/>
        <process ref="helloProcessor"/>
    </route>
</camelContext>

Please help me, to solve this, I really couldn't find any info that could have helped me.

Lagi
  • 495
  • 4
  • 12
  • I can use Jolokia , to use JMX API to set Apache Camel context properties Like /jolokia/exec/org.apache.camel:context=statement.service,type=tracer,name=BacklogDebugger/enableDebugger()" and it works just fine. But it seems to me, that there's a problem with Hawtio and Apache Servicemix negotiation through Jolokia – Lagi Jun 07 '20 at 18:20

2 Answers2

0

Found solution myself, which is :

Use Hawtio as standalone agent with Jolokia OSGI agent

  1. Download Jolokia OSGI agent from - https://jolokia.org/download.html ( get latest Osgi-Agent (full bundle))
  2. Download Hawtio from - https://github.com/hawtio/hawtio/releases ( get latest)
  3. Run servicemix or karaf
  4. Install Jolokia OSGI agent to karaf/servicemix processm
  5. Create configuration file in %KARAF_HOME%/etc/org.jolokia.osgi.cfg
  6. Fill config with folowing data

    org.jolokia.user=karaf
    org.jolokia.password=karaf
    org.jolokia.agentContext=/jolokia
    org.jolokia.debug=true org.jolokia.realm=karaf
    org.jolokia.authMode=jaas

  7. Install Jolokia OSGI bundle, in karaf console run : osgi:install file:c:\Users\avazhenin\Downloads\jolokia-osgi-bundle-1.6.2.jar

  8. osgi:stop %jolokia-osgi-gent%
  9. osgi:start %jolokia-osgi-gent%
  10. access Jolokia under http://localhost:8181/jolokia
  11. Run Hawtio web - java -jar hawtio-app-2.10.0.jar
  12. open http://localhost:8080/hawtio/jvm/discover (Jolokia agent must be found)
  13. goto http://localhost:8080/hawtio/jvm/connect (there already must be found agent, press connect)
  14. Hawtio menu will be extended , you'll see Camel and etc... options (if camel features installed)

The problem was, that Jolokia standalone agent cannot work properly outside karaf osgi container (at least I couldn't find a fix for that), because it needs configuration mentioned above, which you cannot give at agent runtime (for example it's not possible to set Jolokia realm=karaf with java -jar ....)

Lagi
  • 495
  • 4
  • 12
0

Another way is to use "Jolokia as JVM Agent"

3.4. JVM Agent The JVM agent is right agent when it comes to instrument an arbitrary Java application which is not covered by the other agents. This agent can be started by any Java program by providing certain startup options to the JVM

So basically in servicemix.bat , where DEFAULT_JAVA_OPTS is defined , at the end , add folowing :
-javaagent:jolokia-jvm-1.6.2-agent.jar=host=localhost,realm=karaf,authMode=jaas,debug=true,user=karaf,password=karaf,port=8888

So this way, you can set to realm parameter and authMode, this way Jolokia work just fine and Debug and Trace capabilities are available.

Lagi
  • 495
  • 4
  • 12