Re: Problem with java.util.Date

2011-01-06 Thread bond
Hi,
maybe I've some more ideas about this problem.
With the simple code above it works; but I've a bean with several
field. For example


BeanExample

private long id;
private Date date;
private String text;

This bean has getter and setter; when I get the value of date's field
I print his class:

Window.alert(class: +objet.getDate().getClass());

And the class of the objet is java.sql.Date instead of
java.util.Date. In the bean I've imported ONLY java.util.Date.
I think the bug is on Gilead that I used on every bean.

Thanks very much




On 5 Gen, 20:22, Y2i yur...@gmail.com wrote:
  Just copied and tested above code in 2.1.1 and works fine in
  development mode.

 This is what I said earlier: the example also works for me in GWT
 2.1.1...

  Looking at the exception, you are using the setHours() method in the
  sql Date object...

 But if I replace java.util.Date with java.sql.Date the example would
 not compile because java.sql.Date does not have a default
 constructor...http://download.oracle.com/javase/6/docs/api/java/sql/Date.html

 A mystery...

 Initially I thought it might be that setHours() was being passed an
 Integer instead of an int and the Integer was null, but the call was
 explicit setHours(13)...

 What if you call date.setHours(12) or date.setHours(11)?

 Also, check your project settings, may be your project is referring to
 both GWT 2.1.1 and 2.0 at the same time, which may cause some side
 effects.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-05 Thread bond
Yes,
if I comment the line date.setHours(13); it works!!!

Thanks!

On 3 Gen, 22:38, Y2i yur...@gmail.com wrote:
 You are using java.util.Date because if you used java.sql.Date your
 example would not compile.

 does your example work if you comment out the line below?
 // date.setHours(13);

 On Jan 3, 1:16 pm, bond daniele.re...@gmail.com wrote:

  Hi,
  I'm usign java.util.Date!!! So the dafult constructor is present.
  My IDE import java.util and not java.sql package.

  Any ideas?

  Thanks!

  On 30 Dic 2010, 22:49, Y2i yur...@gmail.com wrote:

   java.sql.Date does not have a default constructor, so the example
   won't compile; it must be something different.

   BTW, I copied the three lines above to my client code: there is no
   problem with compiling and running it using java.util.Date and GWT
   2.1.1.

   On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:

Is this error happing in old code or newly created?
Check the package name in the import of the file, there is a chance
your IDE auto-imported class Date not from java.util but from java.sql
package.

On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:

 Hi,
 with the last version of GWT (2.1.1); in the client when I'm using
 this code:
 Date date = new Date();
 date.setHours(13);
 date.setMinutes(00);

 throw this exception:

 java.lang.IllegalArgumentException: null
     at java.sql.Date.setHours(Unknown Source)

 I think that the problem is linked to the fact that now java.sql.Date
 is implemented in Gwt.
 How I can resolve the problem?

 Thanks very much

 Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-05 Thread smida02
date.setHours has been deprecated since Java 1.1

On Jan 5, 2:42 am, bond daniele.re...@gmail.com wrote:
 Yes,
 if I comment the line date.setHours(13); it works!!!

 Thanks!

 On 3 Gen, 22:38, Y2i yur...@gmail.com wrote:







  You are using java.util.Date because if you used java.sql.Date your
  example would not compile.

  does your example work if you comment out the line below?
  // date.setHours(13);

  On Jan 3, 1:16 pm, bond daniele.re...@gmail.com wrote:

   Hi,
   I'm usign java.util.Date!!! So the dafult constructor is present.
   My IDE import java.util and not java.sql package.

   Any ideas?

   Thanks!

   On 30 Dic 2010, 22:49, Y2i yur...@gmail.com wrote:

java.sql.Date does not have a default constructor, so the example
won't compile; it must be something different.

BTW, I copied the three lines above to my client code: there is no
problem with compiling and running it using java.util.Date and GWT
2.1.1.

On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:

 Is this error happing in old code or newly created?
 Check the package name in the import of the file, there is a chance
 your IDE auto-imported class Date not from java.util but from java.sql
 package.

 On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:

  Hi,
  with the last version of GWT (2.1.1); in the client when I'm using
  this code:
  Date date = new Date();
  date.setHours(13);
  date.setMinutes(00);

  throw this exception:

  java.lang.IllegalArgumentException: null
      at java.sql.Date.setHours(Unknown Source)

  I think that the problem is linked to the fact that now 
  java.sql.Date
  is implemented in Gwt.
  How I can resolve the problem?

  Thanks very much

  Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-05 Thread bond
Yes, it's deprecated but is the only manner to set the hour on the
client with GWT.

Daniele

On 5 Gen, 16:34, smida02 daleesm...@gmail.com wrote:
 date.setHours has been deprecated since Java 1.1

 On Jan 5, 2:42 am, bond daniele.re...@gmail.com wrote:

  Yes,
  if I comment the line date.setHours(13); it works!!!

  Thanks!

  On 3 Gen, 22:38, Y2i yur...@gmail.com wrote:

   You are using java.util.Date because if you used java.sql.Date your
   example would not compile.

   does your example work if you comment out the line below?
   // date.setHours(13);

   On Jan 3, 1:16 pm, bond daniele.re...@gmail.com wrote:

Hi,
I'm usign java.util.Date!!! So the dafult constructor is present.
My IDE import java.util and not java.sql package.

Any ideas?

Thanks!

On 30 Dic 2010, 22:49, Y2i yur...@gmail.com wrote:

 java.sql.Date does not have a default constructor, so the example
 won't compile; it must be something different.

 BTW, I copied the three lines above to my client code: there is no
 problem with compiling and running it using java.util.Date and GWT
 2.1.1.

 On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:

  Is this error happing in old code or newly created?
  Check the package name in the import of the file, there is a chance
  your IDE auto-imported class Date not from java.util but from 
  java.sql
  package.

  On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:

   Hi,
   with the last version of GWT (2.1.1); in the client when I'm using
   this code:
   Date date = new Date();
   date.setHours(13);
   date.setMinutes(00);

   throw this exception:

   java.lang.IllegalArgumentException: null
       at java.sql.Date.setHours(Unknown Source)

   I think that the problem is linked to the fact that now 
   java.sql.Date
   is implemented in Gwt.
   How I can resolve the problem?

   Thanks very much

   Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-05 Thread Y2i
 Just copied and tested above code in 2.1.1 and works fine in
 development mode.

This is what I said earlier: the example also works for me in GWT
2.1.1...

 Looking at the exception, you are using the setHours() method in the
 sql Date object...

But if I replace java.util.Date with java.sql.Date the example would
not compile because java.sql.Date does not have a default
constructor...
http://download.oracle.com/javase/6/docs/api/java/sql/Date.html

A mystery...

Initially I thought it might be that setHours() was being passed an
Integer instead of an int and the Integer was null, but the call was
explicit setHours(13)...

What if you call date.setHours(12) or date.setHours(11)?

Also, check your project settings, may be your project is referring to
both GWT 2.1.1 and 2.0 at the same time, which may cause some side
effects.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-03 Thread bond
Hi,
I'm usign java.util.Date!!! So the dafult constructor is present.
My IDE import java.util and not java.sql package.

Any ideas?

Thanks!

On 30 Dic 2010, 22:49, Y2i yur...@gmail.com wrote:
 java.sql.Date does not have a default constructor, so the example
 won't compile; it must be something different.

 BTW, I copied the three lines above to my client code: there is no
 problem with compiling and running it using java.util.Date and GWT
 2.1.1.

 On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:

  Is this error happing in old code or newly created?
  Check the package name in the import of the file, there is a chance
  your IDE auto-imported class Date not from java.util but from java.sql
  package.

  On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:

   Hi,
   with the last version of GWT (2.1.1); in the client when I'm using
   this code:
   Date date = new Date();
   date.setHours(13);
   date.setMinutes(00);

   throw this exception:

   java.lang.IllegalArgumentException: null
       at java.sql.Date.setHours(Unknown Source)

   I think that the problem is linked to the fact that now java.sql.Date
   is implemented in Gwt.
   How I can resolve the problem?

   Thanks very much

   Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2011-01-03 Thread Y2i
