Java error: Context already contains a binding with name "" - java

Ok so I have followed this tutorial step by step: Custom Java Desktop Database Application
I can't understand what I'm doing wrong but when I run the application and click on "New Customer" i get the following error:
Caused by: java.lang.IllegalArgumentException: Context already contains a binding with name ""
I believe that it has something to do with the combobox which is binded with the countries list which comes from the database. The binding expression is set to null and binding source is set to countriesList.
Any help would be appreciated guys?
Thanks

SOLVED
When binding elements of the combo box, in the advanced tab, I just set the name to "null"..and it started working.

while giving "null" into Identification's name works, it only works for the second occurance, you may not repeat the "null" string as the name for the third or any other occurances.
Because,
actually the only one we need to remember is, the name needs to be unique. That's all :)

It seems something was changed in Netbeans. The bindings don't need a name, but for some reason Netbeans started adding "" as the name of many bindings. My solution has been to open the .java file in another editor and just removing the last , "" in the createAutoBinding method call.

Related

Getting error Field UCLASS is not a member of BAPIUCLASS while updating through JCO

I am trying to update UCLASS field value using "BAPI_USER_CHANGE" through JCO, but getting below error:
com.sap.conn.jco.JCoRuntimeException: Field UCLASS is not a member of BAPIUCLASS
Here is my code to set the value:
JCoStructure license = params.getStructure("UCLASS");
license.setValue("UCLASS", changes.get(0).getCurrent());
JCoStructure licenseX = params.getStructure("UCLASSX");
licenseX.setValue("UCLASS", 'X');
Can you please tell me this comes under which Structure? tried also with "LOGONDATA" and "ADDRESS".
Logon with a SAP GUI and use transaction SE37 to display the parameters and structures of the RFM BAPI_USER_CHANGE.
The ABAP workbench offers forward navigation. So if you would like to see how this UCLASS structure looks like, go to the Import tab of the RFM BAPI_USER_CHANGE and double-click on the Associated Type BAPIUCLASS.
You are correctly getting the error message because there is no field with name UCLASS in the RFM parameter UCLASS (which is a JCoStructure).
Instead of this, license.setValue("LIC_TYPE", "XY"); would be valid here, for example.
If you want to set another structure as a whole, you would have to use
params.setValue("UCLASS", myJCoStructure);.

Why this particular code generates "ambiguous method call" error in Android Studio?

I use iText 5 in Android Studio to create a PDF document but I get an error:
I also tried
p.add((Phrase)c);
but I get same error :-(
How I can get rid of this error?
"ambiguous" error comes up when u already have a file/varibale etc with same name.
for example when you make a project using entity framework , entity framework make class and dbcontext files for u. but if u add a class with same name as entity framework had made for u then this error comes up. check ur project/programe correctly and fully again...
Hope its helpfull !!
and checkout this link for ur answer Android Studio - Ambiguous method call getClass()
thanks for reply - indeed I needed help regarding why 'ambiguous' appears in this context.
But now the problem is solved - this error does not appear anymore - but I don't know exactly why.
I did some Android Studio updates last week may this helped?
Thanks anyway!
In case when we use data binding, some java files are auto-generated
The problem was occured when a getter/setter has the same name with a function.
eg
var newData
fun getNewData()
in this case, in the generated java file, the variable's getter has the same name with the function => getNewData.
So simply you have to change variable name or fuction name

Appium driver to get app package name programmatically

I am using:
appiumDriver.findElement(By.id("com.XXX.keyword:id/nextButton"));
but sometimes we have debug version, so we have something like "com.XXX.keyword.debug". So I want to get package name before test runs so the tests can be independent on this.
I tried
driver.currentActivity()
but it only returned something like ".MainActivity"
Is there any way to get package name with Appium?
Thanks a lot.
You don't need package name to locate elements. Simply copy paste id without package name . eg in your case use only 'nextButton' instead of 'com.XXX.keyword:id/nextButton'
To get the current package name use following method:
driver.getCurrentPackage();
The following statement you are using will give you Activity Name.
driver.currentActivity();

in java how can i reference the instance define in a nested bxml's "bxml:id..."

i'm new to apache pivot. recently i'm working under Eclipse, using this Pivot and Java prog for etablishing a IHM for a stand alone application.
i encounter a problem here,
i defined a "main " bxml tabPane.bxml,
inside it i use a nested bxml and "include" in the code,
bxml:include bxml:id="shipPanel" src="shipping.bxml" Accordion.headerData="params"/>
then in the shipping.bxml code, i declare
<PushButton bxml:id="nextButton" xxxxx
now i want to use the instance nextButton in my java code,
i did this as before to by getting the namespace nextButton:
nextButton = (PushButton)namespace.get("nextButton");
but when i run the prog, it come always this error:
java.lang.NullPointerException
seems it didn't recognize the nextButton.
Then i did a test, i declare a PushButton in the main bxml, named it id = nextButton, this case, it compile well .
so my question is, when my instance defined in a nested bxml(using include in main bxml), how can i reference it later in java code ?
any body can help? Thank you!!
Well so i got the solution from its mailing list forum of pivot.
in fact, it suffit of adding a sentence " inline = "true" " in the attribut of the spot where you include the nested bxml file. in this way, in java it can recognize all those id you have defined in both main bxml code or nested bxml code.
thanks those experts from the pivot mailing list forum who have given good advices.
finish!!!

Url Encoding problem in Java and Solr

I am working in Solr and making some filter quires. One of my filter is consists of a space
for eg:- "fq=listing_type:New home"
But this is giving error. No result is comming out.
I also tried "fq=Listing_type:New+home"
This was not giving error. But no results are comming out. Event there is some xml which have thse values.
Can anyone tell me where is my error?
Here you see the schema.xml
Have you tried with fq=listing_type:"New home" ??? Why dont you index this field as "NewHome" ?

Categories

Resources