[NETCONF-77] netconf-testtool NullPointerException - Looks like another yang breakage Created: 06/Oct/15  Updated: 15/Mar/19  Resolved: 12/Oct/15

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: James Gregory Hall Assignee: Jakub Morvay
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 4425

 Description   

Build netconf from latest master branch.

cd netconf/opendaylight/netconf/tools/netconf-testtool/target
java -Xmx1G -XX:MaxPermSize=256M -jar netconf-testtool-1.0.0-SNAPSHOT-executable.jar --device-count 1

See exception below:

It appears that something has changed in class YangParserListenerImpl such that the "create()" method doesn't set moduleBuilder ... which is causing this Null reference later.

11:02:14.177 [main] ERROR o.o.netconf.test.tool.Main - Unhandled exception
java.lang.NullPointerException: null
at org.opendaylight.netconf.test.tool.ModuleBuilderCapability.getModuleNamespace(ModuleBuilderCapability.java:39) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.ModuleBuilderCapability.getCapabilityUri(ModuleBuilderCapability.java:33) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.DummyMonitoringService$1.apply(DummyMonitoringService.java:45) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.DummyMonitoringService$1.apply(DummyMonitoringService.java:41) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at com.google.common.collect.Iterators$8.transform(Iterators.java:799) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at java.util.AbstractCollection.toArray(AbstractCollection.java:141) ~[na:1.7.0_79]
at java.util.ArrayList.<init>(ArrayList.java:164) ~[na:1.7.0_79]
at com.google.common.collect.Lists.newArrayList(Lists.java:144) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.DummyMonitoringService.<init>(DummyMonitoringService.java:69) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.createDispatcher(NetconfDeviceSimulator.java:140) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.start(NetconfDeviceSimulator.java:192) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]
at org.opendaylight.netconf.test.tool.Main.main(Main.java:193) ~[netconf-testtool-1.0.0-SNAPSHOT-executable.jar:na]



 Comments   
Comment by Tony Tkacik [ 07/Oct/15 ]

YangParserListenerImpl is not used in migrated YANG Parser.

Comment by Ryan Goulding [ 07/Oct/15 ]

It still appears to be used in the NetconfDeviceSimulator.toModuleBuilders() function. Was this missed in the migrated Yang parser migration?

Comment by Ambika Prasad Tripathy [ 12/Oct/15 ]

Case -2: When using --schemas-dir ./yang/ flag also getting error link below:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256; support was removed in 8.0
01:39:39.989 [main] INFO o.o.n.t.tool.NetconfDeviceSimulator - Starting 1, SSH simulated devices starting on port 17830
Oct 12, 2015 1:39:40 AM com.google.common.util.concurrent.Futures$CombinedFuture setExceptionAndMaybeLog
SEVERE: input future failed.
org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: All available providers exhausted
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository$1.create(AbstractSchemaRepository.java:83)
at com.google.common.util.concurrent.Futures$FallbackFuture$1.onFailure(Futures.java:471)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1310)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:101)
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:170)
at com.google.common.util.concurrent.ForwardingListenableFuture.addListener(ForwardingListenableFuture.java:47)
at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1322)
at com.google.common.util.concurrent.Futures$FallbackFuture.<init>(Futures.java:459)
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:444)
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:379)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:74)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.getSchemaSource(AbstractSchemaRepository.java:105)
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory$1.apply(SharedSchemaContextFactory.java:59)
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory$1.apply(SharedSchemaContextFactory.java:56)
at com.google.common.collect.Iterators$8.transform(Iterators.java:799)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:258)
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226)
at com.google.common.util.concurrent.Futures.allAsList(Futures.java:1027)
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory.createSchemaContext(SharedSchemaContextFactory.java:128)
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.parseSchemasToModuleCapabilities(NetconfDeviceSimulator.java:291)
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.start(NetconfDeviceSimulator.java:150)
at org.opendaylight.netconf.test.tool.Main.main(Main.java:193)
Caused by: org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: All available providers exhausted
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository$1.create(AbstractSchemaRepository.java:83)
at com.google.common.util.concurrent.Futures$FallbackFuture$1.onFailure(Futures.java:471)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1310)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.Futures$ImmediateFuture.addListener(Futures.java:106)
at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1322)
at com.google.common.util.concurrent.Futures$FallbackFuture.<init>(Futures.java:459)
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:444)
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:379)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:74)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.getSchemaSource(AbstractSchemaRepository.java:105)
at org.opendaylight.yangtools.yang.model.repo.util.SchemaSourceTransformer.getSource(SchemaSourceTransformer.java:56)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:72)
... 13 more
Caused by: org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: Source not found
at org.opendaylight.yangtools.yang.model.repo.util.FilesystemSchemaSourceCache.getSource(FilesystemSchemaSourceCache.java:127)
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:72)
... 16 more

