Re: Struts missing parameters

2014-08-21 Thread Luis Limas

On 20/08/2014 02:21 p. m., Lukasz Lenart wrote:

2014-08-09 4:22 GMT+02:00 Luis Limas luiscl...@hotmail.com:

On 08/08/2014 02:24 p. m., Lukasz Lenart wrote:

2014-08-08 17:38 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks again for the reply Lukasz, you misunderstood me, im not doing
serialize/deserialize my entities for any logic, the deserialize
instruction
is being called inside struts (Project: Struts 2 JSON Plugin,
JSONInterceptor.java : 123) when parsing JSON to Map (before calling the
setters inside JSONReader) and then to Object,  i mentioned the
deserialize
thing because there is where it seems to me that setters are not being
called. The serialize instruction i only use it for debuging purposes so
i
was able to see how it looks the populated (final) object,

Yes I know, but you're exposing Hibernate entity directly not some VO
- it always will be an issue, as you can see [1], JSONWriter already
contains some logic to detect Hibernate bean, but JSONReader can't do
that.


The issue seems to be that JSONWriter is not working propely. Also im not
sure to understand what do you mean with there's no way to do the
opposite, isn't JSONReader doing that?

...create proper Hibernate entity from JSON - only Hibernate can do
that and creating entities by hand can cause some problems like your.

To clarify few things:
- JSONWriter serializes an object to JSON (writes to request)
- JSONRead deserializes JSON into an object (reads from request)

As I understand you have problem with converting JSON into an object?
So in that case JSONReader and JSONPopulator are involved.

[1]
https://github.com/apache/struts/blob/aa744b811f9c41b80cc30ad6cf41ccaa75da5323/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java#L290-L312


Regards

My problem is that struts calls JSONReader when using SMDMethod=true to
convert JSON to Object. And so on, JSONReader fails to do the conversion.

This is an example of SMDMethod im calling

@SMDMethod
public String mySMDMethod(Request obj /*I showed Request.java at previews
mail */) {
 if(obj.getId() == null) {
 System.out.println(Unexpected behavior, actually the JSON sended
from client was {id:99}. Somehow struts didn't managed to populate );
 }
 //logic stuff...
 return succesfull example;
}

At client side im sending always at least a JSON like this {id:99}.

So you think this issue ocurrs because the obj parameter at mySMDMethod
is an entity? that means that the issue should cease to happen by just
removing all hibernate annotations?? (because thats the only special thing
about entities at this call)

Thanks for your kind help :)

Did you try to setup higher level for logger used with JSON plugin?

ie.
log4j.logger.org.apache.struts2.json = debug


Regards

Yep, but by using log4j XML configuration:

category name=com.opensymphony.xwork2.interceptor
additivity=false
priority value=DEBUG /
appender-ref ref=basic /
/category
category name=com.opensymphony.xwork2.ognl.OgnlValueStack
additivity=false
priority value=WARN /
appender-ref ref=basic /
/category

I've suspended trying to solve the issue by now, i'll restart my
research next week, i'll post everything i've found at the mailing list
at that time,

Right now i'm just restarting tomcat to solve the issue temporarily, yet
i haven't seen any tomcat log,

Thanks for your time :)



---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-21 Thread Luis Limas

On 21/08/2014 01:24 p. m., Lukasz Lenart wrote:

2014-08-21 19:14 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Yep, but by using log4j XML configuration:

 category name=com.opensymphony.xwork2.interceptor additivity=false
 priority value=DEBUG /
 appender-ref ref=basic /
 /category
 category name=com.opensymphony.xwork2.ognl.OgnlValueStack
additivity=false
 priority value=WARN /
 appender-ref ref=basic /
 /category

I've suspended trying to solve the issue by now, i'll restart my research
next week, i'll post everything i've found at the mailing list at that time,

Right now i'm just restarting tomcat to solve the issue temporarily, yet i
haven't seen any tomcat log,

Great but please add the below to your log4j configuration

category name=org.apache.struts2.json additivity=false
  priority value=DEBUG /
   appender-ref ref=basic /
/category


Regards

Done :)

Thank you,

---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-08 Thread Luis Limas

On 08/08/2014 02:18 a. m., Lukasz Lenart wrote:

2014-08-07 22:58 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks again for the reply Lukasz, this is the full hierarchy used at JSON
in the 1st mail:

  * 1st level : http://codeviewer.org/view/code:4279
  * 2nd level : http://codeviewer.org/view/code:427a
  * 3rd level (issue) : http://codeviewer.org/view/code:427b
  * 4th level : http://codeviewer.org/view/code:427c


As i told before, the issue is particularly hard to debug (also hard to
reproduce) because once Tomcat is reset the bug seems to be repaired,

Oh... I missed that out. Anyway I think there isn't a good solution
for you right now. You are using Hibernate entities directly and you
try to serialize/deserialize them which is always a bad idea ™

JSONWriter (used to serialize) has some logic to detect Javassist
extended classes but there is no way to do the same in opposite.


Regards
Thanks again for the reply Lukasz, you misunderstood me, im not doing 
serialize/deserialize my entities for any logic, the deserialize 
instruction is being called inside struts (Project: Struts 2 JSON 
Plugin, JSONInterceptor.java : 123) when parsing JSON to Map (before 
calling the setters inside JSONReader) and then to Object,  i mentioned 
the deserialize thing because there is where it seems to me that setters 
are not being called. The serialize instruction i only use it for 
debuging purposes so i was able to see how it looks the populated 
(final) object,


The issue seems to be that JSONWriter is not working propely. Also im 
not sure to understand what do you mean with there's no way to do the 
opposite, isn't JSONReader doing that?


Greetings,

---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-08 Thread Luis Limas

On 08/08/2014 02:18 a. m., Lukasz Lenart wrote:

2014-08-07 22:58 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks again for the reply Lukasz, this is the full hierarchy used at JSON
in the 1st mail:

  * 1st level : http://codeviewer.org/view/code:4279
  * 2nd level : http://codeviewer.org/view/code:427a
  * 3rd level (issue) : http://codeviewer.org/view/code:427b
  * 4th level : http://codeviewer.org/view/code:427c


As i told before, the issue is particularly hard to debug (also hard to
reproduce) because once Tomcat is reset the bug seems to be repaired,

Oh... I missed that out. Anyway I think there isn't a good solution
for you right now. You are using Hibernate entities directly and you
try to serialize/deserialize them which is always a bad idea ™

JSONWriter (used to serialize) has some logic to detect Javassist
extended classes but there is no way to do the same in opposite.


Regards
Thanks again for the reply Lukasz, you misunderstood me, im not doing 
serialize/deserialize my entities for any logic, the deserialize 
instruction is being called inside struts (Project: Struts 2 JSON 
Plugin, JSONInterceptor.java : 123) when parsing JSON to Map (before 
calling the setters inside JSONReader) and then to Object, i mentioned 
the deserialize thing because there is where it seems to me that setters 
are not being called. The serialize instruction i only use it for 
debugging purposes so i was able to see how it looks the populated 
(final) object,


Also im not sure to understand what do you mean with there's no way to 
do the opposite, isn't JSONReader doing that? The issue seems to be 
that JSONReader is not working properly when parsing the JSON-String to 
Object (Entity).


Greetings,

---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-08 Thread Luis Limas

On 08/08/2014 02:24 p. m., Lukasz Lenart wrote:

2014-08-08 17:38 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks again for the reply Lukasz, you misunderstood me, im not doing
serialize/deserialize my entities for any logic, the deserialize instruction
is being called inside struts (Project: Struts 2 JSON Plugin,
JSONInterceptor.java : 123) when parsing JSON to Map (before calling the
setters inside JSONReader) and then to Object,  i mentioned the deserialize
thing because there is where it seems to me that setters are not being
called. The serialize instruction i only use it for debuging purposes so i
was able to see how it looks the populated (final) object,

Yes I know, but you're exposing Hibernate entity directly not some VO
- it always will be an issue, as you can see [1], JSONWriter already
contains some logic to detect Hibernate bean, but JSONReader can't do
that.


The issue seems to be that JSONWriter is not working propely. Also im not
sure to understand what do you mean with there's no way to do the
opposite, isn't JSONReader doing that?

...create proper Hibernate entity from JSON - only Hibernate can do
that and creating entities by hand can cause some problems like your.

To clarify few things:
- JSONWriter serializes an object to JSON (writes to request)
- JSONRead deserializes JSON into an object (reads from request)

As I understand you have problem with converting JSON into an object?
So in that case JSONReader and JSONPopulator are involved.

[1] 
https://github.com/apache/struts/blob/aa744b811f9c41b80cc30ad6cf41ccaa75da5323/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java#L290-L312


Regards

My problem is that struts calls JSONReader when using SMDMethod=true to
convert JSON to Object. And so on, JSONReader fails to do the conversion.

This is an example of SMDMethod im calling

@SMDMethod
public String mySMDMethod(Request obj /*I showed Request.java at
previews mail */) {
if(obj.getId() == null) {
System.out.println(Unexpected behavior, actually the JSON
sended from client was {id:99}. Somehow struts didn't managed to
populate );
}
//logic stuff...
return succesfull example;
}

At client side im sending always at least a JSON like this {id:99}.

So you think this issue ocurrs because the obj parameter at
mySMDMethod is an entity? that means that the issue should cease to
happen by just removing all hibernate annotations?? (because thats the
only special thing about entities at this call)

Thanks for your kind help :)

---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-07 Thread Luis Limas

On 07/08/2014 12:52 a. m., Lukasz Lenart wrote:

2014-08-04 18:37 GMT+02:00 Luis Limas luiscl...@hotmail.com:

  =
  POST-DATA:
  =

{params:[*{author:{id:302},autoProm:0,autorizationPool:null,blockedBy:null,blockedByName:null,businessUnit:null,code:,creationDate:2014-07-30T12:36:37,deleted:0,department:{id:13},description:BITACORA
DE REVISION SEMANAL DE MOLINOS GLENN

MILL,document:null,documentCode:FFQ-043,documentType:{code:FORMATOS,deleted:0,description:FORMATOS,id:11,isRetainable:1,moduleId:0,saveHandle:null,status:4,value:11},fileId:12820,flujo:{id:24},id:_41201_,isBusy:null,nodo:{id:3575},organizationalUnit:null,reazon:FORMALIDAD
DE LA BITACORA EN UN REGISTRO

CONTROLADO,requestLogList:[],retentionText:3,retentionTime:1,saveHandle:null,status:3,storagePlaceId:1,timeToFreeMinutes:null,type:1,verificationList:[],version:1,tipoSolicitud:1}*],method:verifyRequestSMD,id:3}
  =


Previews data was printed at a Filter i've made for debugging purposes, it
runs before any struts interceptor (RequestBuffer.java) (the failure happens
with and without my filter)

The stack trace shows an error inside my application because the red-id
parameter didn't made it to my function called HQLT_findById, actually a
null was sent there

I don't see red-id in POST-DATA section


Regards

The mailing list is removing color/bold/italic format. the following
json-attribute its supposed to have red font color

id:_41201_

Thanks for the reply Lukasz, the main issue i am having it's that entity annotated with 
@MappedSuperClass is not being correctly populated after JSONUtil.deserialize, the issue 
occurs randomly and only super setters are the ones that are not being called,

Greetings,


---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-07 Thread Luis Limas

On 07/08/2014 01:17 p. m., Lukasz Lenart wrote:

2014-08-07 17:04 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks for the reply Lukasz, the main issue i am having it's that entity
annotated with @MappedSuperClass is not being correctly populated after
JSONUtil.deserialize, the issue occurs randomly and only super setters are
the ones that are not being called,

Can you post example class hierarchy which I can use to test JSONUtil?


Regards

Thanks again for the reply Lukasz, this is the full hierarchy used at
JSON in the 1st mail:

 * 1st level : http://codeviewer.org/view/code:4279
 * 2nd level : http://codeviewer.org/view/code:427a
 * 3rd level (issue) : http://codeviewer.org/view/code:427b
 * 4th level : http://codeviewer.org/view/code:427c


As i told before, the issue is particularly hard to debug (also hard to
reproduce) because once Tomcat is reset the bug seems to be repaired,
Greetings,




---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


Re: Struts missing parameters

2014-08-06 Thread Luis Limas

Any ideas of what's happening?

On 04/08/2014 12:38 p. m., Luis Limas wrote:

An update, the concrete lost-parameters are this ones:

{
   id:41201,
   code:,
   deleted:0,
   status:3,
   description:BITACORA DE REVISION SEMANAL DE MOLINOS GLENN MILL
}

This is my entity who's missing parameters:

 * http://codeviewer.org/view/code:4259

I've just noticed that all the misssing parameters belong to 
StandardEntity.java (anotated with @MappedSuperclass)


 * http://codeviewer.org/view/code:425a

I consider this a very important fact, so it seems like somehow 
/JSONUtil.deserialize/ fails at sometimes when tries to deserialize 
@MappedSuperclass (es)


Greetings,

On 04/08/2014 11:37 a. m., Luis Limas wrote:

Hi everyone,
I have an issue at JSONInterceptor/ParameterInterceptor (i think), 
parameteres are being lost (becoming null), im using:


 * Struts2 2.3.16.3
 * Spring AOP 4.0.2
 * Tomcat 7.0.34
 * Dojo 1.8

After many debugging i've concluded that the issue it's inside one of 
those two interceptors, this is the issue:


At client side i send the following json-rpc/stuff, please pay 
special attention to POST-DATA and the red parameter


  characterEncoding = UTF-8
  contentLength = 872
contentType = application/json-rpc
 locale = es_MX
locales = es_MX
   protocol = HTTP/1.1
 remoteAddr = 192.168.0.183
 remoteHost = 192.168.0.183
 scheme = http
 serverName = 192.168.0.90
 serverPort = 8080
   isSecure = false
 - HttpServletRequest
contextPath = /MyApplication
 cookie = JSESSIONID = CA8C2ACD2FE5F2259FFCDD76BE07A247
 header = accept = */*
 header = x-newrelic-id = UgAOVF9TGwAAU1NaBgA=
 header = content-type = application/json-rpc
 header = x-requested-with = XMLHttpRequest
 header = referer =
http://192.168.0.90:8080/MyApplication/view/v.verification.view
 header = accept-language = es-mx
 header = accept-encoding = gzip, deflate
 header = user-agent = Mozilla/4.0 (compatible; MSIE
   7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727;
   .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
   .NET4.0C; .NET4.0E; InfoPath.3)
 header = host = 192.168.0.90:8080
 header = content-length = 872
 header = connection = Keep-Alive
 header = cache-control = no-cache
 header = cookie =
   JSESSIONID=CA8C2ACD2FE5F2259FFCDD76BE07A247
 method = POST
   pathInfo = null
queryString = null
 remoteUser = null
 requestedSessionId = CA8C2ACD2FE5F2259FFCDD76BE07A247
 requestURI = /MyApplication/view/Request.action
servletPath = /view/Request.action
 =
 POST-DATA:
 =
{params:[*{author:{id:302},autoProm:0,autorizationPool:null,blockedBy:null,blockedByName:null,businessUnit:null,code:,creationDate:2014-07-30T12:36:37,deleted:0,department:{id:13},description:BITACORA 


   DE REVISION SEMANAL DE MOLINOS GLENN
MILL,document:null,documentCode:FFQ-043,documentType:{code:FORMATOS,deleted:0,description:FORMATOS,id:11,isRetainable:1,moduleId:0,saveHandle:null,status:4,value:11},fileId:12820,flujo:{id:24},id:_41201_,isBusy:null,nodo:{id:3575},organizationalUnit:null,reazon:FORMALIDAD 


   DE LA BITACORA EN UN REGISTRO
CONTROLADO,requestLogList:[],retentionText:3,retentionTime:1,saveHandle:null,status:3,storagePlaceId:1,timeToFreeMinutes:null,type:1,verificationList:[],version:1,tipoSolicitud:1}*],method:verifyRequestSMD,id:3} 


 =


Previews data was printed at a Filter i've made for debugging 
purposes, it runs before any struts interceptor (RequestBuffer.java) 
(the failure happens with and without my filter)


The stack trace shows an error inside my application because the 
red-id parameter didn't made it to my function called 
HQLT_findById, actually a null was sent there


   java.lang.IllegalArgumentException: id to load is required for 
loading

at org.hibernate.event.LoadEvent.init(LoadEvent.java:89)
at org.hibernate.event.LoadEvent.init(LoadEvent.java:57)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1070)
at
Framework.DAO.GenericDAOImpl.HQLT_findById(GenericDAOImpl.java:1885)
at
Framework.DAO.GenericDAOImpl.*HQLT_findById*(GenericDAOImpl.java:1837)
at sun.reflect.GeneratedMethodAccessor1386.invoke(Unknown 
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source

Struts missing parameters

2014-08-04 Thread Luis Limas

Hi everyone,
I have an issue at JSONInterceptor/ParameterInterceptor (i think),
parameteres are being lost (becoming null), im using:

 * Struts2 2.3.16.3
 * Spring AOP 4.0.2
 * Tomcat 7.0.34
 * Dojo 1.8

After many debugging i've concluded that the issue it's inside one of
those two interceptors, this is the issue:

At client side i send the following json-rpc/stuff, please pay special
attention to POST-DATA and the red parameter

  characterEncoding = UTF-8
  contentLength = 872
contentType = application/json-rpc
 locale = es_MX
locales = es_MX
   protocol = HTTP/1.1
 remoteAddr = 192.168.0.183
 remoteHost = 192.168.0.183
 scheme = http
 serverName = 192.168.0.90
 serverPort = 8080
   isSecure = false
 - HttpServletRequest
contextPath = /MyApplication
 cookie = JSESSIONID = CA8C2ACD2FE5F2259FFCDD76BE07A247
 header = accept = */*
 header = x-newrelic-id = UgAOVF9TGwAAU1NaBgA=
 header = content-type = application/json-rpc
 header = x-requested-with = XMLHttpRequest
 header = referer =
   http://192.168.0.90:8080/MyApplication/view/v.verification.view
 header = accept-language = es-mx
 header = accept-encoding = gzip, deflate
 header = user-agent = Mozilla/4.0 (compatible; MSIE
   7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727;
   .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
   .NET4.0C; .NET4.0E; InfoPath.3)
 header = host = 192.168.0.90:8080
 header = content-length = 872
 header = connection = Keep-Alive
 header = cache-control = no-cache
 header = cookie =
   JSESSIONID=CA8C2ACD2FE5F2259FFCDD76BE07A247
 method = POST
   pathInfo = null
