kura icon indicating copy to clipboard operation
kura copied to clipboard

Camel cloud service | Failed to run init code

Open mstankovic opened this issue 6 years ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to Packages and install "https://iot.comtrade.com/kuraTest/de.dentrassi.kura.addons.milo-0.5.1.dp"
  2. Go to Cloud Connections and create new Camel cloud instance ---> bug1: GUI error appears (screenshot1) without errors in kura.log ignore this issue and continue:
  3. Select created Camel cloud instance and set Router XML configuration
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="opc-ua-example">
<from uri="vm:camel:example"/>
<split>
<simple>${body.metrics().entrySet()}</simple>
<setHeader headerName="item">
<simple>${body.key()}</simple>
</setHeader>
<setBody>
<simple>${body.value()}</simple>
</setBody>
<toD uri="my-milo-server:${header.item}"/>
</split>
</route>
</routes>
  1. Set init code:
var milo = new org.apache.camel.component.milo.server.MiloServerComponent();
milo.setEnableAnonymousAuthentication(true);
camelContext.addComponent("my-milo-server", milo);
  1. Click on Apply button and confirm changes

Expected behavior Camel cloud service should connect successfully

Screenshots If applicable, add screenshots to help explain your problem.

Target Environment (please complete the following information):

  • Board Raspberry Pi 3
  • OS version: latest Raspbian late
  • Additional info:

Screenshots

  • screenshot1 e1

Kura.log exception