01:39:40.583 [main] ERROR o.o.netconf.test.tool.Main - Unhandled exception
java.lang.RuntimeException: Cannot parse schema context
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.parseSchemasToModuleCapabilities(NetconfDeviceSimulator.java:295) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.start(NetconfDeviceSimulator.java:150) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.netconf.test.tool.Main.main(Main.java:193) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
Caused by: org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException: resolve sources execution failed, resolved sources: [], unsatisfied imports: {}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_60]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_60]
at org.opendaylight.yangtools.util.concurrent.ReflectiveExceptionMapper.newWithCause(ReflectiveExceptionMapper.java:31) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.util.concurrent.ExceptionMapper.apply(ExceptionMapper.java:80) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.util.concurrent.ExceptionMapper.apply(ExceptionMapper.java:31) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$MappingCheckedFuture.mapException(Futures.java:1809) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.AbstractCheckedFuture.checkedGet(AbstractCheckedFuture.java:85) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.netconf.test.tool.NetconfDeviceSimulator.parseSchemasToModuleCapabilities(NetconfDeviceSimulator.java:291) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
... 2 common frames omitted
Caused by: org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: All available providers exhausted
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository$1.create(AbstractSchemaRepository.java:83) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$FallbackFuture$1.onFailure(Futures.java:471) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1310) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:101) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:170) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.ForwardingListenableFuture.addListener(ForwardingListenableFuture.java:47) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1322) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$FallbackFuture.<init>(Futures.java:459) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:444) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:379) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:74) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.getSchemaSource(AbstractSchemaRepository.java:105) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory$1.apply(SharedSchemaContextFactory.java:59) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory$1.apply(SharedSchemaContextFactory.java:56) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.collect.Iterators$8.transform(Iterators.java:799) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at java.util.AbstractCollection.toArray(AbstractCollection.java:141) ~[na:1.8.0_60]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:258) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.allAsList(Futures.java:1027) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.parser.repo.SharedSchemaContextFactory.createSchemaContext(SharedSchemaContextFactory.java:128) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
... 3 common frames omitted
Caused by: org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: All available providers exhausted
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository$1.create(AbstractSchemaRepository.java:83) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$FallbackFuture$1.onFailure(Futures.java:471) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1310) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$ImmediateFuture.addListener(Futures.java:106) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1322) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures$FallbackFuture.<init>(Futures.java:459) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:444) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at com.google.common.util.concurrent.Futures.withFallback(Futures.java:379) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:74) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.getSchemaSource(AbstractSchemaRepository.java:105) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.SchemaSourceTransformer.getSource(SchemaSourceTransformer.java:56) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:72) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
... 13 common frames omitted
Caused by: org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException: Source not found
at org.opendaylight.yangtools.yang.model.repo.util.FilesystemSchemaSourceCache.getSource(FilesystemSchemaSourceCache.java:127) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
at org.opendaylight.yangtools.yang.model.repo.util.AbstractSchemaRepository.fetchSource(AbstractSchemaRepository.java:72) ~[netconf-testtool-1.0.0-20151009.152506-49-executable.jar:na]
... 16 common frames omitted

Generated at Wed Feb 07 20:14:07 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.