queryString = null
 remoteUser = null
 requestedSessionId = CA8C2ACD2FE5F2259FFCDD76BE07A247
 requestURI = /MyApplication/view/Request.action
servletPath = /view/Request.action
 =
 POST-DATA:
 =
   
{params:[*{author:{id:302},autoProm:0,autorizationPool:null,blockedBy:null,blockedByName:null,businessUnit:null,code:,creationDate:2014-07-30T12:36:37,deleted:0,department:{id:13},description:BITACORA
   DE REVISION SEMANAL DE MOLINOS GLENN
   
MILL,document:null,documentCode:FFQ-043,documentType:{code:FORMATOS,deleted:0,description:FORMATOS,id:11,isRetainable:1,moduleId:0,saveHandle:null,status:4,value:11},fileId:12820,flujo:{id:24},id:_41201_,isBusy:null,nodo:{id:3575},organizationalUnit:null,reazon:FORMALIDAD
   DE LA BITACORA EN UN REGISTRO
   
CONTROLADO,requestLogList:[],retentionText:3,retentionTime:1,saveHandle:null,status:3,storagePlaceId:1,timeToFreeMinutes:null,type:1,verificationList:[],version:1,tipoSolicitud:1}*],method:verifyRequestSMD,id:3}
 =


Previews data was printed at a Filter i've made for debugging purposes,
it runs before any struts interceptor (RequestBuffer.java) (the failure
happens with and without my filter)

The stack trace shows an error inside my application because the red-id
parameter didn't made it to my function called HQLT_findById, actually
a null was sent there

   java.lang.IllegalArgumentException: id to load is required for loading
at org.hibernate.event.LoadEvent.init(LoadEvent.java:89)
at org.hibernate.event.LoadEvent.init(LoadEvent.java:57)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1070)
at
   Framework.DAO.GenericDAOImpl.HQLT_findById(GenericDAOImpl.java:1885)
at
   Framework.DAO.GenericDAOImpl.*HQLT_findById*(GenericDAOImpl.java:1837)
at sun.reflect.GeneratedMethodAccessor1386.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
   
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at
   
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at
   
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
   
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at
   
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
   

Re: Struts missing parameters

2014-08-04 Thread Luis Limas

An update, the concrete lost-parameters are this ones:

{
   id:41201,
   code:,
   deleted:0,
   status:3,
   description:BITACORA DE REVISION SEMANAL DE MOLINOS GLENN MILL
}

This is my entity who's missing parameters:

 * http://codeviewer.org/view/code:4259