You are using java.util.Date because if you used java.sql.Date your
example would not compile.

does your example work if you comment out the line below?
// date.setHours(13);

On Jan 3, 1:16 pm, bond daniele.re...@gmail.com wrote:
 Hi,
 I'm usign java.util.Date!!! So the dafult constructor is present.
 My IDE import java.util and not java.sql package.

 Any ideas?

 Thanks!

 On 30 Dic 2010, 22:49, Y2i yur...@gmail.com wrote:







  java.sql.Date does not have a default constructor, so the example
  won't compile; it must be something different.

  BTW, I copied the three lines above to my client code: there is no
  problem with compiling and running it using java.util.Date and GWT
  2.1.1.

  On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:

   Is this error happing in old code or newly created?
   Check the package name in the import of the file, there is a chance
   your IDE auto-imported class Date not from java.util but from java.sql
   package.

   On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:

Hi,
with the last version of GWT (2.1.1); in the client when I'm using
this code:
Date date = new Date();
date.setHours(13);
date.setMinutes(00);

throw this exception:

java.lang.IllegalArgumentException: null
    at java.sql.Date.setHours(Unknown Source)

I think that the problem is linked to the fact that now java.sql.Date
is implemented in Gwt.
How I can resolve the problem?

Thanks very much

Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Problem with java.util.Date

2010-12-30 Thread bond
Hi,
with the last version of GWT (2.1.1); in the client when I'm using
this code:
Date date = new Date();
date.setHours(13);
date.setMinutes(00);

throw this exception:

java.lang.IllegalArgumentException: null
at java.sql.Date.setHours(Unknown Source)


I think that the problem is linked to the fact that now java.sql.Date
is implemented in Gwt.
How I can resolve the problem?

Thanks very much

Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2010-12-30 Thread Slava Lovkiy
Is this error happing in old code or newly created?
Check the package name in the import of the file, there is a chance
your IDE auto-imported class Date not from java.util but from java.sql
package.

On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:
 Hi,
 with the last version of GWT (2.1.1); in the client when I'm using
 this code:
 Date date = new Date();
 date.setHours(13);
 date.setMinutes(00);

 throw this exception:

 java.lang.IllegalArgumentException: null
     at java.sql.Date.setHours(Unknown Source)

 I think that the problem is linked to the fact that now java.sql.Date
 is implemented in Gwt.
 How I can resolve the problem?

 Thanks very much

 Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Problem with java.util.Date

2010-12-30 Thread Y2i
java.sql.Date does not have a default constructor, so the example
won't compile; it must be something different.

BTW, I copied the three lines above to my client code: there is no
problem with compiling and running it using java.util.Date and GWT
2.1.1.

On Dec 30, 1:31 pm, Slava Lovkiy slava.lov...@gmail.com wrote:
 Is this error happing in old code or newly created?
 Check the package name in the import of the file, there is a chance
 your IDE auto-imported class Date not from java.util but from java.sql
 package.

 On Dec 31, 2:17 am, bond daniele.re...@gmail.com wrote:







  Hi,
  with the last version of GWT (2.1.1); in the client when I'm using
  this code:
  Date date = new Date();
  date.setHours(13);
  date.setMinutes(00);

  throw this exception:

  java.lang.IllegalArgumentException: null
      at java.sql.Date.setHours(Unknown Source)

  I think that the problem is linked to the fact that now java.sql.Date
  is implemented in Gwt.
  How I can resolve the problem?

  Thanks very much

  Best regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.