Thursday, 3 October 2013

java.lang.NoSuchMethodException: Unknown property

java.lang.NoSuchMethodException: Unknown property

following is my pojo :
package anto.com.poc;
public class VerifyPaymentRO {
private String mihpayid;
private String request_id;
private String bank_ref_num;
private String amt;
private String disc;
private String mode;
private String PG_TYPE;
private String card_no;
private String name_on_card;
private String udf2;
private String addedon;
private String status;
private String unmappedstatus;
private String Merchant_UTR;
private String Settled_At;
public String getMihpayid() {
return mihpayid;
}
public void setMihpayid(String mihpayid) {
this.mihpayid = mihpayid;
}
public String getRequest_id() {
return request_id;
}
public void setRequest_id(String request_id) {
this.request_id = request_id;
}
public String getBank_ref_num() {
return bank_ref_num;
}
public void setBank_ref_num(String bank_ref_num) {
this.bank_ref_num = bank_ref_num;
}
public String getAmt() {
return amt;
}
public void setAmt(String amt) {
this.amt = amt;
}
public String getDisc() {
return disc;
}
public void setDisc(String disc) {
this.disc = disc;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public String getPG_TYPE() {
return PG_TYPE;
}
public void setPG_TYPE(String pG_TYPE) {
PG_TYPE = pG_TYPE;
}
public String getCard_no() {
return card_no;
}
public void setCard_no(String card_no) {
this.card_no = card_no;
}
public String getName_on_card() {
return name_on_card;
}
public void setName_on_card(String name_on_card) {
this.name_on_card = name_on_card;
}
public String getUdf2() {
return udf2;
}
public void setUdf2(String udf2) {
this.udf2 = udf2;
}
public String getAddedon() {
return addedon;
}
public void setAddedon(String addedon) {
this.addedon = addedon;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUnmappedstatus() {
return unmappedstatus;
}
public void setUnmappedstatus(String unmappedstatus) {
this.unmappedstatus = unmappedstatus;
}
public String getMerchant_UTR() {
return Merchant_UTR;
}
public void setMerchant_UTR(String merchant_UTR) {
Merchant_UTR = merchant_UTR;
}
public String getSettled_At() {
return Settled_At;
}
public void setSettled_At(String settled_At) {
Settled_At = settled_At;
}
}
and I am trying to set values at run time like the following :
static public VerifyPaymentRO convertToVerifyPaymentPOJO(String
verifyPaymentInfo) {
VerifyPaymentRO verifyPaymentRO = new VerifyPaymentRO();
String[] verifyPaymentComma=null;
String[] verifyPayment=null;
String value="";
verifyPaymentComma = verifyPaymentInfo.trim().split(",");
for (String verifyPaymentCommaSeparated : verifyPaymentComma) {
verifyPayment = verifyPaymentCommaSeparated.trim().split("=");
if(verifyPayment.length==2){
value=verifyPayment[1];
}else{
value="";
}
try {
if(verifyPayment[0].trim().equals("mihpayid"))
PropertyUtils.setProperty(verifyPaymentRO,
"mihpayid", value.trim());
if(verifyPayment[0].trim().equals("request_id"))
PropertyUtils.setProperty(verifyPaymentRO,
"request_id", value.trim());
if(verifyPayment[0].trim().equals("bank_ref_num"))
PropertyUtils.setProperty(verifyPaymentRO,
"bank_ref_num", value.trim());
if(verifyPayment[0].trim().equals("amt"))
PropertyUtils.setProperty(verifyPaymentRO, "amt",
value.trim());
if(verifyPayment[0].trim().equals("disc"))
PropertyUtils.setProperty(verifyPaymentRO, "disc",
value.trim());
if(verifyPayment[0].trim().equals("mode"))
PropertyUtils.setProperty(verifyPaymentRO, "mode",
value.trim());
if(verifyPayment[0].trim().equals("PG_TYPE"))
PropertyUtils.setProperty(verifyPaymentRO, "PG_TYPE",
value.trim());
if(verifyPayment[0].trim().equals("card_no"))
PropertyUtils.setProperty(verifyPaymentRO, "card_no",
value.trim());
if(verifyPayment[0].trim().equals("name_on_card"))
PropertyUtils.setProperty(verifyPaymentRO,
"name_on_card", value.trim());
if(verifyPayment[0].trim().equals("udf2"))
PropertyUtils.setProperty(verifyPaymentRO, "udf2",
value.trim());
if(verifyPayment[0].trim().equals("addedon"))
PropertyUtils.setProperty(verifyPaymentRO, "addedon",
value.trim());
if(verifyPayment[0].trim().equals("status"))
PropertyUtils.setProperty(verifyPaymentRO, "status",
value.trim());
if(verifyPayment[0].trim().equals("unmappedstatus"))
PropertyUtils.setProperty(verifyPaymentRO,
"unmappedstatus", value.trim());
if(verifyPayment[0].trim().equals("unmappedstatus"))
PropertyUtils.setProperty(verifyPaymentRO,
"unmappedstatus", value.trim());
if(verifyPayment[0].trim().equals("Merchant_UTR"))
PropertyUtils.setProperty(verifyPaymentRO,
"Merchant_UTR", value.trim());
if(verifyPayment[0].trim().equals("Settled_At"))
PropertyUtils.setProperty(verifyPaymentRO,
"Settled_At", value.trim());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
}
return verifyPaymentRO;
}
everything works fine but for the last two properties I get the following
exception :
1. java.lang.NoSuchMethodException: Unknown property 'Merchant_UTR' on
class 'class anto.com.poc.VerifyPaymentRO'
2. java.lang.NoSuchMethodException: Unknown property 'Settled_At' on class
'class anto.com.poc.VerifyPaymentRO'
but these two fields are available and I get the above exception only for
the above two fields and rest are working fine.
so what could cause the issue?
thanks

Wednesday, 2 October 2013

Difference between using .ipp extension and .cpp extension files

Difference between using .ipp extension and .cpp extension files

Suppose I have 2 header files, 1 .ipp extension file and a main.cpp file:
First header file(like interface in Java):
template<class T>
class myClass1{
public:
virtual int size() = 0;
};
second header file:
#include "myClass1.h"
template<class T>
class myClass2 : public myClass1<T>
public:
{
virtual int size();
private:
int numItems;
};
#include "myClass2.ipp"
And then is my myClass2.ipp file:
template <class T>
int myClass2<T>::size()
{
return numItems;
}
Last one is my main:
#include "myclass2.h"
void tester()
{
myClass2<int> ForTesting;
if(ForTesting.size() == 0)
{
//......
}
else
{
//.....
}
}
int main(){
tester();
return 0;
}
myClass1, myClass2 and myClass2.ipp belong to header file. main.cpp in
source file. What's the advantages by using this way to implement your
program instead of using just .h and .cpp files? And what is .ipp
extension file? The difference between .ipp and .cpp?

Disable rotation on a UISnapBehavior?

Disable rotation on a UISnapBehavior?

I like that UIKitDynamics snippet, but I really want to use it to slide in
one direction only with a slight oscillation.
Is there a way to turn off rotation for this behavior? As SpriteKit has
allowsRotation property which can be easily turned off.

Resquest MongoDB with scala

Resquest MongoDB with scala

I want to do an application in scala, with a MongoDB database. I found
some tutorials to use it with ReactiveMongo, I wrote my classes, but I
want to test it and I don't understand how to do a simple request ; to add
a user for example, or find him...
What is the right method to use ?

Tuesday, 1 October 2013

How to trigger an event before a cookie is read?

How to trigger an event before a cookie is read?

i'm currently developing a model firefox addon which can enable a user to
have separate cookies for every tab. Here is what i'm planning to do:
1)tag the tab using a unique number (say Xtab)
2)all the cookies created in a particular tab are prefixed with the tag
(i.e. Xtab)
3)when the site that the user is browser tries to read the cookie, my
firefox addon will deliver the tagged cookie.
The tab can be tagged using setTabValue. Cookie creation can be monitored
using a observer service as described here My question is, is there an
event/listener which trigger before a cookie is read?