I've just noticed that all the misssing parameters belong to 
StandardEntity.java (anotated with @MappedSuperclass)


 * http://codeviewer.org/view/code:425a

I consider this a very important fact, so it seems like somehow 
/JSONUtil.deserialize/ fails at sometimes when tries to deserialize 
@MappedSuperclass (es)


Greetings,

On 04/08/2014 11:37 a. m., Luis Limas wrote:

Hi everyone,
I have an issue at JSONInterceptor/ParameterInterceptor (i think), 
parameteres are being lost (becoming null), im using:


 * Struts2 2.3.16.3
 * Spring AOP 4.0.2
 * Tomcat 7.0.34
 * Dojo 1.8

After many debugging i've concluded that the issue it's inside one of 
those two interceptors, this is the issue:


At client side i send the following json-rpc/stuff, please pay special 
attention to POST-DATA and the red parameter


  characterEncoding = UTF-8
  contentLength = 872
contentType = application/json-rpc
 locale = es_MX
locales = es_MX
   protocol = HTTP/1.1
 remoteAddr = 192.168.0.183
 remoteHost = 192.168.0.183
 scheme = http
 serverName = 192.168.0.90
 serverPort = 8080
   isSecure = false
 - HttpServletRequest
contextPath = /MyApplication
 cookie = JSESSIONID = CA8C2ACD2FE5F2259FFCDD76BE07A247
 header = accept = */*
 header = x-newrelic-id = UgAOVF9TGwAAU1NaBgA=
 header = content-type = application/json-rpc
 header = x-requested-with = XMLHttpRequest
 header = referer =
   http://192.168.0.90:8080/MyApplication/view/v.verification.view
 header = accept-language = es-mx
 header = accept-encoding = gzip, deflate
 header = user-agent = Mozilla/4.0 (compatible; MSIE
   7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727;
   .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
   .NET4.0C; .NET4.0E; InfoPath.3)
 header = host = 192.168.0.90:8080
 header = content-length = 872
 header = connection = Keep-Alive
 header = cache-control = no-cache
 header = cookie =
   JSESSIONID=CA8C2ACD2FE5F2259FFCDD76BE07A247
 method = POST
   pathInfo = null
queryString = null
 remoteUser = null
 requestedSessionId = CA8C2ACD2FE5F2259FFCDD76BE07A247
 requestURI = /MyApplication/view/Request.action
servletPath = /view/Request.action
 =
 POST-DATA:
 =
{params:[*{author:{id:302},autoProm:0,autorizationPool:null,blockedBy:null,blockedByName:null,businessUnit:null,code:,creationDate:2014-07-30T12:36:37,deleted:0,department:{id:13},description:BITACORA
   DE REVISION SEMANAL DE MOLINOS GLENN
MILL,document:null,documentCode:FFQ-043,documentType:{code:FORMATOS,deleted:0,description:FORMATOS,id:11,isRetainable:1,moduleId:0,saveHandle:null,status:4,value:11},fileId:12820,flujo:{id:24},id:_41201_,isBusy:null,nodo:{id:3575},organizationalUnit:null,reazon:FORMALIDAD
   DE LA BITACORA EN UN REGISTRO
CONTROLADO,requestLogList:[],retentionText:3,retentionTime:1,saveHandle:null,status:3,storagePlaceId:1,timeToFreeMinutes:null,type:1,verificationList:[],version:1,tipoSolicitud:1}*],method:verifyRequestSMD,id:3}
 =


Previews data was printed at a Filter i've made for debugging 
purposes, it runs before any struts interceptor (RequestBuffer.java) 
(the failure happens with and without my filter)


The stack trace shows an error inside my application because the 
red-id parameter didn't made it to my function called HQLT_findById, 
actually a null was sent there


   java.lang.IllegalArgumentException: id to load is required for loading
at org.hibernate.event.LoadEvent.init(LoadEvent.java:89)
at org.hibernate.event.LoadEvent.init(LoadEvent.java:57)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1070)
at
Framework.DAO.GenericDAOImpl.HQLT_findById(GenericDAOImpl.java:1885)
at
Framework.DAO.GenericDAOImpl.*HQLT_findById*(GenericDAOImpl.java:1837)
at sun.reflect.GeneratedMethodAccessor1386.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)

at java.lang.reflect.Method.invoke(Unknown Source