-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateTime problems after updating from vraptor 3.5.1 to 3.5.3 #585
Comments
The problem is that your converter is not being called? |
Yes |
can you paste here the startup log of the server, with debug logs for VRaptor, please? |
There are too many log, but I just filtered by "datetime". Does it helps?
This is my converter: @Convert(DateTime.class)
@ApplicationScoped
public class ConverterInputDateTime implements Converter<DateTime> {
public ConverterInputDateTime(DateTimeConverter dateTimeConverter){
...
}
@Override
public DateTime convert(String value, Class<? extends DateTime> arg1, ResourceBundle arg2) {
...
}
} Thanks, |
It seems that guice registry is ignoring your classes... Can you debug this GuiceComponentRegistry and see why it is ignoring your class? |
It's going directly to the else clause at GuiceComponentRegistry#deepRegister:119 // try register named component
if (component.isAnnotationPresent(Named.class)) {
Named named = ((Class<?>) component).getAnnotation(Named.class);
logger.debug("Binding {} to {} with @Named({})", new Object[] { required, component, named.value() });
binder.bind(required).annotatedWith(named).to(component);
} else if (!boundClasses.contains(required)) {
logger.debug("Binding {} to {}", required, component);
binder.bind(required).to(component);
boundClasses.add(required);
} else {
logger.debug("Ignoring binding of {} to {}", required, component);
} |
Can you debug |
Sorry for the late, I was trying to collect as many data as I could. Steps:
POST http://ip/myapp/xpto/add
Content-Type: application/json
{
"br.com.xpto.model.MyModel": {
"dateTime": "2013-11-22T12:00:00.000Z"
}
}
@Post
@Path("add")
@Consumes
public void add (MyModel model) {
//model.dateTime = null
//another fields arrives OK
} Thanks, |
You are using The correct json is: {
"model": {
"dateTime": "2013-11-22T12:00:00.000Z"
}
} since model is the parameter name. this should work also: {
"dateTime": "2013-11-22T12:00:00.000Z"
} |
This process always worked without problems ... After doing more tests I discovered that the problem occurs when updating the xstream from 1.3.1 to 1.4.3 version. Using vraptor 3.5.3 + xstream 1.3.1, works fine. Using vraptor 3.5.3 + xstream 1.4.3, does not work properly! So, this seems to be a xstream desserialization problem. What do you guys recommend for me now? Thanks, |
Can you sue vraptor 3.5.3 + xtream 1.3.1? |
I think so! We're testing all the projects in order to check it. And not urgently: what about the next versions? Any idea how we can Thanks for your time, Em segunda-feira, 25 de novembro de 2013, Lucas Cavalcanti escreveu:
Danilo Rosetto Muñoz |
We're moving to GSon for Json (de)serialization, so this should solve the issue. |
Very nice! GSon seems to be very nice! |
It's getting very complicate for us continue using xstream 1.3.1! It generated another erros ... :-( So, we've tried looking for the problem into xstream code and the main differences are in AbstractReflectionConverter#doUnmarshal (second while To reproduce this error you can:
Resources: Posted JSON: {
"myModel": {
"dateTimeField": "10/30/2013"
}
} Controller: @Post
@Consumes
public void jsonTest(MyModel myModel){
//Check dateTimeField value
// xstream 1.3.1: dateTimeField is filed and different of null
// xstream 1.4.x: dateTimeField is null
} Converter: @Component
@ApplicationScoped
public class DateTimeXStreamConverter implements SingleValueConverter{
//implementation
} MyModel: public class MyModel{
private DateTime dateTimeField;
//getter and setter
} Thanks, |
what errors? |
We have a large product running with vraptor and we got spread errors along the java projects. |
Hi, I think we can close this ticket. Today we are using vraptor 4 and everthing is working fine for us. And it seems there are no more issues related by other users related to this subject. Regards, |
Closing. Thanks @danilomunoz! |
I've just update my project from vraptor 3.5.1 to 3.5.3. I have the converter for joda DateTime, but now I'm receiving null in DateTime fields.
I looked at this change #548, but I could'n solve the problem.
May someone could give some idea how to solve this?
Thanks,
The text was updated successfully, but these errors were encountered: