Database Type Error: not compatible with Double

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Database Type Error: not compatible with Double

madppiper-2
Hey everyone,

I am receiving a very strange error on the ecommerce application ever since I switched on the VAT feature, which reads as the following:


=-=-=-=-=-=-=-=-= DATABASE TYPE ERROR in EntityExpr =-=-=-=-=-=-=-=-= In entity field [TaxAuthorityRateProduct.minPurchase] set the value passed in [java.math.BigDecimal] is not compatible with the Java type of the field [Double]


Is this a known bug? I expect it to be caused by the productsummary screen...
Reply | Threaded
Open this post in threaded view
|

Re: Database Type Error: not compatible with Double

Jacques Le Roux
Administrator
This is willfully done. They are only warning. The goal is to know which problems arise and to fix them. There is a branch currently
used for that: typecheckcleanup200810. Scott is working on it.

Though reporting is warning is desirable, locally I just commented out the warnings

Index: framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java
===================================================================
--- framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java (revision 727747)
+++ framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java (working copy)
@@ -264,7 +264,7 @@
         if (!ObjectType.instanceOf(value, type.getJavaType())) {
             String errMsg = "In entity field [" + modelEntity.getEntityName() + "." + curField.getName() + "] set the value passed
in [" + value.getClass().getName() + "] is not compatible with the Java type of the field [" + type.getJavaType() + "]";
             // eventually we should do this, but for now we'll do a "soft" failure: throw new IllegalArgumentException(errMsg);
-            Debug.logWarning(new Exception("Location of database type error"), "=-=-=-=-=-=-=-=-= DATABASE TYPE ERROR in EntityExpr
=-=-=-=-=-=-=-=-= " + errMsg, module);
+            //Debug.logWarning(new Exception("Location of database type error"), "=-=-=-=-=-=-=-=-= DATABASE TYPE ERROR in
EntityExpr =-=-=-=-=-=-=-=-= " + errMsg, module);
         }
     }

Index: framework/entity/src/org/ofbiz/entity/GenericEntity.java
===================================================================
--- framework/entity/src/org/ofbiz/entity/GenericEntity.java (revision 727747)
+++ framework/entity/src/org/ofbiz/entity/GenericEntity.java (working copy)
@@ -410,7 +410,7 @@
                 if (!ObjectType.instanceOf(value, type.getJavaType())) {
                     String errMsg = "In entity field [" + this.getEntityName() + "." + name + "] set the value passed in [" +
value.getClass().getName() + "] is not compatible with the Java type of the field [" + type.getJavaType() + "]";
                     // eventually we should do this, but for now we'll do a "soft" failure: throw new
IllegalArgumentException(errMsg);
-                    Debug.logWarning(new Exception("Location of database type error"), "=-=-=-=-=-=-=-=-= DATABASE TYPE error IN
GenericEntity.set =-=-=-=-=-=-=-=-= " + errMsg, module);
+                    //Debug.logWarning(new Exception("Location of database type error"), "=-=-=-=-=-=-=-=-= DATABASE TYPE error IN
GenericEntity.set =-=-=-=-=-=-=-=-= " + errMsg, module);
                 }
             }
             Object old = fields.put(name, value);

I tried as attachment also since it's more convenient

Jacques

----- Original Message -----
From: "madppiper" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, December 18, 2008 5:27 PM
Subject: Database Type Error: not compatible with Double


>
> Hey everyone,
>
> I am receiving a very strange error on the ecommerce application ever since
> I switched on the VAT feature, which reads as the following:
>
>
> =-=-=-=-=-=-=-=-= DATABASE TYPE ERROR in EntityExpr =-=-=-=-=-=-=-=-= In
> entity field [TaxAuthorityRateProduct.minPurchase] set the value passed in
> [java.math.BigDecimal] is not compatible with the Java type of the field
> [Double]
>
>
> Is this a known bug? I expect it to be caused by the productsummary
> screen...
> --
> View this message in context: http://www.nabble.com/Database-Type-Error%3A-not-compatible-with-Double-tp21075962p21075962.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Database Type Error: not compatible with Double

Jacques Le Roux
Administrator
In reply to this post by madppiper-2
I send a message with a patch attached but I'm afraid it did not get through. The text was :

<<This is willfully done. They are only warning. The goal is to know which problems arise and to fix them. There is a branch
currently
used for that: typecheckcleanup200810. Scott is working on it.

Though reporting is warning is desirable, locally I just commented out the warnings>>

In the meantime David replaced "error" by "warning" to avoid future false bug reports

Jacques

From: "madppiper" <[hidden email]>

>
> Hey everyone,
>
> I am receiving a very strange error on the ecommerce application ever since
> I switched on the VAT feature, which reads as the following:
>
>
> =-=-=-=-=-=-=-=-= DATABASE TYPE ERROR in EntityExpr =-=-=-=-=-=-=-=-= In
> entity field [TaxAuthorityRateProduct.minPurchase] set the value passed in
> [java.math.BigDecimal] is not compatible with the Java type of the field
> [Double]
>
>
> Is this a known bug? I expect it to be caused by the productsummary
> screen...
> --
> View this message in context: http://www.nabble.com/Database-Type-Error%3A-not-compatible-with-Double-tp21075962p21075962.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Database Type Error: not compatible with Double

madppiper-2
Ah, perfect :)


Yup, the solution worked like a charme :)



Just out of curiosity: am I right by thinking that you are trying to typeconvert from the entityengine (derby) to whatever other databasetype is available? or what exactly is causing the error?
Reply | Threaded
Open this post in threaded view
|

Re: Database Type Error: not compatible with Double

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

the type convert is handled in the fieldef folder.

this is more a complete re-work to remove double ofbiz to make the
accounting and math stable.

double has a tendency to leave .00000000000001 somewhere that throughs
of math decisions.


madppiper sent the following on 12/19/2008 12:34 AM:

> Ah, perfect :)
>
>
> Yup, the solution worked like a charme :)
>
>
>
> Just out of curiosity: am I right by thinking that you are trying to
> typeconvert from the entityengine (derby) to whatever other databasetype is
> available? or what exactly is causing the error?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJS2ZfrP3NbaWWqE4RAhwjAJ0UXfdyA48S3EscVZmIYgVi2BhTnQCgulPW
+Yc5VM6QAD/cHcs07cGJn5c=
=6B7S
-----END PGP SIGNATURE-----