[CONTROLLER-473] Invoking RPC from RESTConf Fails after new data store changes Created: 14/May/14  Updated: 19/May/14  Resolved: 19/May/14

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

Type: Bug
Reporter: Harman Singh Assignee: Tony Tkacik
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Attachments: Zip Archive mdsalApp.zip    
External issue ID: 1011

 Description   

Invoking RPC from RESTConf was working fine with older data store, but with new data store changes, its failing.

Invoking RPC from consumer is working fine though. I tried to debug the issue, Controller throws an illegal state exception at uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput) method inside BindingIndependentConnector.java at line 875. It tries to invoke mappingService.dataObjectFromDataDom(inputClass.get(), domInput), which calls RuntimeMappingModule.java's dataObjectFromDataDom method.

Above method calls YangTool's RunTimeGeneratedMappingServiceImpl.java class

Exception Stack trace is

2014-05-14 14:48:15 PDT [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/restconf].[JAXRSRestconf]] SEVERE org.apache.catalina.core.StandardWrapperValve invoke Servlet.service() for servlet [JAXRSRestconf] in context with path [/restconf] threw exception [java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to create data object] with root cause
java.lang.NullPointerException
at org.opendaylight.yangtools.yang.common.QName.<init>(QName.java:140)
at org.opendaylight.yangtools.yang.common.QName.create(QName.java:279)
at org.opendaylight.yangtools.sal.binding.generator.impl.BindingSchemaContextUtils.findDataNodeContainer(BindingSchemaContextUtils.java:61)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$LocationAwareDispatchCodec.adaptForPath(LazyGeneratedCodecRegistry.java:689)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.deserialize(LazyGeneratedCodecRegistry.java:1086)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.deserialize(LazyGeneratedCodecRegistry.java:1040)
at org.opendaylight.yang.gen.v1.opendaylight.sample.rev140407.saveentry.input.EntryField$Broker$Codec$DOM.fromDomStatic(EntryField$Broker$Codec$DOM.java)
at org.opendaylight.yang.gen.v1.opendaylight.sample.rev140407.SaveEntryInput$Broker$Codec$DOM.fromDomStatic(SaveEntryInput$Broker$Codec$DOM.java)
at org.opendaylight.yang.gen.v1.opendaylight.sample.rev140407.SaveEntryInput$Broker$Codec$DOM.deserialize(SaveEntryInput$Broker$Codec$DOM.java)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$DataContainerCodecImpl.deserialize(LazyGeneratedCodecRegistry.java:624)
at org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl.dataObjectFromDataDom(RuntimeGeneratedMappingServiceImpl.java:312)
at org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl.dataObjectFromDataDom(RuntimeGeneratedMappingServiceImpl.java:413)
at org.opendaylight.controller.config.yang.md.sal.binding.impl.RuntimeMappingModule$RuntimeGeneratedMappingServiceProxy.dataObjectFromDataDom(RuntimeMappingModule.java:162)
at org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector$NoOutputInvocationStrategy.uncheckedInvoke(BindingIndependentConnector.java:876)
at org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector$RpcInvocationStrategy.invokeOn(BindingIndependentConnector.java:781)



 Comments   
Comment by Tony Tkacik [ 15/May/14 ]

The regression you are facing is not related to data store.

From stack-trace it is obvious that you are trying to send / use augmented RPC,
could you provide more information about your model / which RPC you were trying to invoke?.

Comment by Harman Singh [ 15/May/14 ]

I have attached the zip file for your testing. Here are the steps you need to follow -

Unzip the attached file.
Go to directory model/target and copy mdsalApp-model-1.0.0.jar file to plugins folder of your controller distribution. This will load yang file in controller.
Go to directory provider/target and copy mdsalApp-provider-1.0.0.jar to controller distribution’s plugin folder. Provider has implementation of the RPC which fails from RESTConf.
Do the above mentioned similar steps for consumer, RPC call works fine from consumer.
Go to directory web/target and copy mdsalApp-web-1.0.0.jar to controller distribution’s plugin folder. Web use RESTConf to call RPC. Once copied, you can try to access using http://localhost:8080/controller/web/mdsalApp/view . You will see Add entry button on the UI. Click on Add Entry and fill title and description and press save button, This save button calls the RPC via REStConf and it fails. You can put debug points in controller to see point of failure.
Hope above information helps, Let me know if you need any further details.

Comment by Harman Singh [ 15/May/14 ]

Attachment mdsalApp.zip has been added with description: sample app to test RPC via REStConf

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