2020-04-14T15:29:53,685 [qtp32158435-77] INFO  o.e.k.w.s.s.FileServlet - Installing package...
2020-04-14T15:29:53,687 [DeploymentAgent] INFO  o.e.k.d.a.i.DeploymentAgent - About to install package at URL https://iot.comtrade.com/kuraTest/de.dentrassi.kura.addons.milo-0.5.1.dp
2020-04-14T15:29:54,046 [DeploymentAgent] INFO  o.e.k.c.s.SslManagerServiceImpl - Creating a new SSLSocketFactory instance
2020-04-14T15:29:54,124 [DeploymentAgent] INFO  o.e.k.c.s.SSLSocketFactoryWrapper - SSL Endpoint Identification enabled.
2020-04-14T15:29:59,447 [DeploymentAgent] INFO  o.e.k.d.a.i.DeploymentAgent - Posting INSTALLED event for package at URL https://iot.comtrade.com/kuraTest/de.dentrassi.kura.addons.milo-0.5.1.dp: successful
2020-04-14T15:31:09,742 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask started.
2020-04-14T15:31:09,743 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask: Delete confirmed messages...
2020-04-14T15:31:09,756 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask ended.
2020-04-14T15:32:08,945 [qtp32158435-76] INFO  o.e.j.s.h.C.ROOT - org.eclipse.kura.web.server.GwtCloudConnectionServiceImpl: Trying www resource2: /www/denali/533F27FE530C7073486CCA45357C243D.gwt.rpc
2020-04-14T15:32:18,581 [qtp32158435-75] INFO  o.e.k.c.c.f.i.CamelCloudServiceFactory - Add: CamelCloudService
2020-04-14T15:32:18,588 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Creating new configuration for factory pid org.eclipse.kura.camel.cloud.factory.CamelFactory and pid CamelCloudService-CloudFactory
2020-04-14T15:32:18,589 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Updating newly created configuration for pid CamelCloudService-CloudFactory
2020-04-14T15:32:18,590 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Merging configuration for pid: org.eclipse.kura.camel.cloud.factory.CamelFactory
2020-04-14T15:32:18,614 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Registering ConfigurableComponent - CamelCloudService-CloudFactory....
2020-04-14T15:32:18,634 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Seeding updated configuration for pid: CamelCloudService-CloudFactory
2020-04-14T15:32:18,635 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Registering ConfigurableComponent - CamelCloudService-CloudFactory....Done
2020-04-14T15:32:18,635 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Writing snapshot - Getting component configurations...
2020-04-14T15:32:18,904 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Loading init configurations from: 1586874528243...
2020-04-14T15:32:19,093 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Writing snapshot - Saving /opt/eclipse/kura/user/snapshots/snapshot_1586874738994.xml...
2020-04-14T15:32:19,131 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Writing snapshot - Saving /opt/eclipse/kura/user/snapshots/snapshot_1586874738994.xml... Done.
2020-04-14T15:32:19,133 [qtp32158435-75] INFO  o.e.k.c.c.ConfigurationServiceImpl - Snapshots Garbage Collector. Deleted /opt/eclipse/kura/user/snapshots/snapshot_1586872698919.xml
2020-04-14T15:32:22,526 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Apache Camel 2.21.1 (CamelContext: camel-1) is starting
2020-04-14T15:32:22,537 [ConfigurationListener Event Queue] INFO  o.a.c.m.ManagedManagementStrategy - JMX is enabled
2020-04-14T15:32:23,210 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-04-14T15:32:23,267 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Total 0 routes, of which 0 are started
2020-04-14T15:32:23,270 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Apache Camel 2.21.1 (CamelContext: camel-1) started in 0.751 seconds
2020-04-14T15:40:56,357 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Loading init configurations from: 1586874738994...
2020-04-14T15:40:56,687 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Merging configuration for pid: org.eclipse.kura.camel.cloud.factory.CamelFactory
2020-04-14T15:40:56,720 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Updating Configuration of ConfigurableComponent CamelCloudService-CloudFactory ... Done.
2020-04-14T15:40:56,734 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Apache Camel 2.21.1 (CamelContext: camel-1) is shutting down
2020-04-14T15:40:56,939 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Writing snapshot - Saving /opt/eclipse/kura/user/snapshots/snapshot_1586875256721.xml...
2020-04-14T15:40:57,241 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Writing snapshot - Saving /opt/eclipse/kura/user/snapshots/snapshot_1586875256721.xml... Done.
2020-04-14T15:40:57,243 [qtp32158435-78] INFO  o.e.k.c.c.ConfigurationServiceImpl - Snapshots Garbage Collector. Deleted /opt/eclipse/kura/user/snapshots/snapshot_1586872759778.xml
2020-04-14T15:40:57,247 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Apache Camel 2.21.1 (CamelContext: camel-1) uptime 8 minutes
2020-04-14T15:40:57,248 [ConfigurationListener Event Queue] INFO  o.a.c.c.o.OsgiDefaultCamelContext - Apache Camel 2.21.1 (CamelContext: camel-1) is shutdown in 0.515 seconds
2020-04-14T15:40:59,628 [ConfigurationListener Event Queue] WARN  o.e.k.c.u.CamelContexts - Failed to run init code
javax.script.ScriptException: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.camel.component.milo.server.MiloServerComponent
        at org.eclipse.kura.camel.runner.ScriptRunner.runWithClassLoader(ScriptRunner.java:162)
        at org.eclipse.kura.camel.runner.ScriptRunner$EvalScriptRunner.run(ScriptRunner.java:62)
        at org.eclipse.kura.camel.utils.CamelContexts.scriptInitCamelContext(CamelContexts.java:64)
        at org.eclipse.kura.camel.cloud.factory.internal.XmlCamelCloudService.callInitCode(XmlCamelCloudService.java:142)
        at org.eclipse.kura.camel.cloud.factory.internal.XmlCamelCloudService.start(XmlCamelCloudService.java:93)
        at org.eclipse.kura.camel.cloud.factory.internal.CamelFactory.createService(CamelFactory.java:97)
        at org.eclipse.kura.camel.cloud.factory.internal.CamelFactory.setFromProperties(CamelFactory.java:58)
        at org.eclipse.kura.camel.cloud.factory.internal.CamelFactory.modified(CamelFactory.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229)
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650)
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506)
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:307)
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:299)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:772)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:727)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:645)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)
        at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:284)
        at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:89)
        at org.eclipse.equinox.internal.cm.EventDispatcher$1.run(EventDispatcher.java:89)
        at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.camel.component.milo.server.MiloServerComponent
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:397)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
        at org.eclipse.kura.camel.runner.ScriptRunner$EvalScriptRunner$2.call(ScriptRunner.java:66)
        at org.eclipse.kura.camel.runner.ScriptRunner.runWithClassLoader(ScriptRunner.java:158)
        ... 26 more
Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.milo.server.MiloServerComponent
        at jdk.nashorn.internal.runtime.NativeJavaPackage.classNotFound(NativeJavaPackage.java:162)
        at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:1)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
        ... 33 more

mstankovic avatar Apr 14 '20 14:04 mstankovic