Consider defining a bean of type 'com.cumulocity.sdk.client.inventory.InventoryApi' in your configuration

What product/components do you use and which version/fix level?

Cumulocity sdk

Are you using a free trial or a product with a customer license?

customer license

What are trying to achieve? Please describe in detail.

I am trying to compile one of the softwareag’s project that accesses InventoryApi, MeasurementApi. the GIT project is cumulocity-microservice-templates / basic But when I use one of the projects ‘basic’ under that am getting the following error while running. I need help to make it running and see the MeasurementApi accesing the measurements and create measurements also.

Error while running the below



Parameter 0 of constructor in required a bean of type ‘com.cumulocity.sdk.client.inventory.InventoryApi’ that could not be found.


Consider defining a bean of type ‘com.cumulocity.sdk.client.inventory.InventoryApi’ in your configuration.

Do you get any error messages? Please provide a full error message screenshot and log file.

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2022-06-28 11:12:25.687 ERROR 2640 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :



Parameter 0 of constructor in required a bean of type ‘com.cumulocity.sdk.client.inventory.InventoryApi’ that could not be found.


Consider defining a bean of type ‘com.cumulocity.sdk.client.inventory.InventoryApi’ in your configuration.

Have you installed latest fixes for the products

Hi Sethu,

i tested the basic template in the main branch. It was working for me. Could you please tell me how you started the .jar file, i mean the java -jar … command. Did you really use the cumulocity-microservice-templates-basic-0.0.1-SNAPSHOT.jar ? The exceptions shows that the cumulocity SDK classes are not in the class path. I could maybe imagin that you started: cumulocity-microservice-templates-basic-0.0.1-SNAPSHOT.jar.original

How did you build the jar? Did it fail?

Best regards,

Hi Alexander,
Thanks for replying. I am compiling it using mvn clean install and running it using mvn spring-boot:run by adding a server port in the file. I am trying to access the end point in my local.
I have taken only the basic project out of the parent project cumulocity-microservice-templates and trying to compile and run it as i said above.

Could you tell me how did you start the application?

Are you able to access the end points defined in DeviceController and MeasurmentController in that case?

when i run mvn clean install its a succes, when i use mvn spring-boot:run it throws the error that i have given in my question initially.

P. Sethu pandia raja

What version of Java are you using?

Hi Robert
I tried with java 8 and 11 both

Did you edit the You have to add values to:

mvn spring-boot:run was also working on my env

i am using java 11 and maven 3.6.3

I took out the “basic” project alone from the main project. So I had to make the following changes in pom.xml and files. I have not done any other changes.
I have given and asked at some points in the properties file what needs to be filled. Kindly check below.

Trying to run mvn clean install - its buiding well. When I give mvn spring-boot:run it throws the error I have pasted at the last below.

pom.xml changes





Commented out the plugin section that creates the image. So I thought to run it in the local port 8082 as given in the properties file below. file changes

#Do not edit, version properties are set at build time

#Cumulocity configuration for running localy and connecting to cumulocity
C8Y.bootstrap.tenant= ??? what to be given for this

Error when the project is run with mvn spring-boot:run

