[NETCONF-967] YangLib: Unable to get schema SourceIdentifier Created: 14/Feb/23 Updated: 17/Aug/23 |
|
| Status: | Confirmed |
| Project: | netconf |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Ivan Hrasko | Assignee: | Ivan Hrasko |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pick-next, pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
The requests fails with the error (see karaf.log). After restart the requests succeeds. |
| Comments |
| Comment by Ivan Hrasko [ 15/Feb/23 ] |
|
The problem is that YangLibProvider#schemaSourceRegistered() method is invoked only when:
schemaListenerRegistration = schemaRepository.registerSchemaSourceListener(this);
is invoked. Currently this happens in init() method. We can solve the issue similar way how its done in DefaultSchemaResourceManager#getSchemaResources() where repository, listeners, etc. are registered on demand. |
| Comment by Ivan Hrasko [ 15/Feb/23 ] |
|
Possible there are other problems:
|
| Comment by Ruslan Kashapov [ 16/Aug/23 ] |
schemaRepository = new SharedSchemaRepository("yang-library", parserFactory); final var cache = new FilesystemSchemaSourceCache<>(schemaRepository, YangTextSchemaSource.class, cacheFolderFile); schemaRepository.registerSchemaSourceListener(cache); schemaListenerRegistration = schemaRepository.registerSchemaSourceListener(this);
|