ServiceStack creates WSDLs? I thought WSDL was for non REST

ServiceStack creates WSDLs? I thought WSDL was for non REST

I'm so confused here on having a RESTful API where you expose a list of
Uri Templates to a consumer and then why ServiceSTack would also create a
WSDL. Isn't WSDL for non RESTful APIs?

Are Spell-Like Abilities actually Spells=?iso-8859-1?Q?=3F_=96_rpg.stackexchange.com?=

Are Spell-Like Abilities actually Spells? – rpg.stackexchange.com

An interesting point of contention surrounding the definition of a
spell-like ability arose whilst answering this question. Are spell-like
abilities actually spells? The question mentioned a Flail …

A formula to compute the lovasz number

A formula to compute the lovasz number

As Wikipedia says:
The Lovász number $\vartheta$ of graph $G$ is defined as follows:
$$\vartheta(G) = \min\limits_{c, U} \max\limits_{i \in V}
\frac{1}{(c^\mathrm{T} u_i)^2},$$ where $c$ is a unit vector in $R^N$ and
$U$ is an orthonormal representation of $G$ in $R^N$. Here minimization
implicitly is performed also over the dimension $N$, however without loss
of generality it suffices to consider $N = n$.
Does it suffice to consider the minimal allowed $N$ in the above formula?