You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by madppiper <pa...@mutschler.ch> on 2008/12/18 17:27:01 UTC

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.


Re: Database Type Error: not compatible with Double

Posted by BJ Freeman <bj...@free-man.net>.
-----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-----

Re: Database Type Error: not compatible with Double

Posted by madppiper <pa...@mutschler.ch>.
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?
-- 
View this message in context: http://www.nabble.com/Database-Type-Error%3A-not-compatible-with-Double-tp21075962p21087606.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Database Type Error: not compatible with Double

Posted by Jacques Le Roux <ja...@les7arts.com>.
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" <pa...@mutschler.ch>
>
> 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.
> 


Re: Database Type Error: not compatible with Double

Posted by Jacques Le Roux <ja...@les7arts.com>.
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" <pa...@mutschler.ch>
To: <us...@ofbiz.apache.org>
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.
>