[CONTROLLER-469] sal-netconf-connector fails when instantiated using currentconfig.xml Created: 14/May/14  Updated: 25/Jul/23  Resolved: 04/Jul/14

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Tomas Olvecky Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File controller.currentconfig.xml    
Issue Links:
Blocks
is blocked by CONTROLLER-465 configuration rendered invalid Resolved
External issue ID: 1004

 Description   

CONTROLLER-459 was fixed using workaround that gets DataProviderService from OSGi service registry. This works fine using initial config, but after controller.currentconfig.xml is created (e.g. empty commit), this is not guaranteed to work, because of ordering of module instantiation during config 2PC.

Use config's DI mechanism instead. Also check all other md-sal components that fish for dependencies using OSGi SR.



 Comments   
Comment by Tomas Olvecky [ 14/May/14 ]

Attachment controller.currentconfig.xml has been added with description: failing config

Comment by Tomas Olvecky [ 14/May/14 ]

trace:
Caused by: java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586) ~[org.eclipse.osgi-3.8.1.v20120830-144521.jar:na]
at org.opendaylight.controller.config.yang.md.sal.connector.netconf.NetconfConnectorModule.createInstance(NetconfConnectorModule.java:99) ~[na:na]
at org.opendaylight.controller.config.yang.md.sal.connector.netconf.AbstractNetconfConnectorModule.getInstance(AbstractNetconfConnectorModule.java:128) ~[na:na]
at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_55]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_55]
at org.opendaylight.controller.config.manager.impl.dependencyresolver.DependencyResolverManager$1.handleInvocation(DependencyResolverManager.java:144) ~[na:na]
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:70) ~[na:na]
at com.sun.proxy.$Proxy94.getInstance(Unknown Source) ~[na:na]
at org.opendaylight.controller.config.manager.impl.ConfigTransactionControllerImpl.secondPhaseCommit(ConfigTransactionControllerImpl.java:397) ~[na:na]

Comment by Maros Marsalek [ 15/May/14 ]

This is fixed in this commit proposal :
https://git.opendaylight.org/gerrit/#/c/6793/

The backwards compatibility is preserved in the commit. So if the service is not injected by config-subsystem, it is retrieved from the OSGi. Backwards compatibility will be removed later (https://bugs.opendaylight.org/show_bug.cgi?id=969).

Comment by Maros Marsalek [ 04/Jul/14 ]

Backwards compatibility was removed. This issue is therefore fixed.

Generated at Wed Feb 07 19:53:06 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.