Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating configuration without a file generate warning #2142

Closed
jvermillard opened this issue Jun 16, 2023 · 4 comments
Closed

creating configuration without a file generate warning #2142

jvermillard opened this issue Jun 16, 2023 · 4 comments

Comments

@jvermillard
Copy link
Contributor

jvermillard commented Jun 16, 2023

If you create a configuration (Cf v3.8) using:

var cfg = Configuration.getStandard();
cfg.set(CoapConfig.MAX_RESOURCE_BODY_SIZE, 200_000);
...

It works but you have these properties files

Now if you try to do it without the file:

 var cfg = Configuration.createWithoutFile();
 cfg.set(CoapConfig.MAX_RESOURCE_BODY_SIZE, 200_000);

It generates warnings:

09:31:49.813 [DefaultDispatcher-worker-23] WARN  o.e.c.elements.config.Configuration {} - Configuration contains no modules, no definitions, and no values!
java.lang.Throwable: stacktrace
	at org.eclipse.californium.elements.config.Configuration.<init>(Configuration.java:502)
	at org.eclipse.californium.elements.config.Configuration.createStandardWithoutFile(Configuration.java:390)

From what I read I the configuration framework doc it should work,and it works, there is just an annoying warning stacktrace

@boaks
Copy link
Contributor

boaks commented Jun 16, 2023

I will have a look on it.

@boaks
Copy link
Contributor

boaks commented Jun 16, 2023

From what I read I the configuration framework doc it should work,and it works, there is just an annoying warning stacktrace

I guess, you didn't consider to register the modules, you want to use, see Configuration - Modules

@boaks
Copy link
Contributor

boaks commented Jun 16, 2023

If you want to use it without prior registering modules, for what ever reasons and what ever the consequences will be, we can add a method to disable this warning. I added it with the stacktrace, because to one or other, which used a framework without deep understanding of that framework, had trouble to know the execution order of that framework. With that stacktrace it get's clear, where the configuration is called first and if the modules are already registered as expected.

@boaks
Copy link
Contributor

boaks commented Jun 20, 2023

Fixes, see PR #2146

@boaks boaks closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants