frontend_tuner_status doesn't work in Python FEI - redhawksdr

I'm using the Redhawk IDE 2.0.1 in Centos 6.5.
If I generate a Python based FEI, install, run, allocate, and then try to change the center_frequency via the Properties tab in the IDE I get the error:
Failed to update device property: Center Frequency
Error while executing callable. Caused by org.omg.CORBA.NO_IMPLEMENT: Server-side Exception: null vmcid: 0x41540000 minor code: 99 completed: No
Server-side Exception: null
I've tried to totally different systems and I get the same behavior.
If I do the same thing with the C++ project it works fine. Seems to me the auto generated Python code in 2.0.1 is broken like maybe it's not registering the listener? Any ideas are appreciated as this app will be much easier to implement in Python for me. Thanks

The error org.omg.CORBA.NO_IMPLEMENT: Server-side Exception is a CORBA exception indicating that the FEI device does not implement the setTunerCenterFrequency method, despite the FEI device having a DigitalTuner port. The DigitalTuner IDL inherits from the AnalogTuner IDL, which provides the setTunerCenterFrequency method. There must be a bug in the implementation of the FEI DigitalTuner port. In ${OSSIEHOME}/lib/python/frontend/input_ports.py, InDigitalTunerPort does not inherit from the InAnalogTunerPort, which is where the setCenterFrequency method lives. Changing it to the following should fix this issue:
class InDigitalTunerPort(FRONTEND__POA.DigitalTuner, InAnalogTunerPort):
def __init__(self, name, parent=digital_tuner_delegation()):
InAnalogTunerPort.__init__(self, name, parent)
There's a second issue as well. The generated base class instantiates the DigitalTuner port without passing in a reference to itself, the parent. The generated base class of your FEI Device should change from this:
self.port_DigitalTuner_in = frontend.InDigitalTunerPort("DigitalTuner_in")
to this:
self.port_DigitalTuner_in = frontend.InDigitalTunerPort("DigitalTuner_in", self)

Related

Mockito latest versions support to surpress static block

I am trying to add tests using latest (5.7.0) Mockito and using Mockito.mockStatic(...)
to mock class with static methods which works fine . However when I have class with static block it is unable to create mock and fais with java.lang.InternalError: class redefinition failed: invalid class .
Is this supported in latest mockito versions or still I have to live with other alternatives like powermock.
I did face the same error and couldn't find answer in the internet, so I see that it is 1 month old question but might help someone.
The problem was that mocked class (or classes that this static block used) was not in the classpath. Before you can mock the method all static blocks or fields initializators will be run, and it causes the problem.
You can verify what class is missing in your classpath by simply trying to use this static method before mocking it. You should get java.lang.NoClassDefFoundError with a class name.
When you resolve this problem, everything should work.
I had this issue, and for me it was due to an Error being thrown from instrumentation.retransformClasses called from org.mockito.internal.creation.bytebuddy.inlineBytecodeGenerator. Somewhere between there and findOrInsert in net.bytebuddy.TypeCache, the Throwable looses its context (for mockito-core 4.1.0 and bytebuddy 1.12.0)
In my case, the error being thrown was a NoClassDefFoundError for Jetty Servlet. This ultimately turned out to be a dodgy local build of a different maven module I had been working on, so clearing out my ~/.m2 and downloading a legit version fixed that right up.
You might be able to catch the Error being thrown in inlineBytecodeGenerator and taking a look at what's really going on, if this is in fact the same problem.

Groovy Grape dealing with dependency resolution

I am trying to use org.xhtmlrenderer:core-renderer:R8pre2 in a groovy script, but I get a Linkage error:
Caught: java.lang.LinkageError: loader constraint violation in interface
itable initialization: when resolving method
"org.apache.xerces.dom.NodeImpl.getOwnerDocument()Lorg/w3c/dom/Document;"
the class loader (instance of org/codehaus/groovy/tools/RootLoader) of the
current class, org/apache/xerces/dom/NodeImpl, and the class loader (instance of
<bootloader>) for interface org/w3c/dom/Node have different Class objects for
the type getOwnerDocument used in the signature
I've already googled a lot and found a lot of answer like these:
Dealing with "Xerces hell" in Java/Maven?
XercesImpl in conflict with JavaSE 6's internal xerces implementation. Both are needed... what can be done?
So, one solution could be to use javas endorsed mechanism to resolve the conflict, but I would like to make my script independent from such a "workaround". The script should run out of the box.
Next thing I was giving a try was to exclude the right dependency like this
#Grapes([
#Grab('org.xhtmlrenderer:core-renderer:R8pre2'),
#GrabExclude('xml-apis:xml-apis')
])
but didn't succeed...
Any ideas?
PS: here is the script which creates the error:
#Grapes([
#Grab('org.xhtmlrenderer:core-renderer:R8pre2'),
])
import org.w3c.dom.Document
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
def dbf = DocumentBuilderFactory.newInstance()
DocumentBuilder builder = dbf.newDocumentBuilder()
Document doc = builder.parse(new ByteArrayInputStream("<html></html>".getBytes()))
Thanx to #dmahapatro, I checked my configuration and found that I dropped some jars in {usrhome}/.groovy a long time ago. Removed these and now everything work like a charm...

Error calling method in java-class 'ClassA' 'org.my.ClassB' is incompatible with 'org.my.ClassB'

I have two classes org.my.ClassA and org.my.ClassB both classes are in the same package org.my in the WEB-INF/src in the same database.
ClassA has the method public add(org.my.ClassB newB){...}.
In SSJS I have a code block in which I call ClassA.add(ClassB) which normally works fine. Until some unknown point where the Server can't see that org.my.ClassB === org.my.ClassB and it returns the error (message translated from German maybe looks different in English version):
error calling method 'add(org.my.ClassB)' in java-class 'ClassA'.
'org.my.ClassB' is incompatible with 'org.my.ClassB'.
and it points to my line in the SSJS: ClassA.add(ClassB);
What I tried so far:
First I added the line importPackage(org.my); to my SSJS Code. No luck.
I tried to add another method add(Object newB) and then cast the object to ClassB but same result. The error does not seem to come from the java class its from the SSJS code because it cant find the method with an argument of the type org.my.ClassB. But if I test the object in the SSJS code it returns org.my.ClassB.
Then I tried to add the classpath to all variables in the SSJS block like: var newB:org.my.ClassB = new org.my.ClassB(). But same result after some time the application breaks with the same error.
From my Point of view it got to do something with the caching of compiled classes, or so because if I clear the database everything works just fine again.
Hope someone has a solution on this.
This is a class loader problem.
You can find more details about the issue in the answer from Frantisek Kossuth:
See here more details: Meaning of java.lang.ClassCastException: someClass incompatible with someClass

Media Foundation IMFMediaSource::CreatePresentationDescriptor invocation never ends

I'm triying to use Media Foundation to play mp3 file and I have a problem getting PresentationDesctiptor using CreatePresentationDescriptor method
What am I doing:
Start MF using MFStartup
Create session using MFCreateMediaSession
Create SourceResolver using MFCreateSourceResolver
Create MediaSource using CreateObjectFromURL from SourceResolver
Create topology using MFCreateTopology
Trying to create PresentationDescriptor using CreatePresentationDescriptor from MediaSource
When I call CreatePresentationDescriptor no error/exception occurs it just stands there and does nothing. When I pause Visual Strudio it indicates that program is still waiting for method to finish. What am I doing wrong ?
I did not metion that I use C# for this (did not think this was relevant)
The problem was that when importing com interfaces in C# you need to import all methods of interface not only those that are called. Some methods can call not imported methods and cause Access Violation that is not reported to Visual Strudio debugger and as a result it seems like method is never finished invokink.

how to bind Eclipse RCP Table View to other thread data

I have just started with Eclipse RCP.
I created Eclipse RCP View with TableViewer and WritableList to get data from other thread.
But I cannot see any changes. I need only to show content of List that other thread is managing.
public class View extends ViewPart {
private TableViewer viewer;
private WritableList input;
I also can get error,
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Getter called outside realm of observable org.eclipse.core.databinding.observable.list.WritableList
I know what is UI Thread. I just don't know how to write. Please help with example.
UPDATE. Was not solved, because of lack of time, and missing good and focused tutorial.
I received this error message also with my code.
Databinding observables (WritableList, WritableValue...) inherit from ChangeManager, which provides ChangeManager#getRealm and the realm has Realm#exec. Within the runnable provided to exec, the operation runs in the correct thread.
This line caused the error (Getter called outside realm of observable):
WritableValue value = getEditor().getWritableValue();
System.out.println(((RcpEditorModel) value.getValue()).getNumber());
And this prevented the exception:
WritableValue value = getEditor().getWritableValue();
value.getRealm().exec(() -> System.out.println(((RcpEditorModel) value.getValue()).getNumber()));
The same will work with WritableList since it also inherits from ChangeManager.

Resources