[INFO] — spring-boot-maven-plugin:2.7.0:run (default-cli) @ cumulocity-microservice-templates —
[INFO] Attaching agents:
Exception in thread “main” java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.context.logging.LoggingApplicationListener
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(
at org.springframework.boot.SpringApplication.(
at org.springframework.boot.SpringApplication.(
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(
at java.base/
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(
at org.springframework.util.ClassUtils.forName(
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(
… 7 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.event.GenericApplicationListener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
… 20 more
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.458 s
[INFO] Finished at: 2022-06-28T17:56:48+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:run (default-cli) on project cumulocity-microservice-templates: Application finished with exit code: 1 → [Help 1]

Hey Sethu,
you need to set all missing properties in the properties file (C8Y.bootstrap.tenant, C8Y.bootstrap.user, C8Y.bootstrap.password) Tenant is an id of your tenant, you can find it in the Admin App by clicking on you email in the right upper corner. To get you bootstrap credentials, please refer to the documentation → Microservice SDK for Java - Cumulocity IoT Guides
You would need to either deploy your microservice or create an application entry before.

1 Like

It is important to follow the steps: cumulocity-microservice-templates/basic at main · SoftwareAG/cumulocity-microservice-templates · GitHub

Aquire the bootstrap information and add the values to properties:

Mapping from request to property:

“password”: “************************”, → C8Y.bootstrap.password
“name”: “servicebootstrap_templates-basic”, → C8Y.bootstrap.user
“tenant”: “” ->> C8Y.bootstrap.tenant

Hi Nick,
I understand. I will set all the required things right today and let you know if am able to run.


Yes Alex, I will sure try these today and inform you of the outcome may be tomorrow.


Hi Alex,
I made only the minor change in the MeasurementController - commented out //@RequestMapping(path = “/measurements”)

I followed the ReadMe in the GIT and I am able to build and run the basic application now. But I am trying to call the end points from post man as below. Kindly help me on how to call the end points locally.

I tried with http://localhost:8080/latest/deviceId - it said unauthorized

Then I tried with https://localhost:8080/latest/deviceId

  • selected the Basic Auth
  • passed the bootstrap user name and credentials

But the Devices list is getting listed as it is done by the scheduling in the DeviceService. But I am trying to access the measurements from postman.


  1. configured application key differs from registered application key as below
  2. java.lang.IllegalArgumentException: Invalid character found in method name

Please refer the error from console:

2022-06-29 09:40:50.257 INFO 25048 — [ main] o.s.boot.web.servlet.RegistrationBean : Filter preAuthenticateServletFilter was not registered (disabled)
2022-06-29 09:40:50.258 INFO 25048 — [ main] o.s.boot.web.servlet.RegistrationBean : Filter postAuthenticateServletFilter was not registered (disabled)
2022-06-29 09:40:50.460 INFO 25048 — [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [,,,,,,,,,,]
2022-06-29 09:40:50.552 INFO 25048 — [ main] c.c.m.s.TenantOptionPropertySource : Overriding application settings with tenant options is enabled.
2022-06-29 09:40:50.565 WARN 25048 — [ main] .m.s.s.i.MicroserviceSettingsServiceImpl : Loading tenant options using bootstrap credentials!
2022-06-29 09:40:52.687 INFO 25048 — [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path ‘’
2022-06-29 09:40:52.744 INFO 25048 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’
2022-06-29 09:40:52.758 INFO 25048 — [ main] .s.s.i.MicroserviceSubscriptionScheduler : Start; subscriptionDelay = 10000, subscriptionInitialDelay = 30000
2022-06-29 09:40:52.764 INFO 25048 — [ main] : Started App in 5.28 seconds (JVM running for 5.809)

2022-06-29 09:41:23.827 WARN 25048 — [subscriptions-0] .s.r.MicroserviceSubscriptionsRepository : Configured application key ‘’ differs from the registered application key: ‘sethu-test-service’. Updating configuration.

2022-06-29 09:41:02.429 INFO 25048 — [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xf70x010x000x000xf30x030x03P0x9d0xd50xb3l0xf20xce0xe90xcc0x950xc00xd20xb3gT0x110xd00x960xf50x100x970x0d0x970x070x9cp0x910x1160x090xc00x0e ]. HTTP method names must be tokens
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine( ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.coyote.http11.Http11Processor.service( ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.coyote.AbstractProcessorLight.process( ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( ~[tomcat-embed-core-9.0.63.jar!/:na]
at$SocketProcessor.doRun( ~[tomcat-embed-core-9.0.63.jar!/:na]
at ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker( ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$ ~[tomcat-embed-core-9.0.63.jar!/:na]
at org.apache.tomcat.util.threads.TaskThread$ ~[tomcat-embed-core-9.0.63.jar!/:na]
at java.base/ ~[na:na]