Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-19163

Camel-K "invalid memory address or nil pointer dereference" error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • camel-k-1.8
    • camel-k-1.6-GA
    • Camel-K
    • None

      Windows version:

      Windows 10 Version 20H2 (OS Build 19042.1645)

       

      JDK Version:

      C:\Users\nwxy3151\Downloads\java\hello-world>java -version
      openjdk version "11.0.14.1" 2022-02-08 LTS
      OpenJDK Runtime Environment Microsoft-31205 (build 11.0.14.1+1-LTS)
      OpenJDK 64-Bit Server VM Microsoft-31205 (build 11.0.14.1+1-LTS, mixed mode) 

       

       

      Camel-K version:

      C:\Users\nwxy3151\Downloads\java\hello-world>kamel version
      Camel K Client Red Hat 1.6.6

       

       

      Error stack trace:

      C:\Users\test-user\Downloads\java\hello-world>kamel local run Basic.java
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal 0xc0000005 code=0x0 addr=0x78 pc=0x22ba0b9]
      
      goroutine 1 [running]:
      github.com/apache/camel-k/pkg/util/camel.(*RuntimeCatalog).GetScheme(...)
              github.com/apache/camel-k/pkg/util/camel/camel_runtime_catalog.go:116
      github.com/apache/camel-k/pkg/util/camel.(*RuntimeCatalog).DecodeComponent(0x0, 0xc000838247, 0x16, 0x0, 0xffffffffffffffff)
              github.com/apache/camel-k/pkg/util/camel/camel_runtime_catalog.go:157 +0xf9
      github.com/apache/camel-k/pkg/util/source.(*baseInspector).discoverDependencies(0xc000563098, 0xc000046120, 0xa, 0x0, 0x0, 0xc0008381a0, 0x182, 0x0, 0x0, 0x0, ...)
              github.com/apache/camel-k/pkg/util/source/inspector.go:242 +0xa6
      github.com/apache/camel-k/pkg/util/source.JavaSourceInspector.Extract(0x0, 0xc000046120, 0xa, 0x0, 0x0, 0xc0008381a0, 0x182, 0x0, 0x0, 0x0, ...)
              github.com/apache/camel-k/pkg/util/source/inspector_java_source.go:55 +0x489
      github.com/apache/camel-k/pkg/metadata.Extract(0x0, 0xc000046120, 0xa, 0x0, 0x0, 0xc0008381a0, 0x182, 0x0, 0x0, 0x0, ...)
              github.com/apache/camel-k/pkg/metadata/metadata.go:78 +0x1ab
      github.com/apache/camel-k/pkg/trait.AddSourceDependencies(0xc000046120, 0xa, 0x0, 0x0, 0xc0008381a0, 0x182, 0x0, 0x0, 0x0, 0x0, ...)
              github.com/apache/camel-k/pkg/trait/util.go:196 +0xf8
      github.com/apache/camel-k/pkg/cmd.getTopLevelDependencies(0x0, 0xc000a06d70, 0x1, 0x1, 0xc0003be000, 0xc000060000, 0xc000056000, 0xc000adba38, 0x9748d1)
              github.com/apache/camel-k/pkg/cmd/util_dependencies.go:99 +0x20b
      github.com/apache/camel-k/pkg/cmd.getDependencies(0x2e59c80, 0xc0009ef600, 0xc000a06d70, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
              github.com/apache/camel-k/pkg/cmd/util_dependencies.go:51 +0x9c
      github.com/apache/camel-k/pkg/cmd.(*localRunCmdOptions).run(0xc0007e5bc0, 0xc000991900, 0xc000a06d70, 0x1, 0x1, 0x0, 0x23a1a40)
              github.com/apache/camel-k/pkg/cmd/local_run.go:158 +0x8d5
      github.com/apache/camel-k/pkg/cmd.newCmdLocalRun.func1(0xc000991900, 0xc000a06d70, 0x1, 0x1, 0x0, 0x0)
              github.com/apache/camel-k/pkg/cmd/local_run.go:46 +0xc8
      github.com/spf13/cobra.(*Command).execute(0xc000991900, 0xc000a06d40, 0x1, 0x1, 0xc000991900, 0xc000a06d40)
              github.com/spf13/cobra@v1.1.3/command.go:852 +0x47c
      github.com/spf13/cobra.(*Command).ExecuteC(0xc00094b900, 0xc0006c0fc0, 0xc000076040, 0x4)
              github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
      github.com/spf13/cobra.(*Command).Execute(...)
              github.com/spf13/cobra@v1.1.3/command.go:897
      main.main()
              github.com/apache/camel-k/cmd/kamel/main.go:47 +0x18c 

       

      Contents of the Basic.java file:

      import org.apache.camel.builder.RouteBuilder;
      
      public class Basic extends RouteBuilder {
      
        @Override
        public void configure() throws Exception {
      
            from("timer:java?period=1000")
              .setHeader("example")
                .constant("Java")
              .setBody()
                .simple("Hello World! Camel K route written in ${header.example}.")
              .to("log:info");
        }
      }

       

            rhn-support-tasato Tadayoshi Sato
            Asouza@redhat.com Angelo Souza
            Mario Majernik Mario Majernik
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: