Problems w/ postgresql-8.1-407.jdbc3.jar

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

Problems w/ postgresql-8.1-407.jdbc3.jar

Sterling Okura-2
I was wondering if anyone noticed problems with the latest postgresql
drivers?  We upgraded our database server to 8.1.4.  Now we get an error
trying to Quick Ship orders with an offline payment.  It looks like a weird
casting problem (ERROR: column "amount_applied" is of type numeric but
expression is of type character varying).

If I replace the 8.1.4 drivers with the old pg74.216.jdbc3.jar file, the
error goes away and we can complete offline orders, but we have some
occassional instability issues.  We do not have the instability issues with
the new 8.1.4 drivers.

The OFBiz code is a checkout from mid April 06.

Any ideas?  Error posted below.

thank you!
sterling

 ERROR: Could not complete the Sub-method used by quickShip methods to
create a shipment
[file:/opt/ofb/latest/ofbiz/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml#createShipmentForFacilityAndShipGroup]
process [problem invoking the [updateShipment] service with the map named
[packedContext] containing [[shipmentId=27440, statusId=SHIPMENT_SHIPPED,
userLogin=[GenericEntity:UserLogin][createdStamp,null()][createdTxStamp,null()][currentPassword,2ea61b258a8dc0eacfcf6ce9cec756ede3ce3eca(
java.lang.String)][disabledDateTime,2006-08-11 13:57:44.861(
java.sql.Timestamp)][enabled,Y(java.lang.String)][hasLoggedOut,N(
java.lang.String)][isSystem,null()][lastCurrencyUom,null()][lastLocale,null()][lastUpdatedStamp,2006-11-17
15:53:35.784(java.sql.Timestamp)][lastUpdatedTxStamp,2006-11-17 15:53:35.783
(java.sql.Timestamp)][partyId,admin(java.lang.String
)][passwordHint,null()][successiveFailedLogins,0(java.lang.Long
)][userLoginId,admin(java.lang.String)], locale=en_US]]: Problems with the
transaction. (Exception while inserting the following entity:
[GenericEntity:PaymentApplication][amountApplied,0.0(java.lang.String)][billingAccountId,null()][createdStamp,2006-11-20
17:37:37.991(java.sql.Timestamp)][createdTxStamp,2006-11-20 17:37:37.991(
java.sql.Timestamp)][invoiceId,27470(java.lang.String)][lastUpdatedStamp,2006-11-20
17:37:37.991(java.sql.Timestamp)][lastUpdatedTxStamp,2006-11-20 17:37:37.991
(java.sql.Timestamp)][paymentApplicationId,20070(java.lang.String
)][paymentId,21180(java.lang.String)] (while inserting:
[GenericEntity:PaymentApplication][amountApplied,0.0(java.lang.String)][billingAccountId,null()][createdStamp,2006-11-20
17:37:37.991(java.sql.Timestamp)][createdTxStamp,2006-11-20 17:37:37.991(
java.sql.Timestamp)][invoiceId,27470(java.lang.String)][lastUpdatedStamp,2006-11-20
17:37:37.991(java.sql.Timestamp)][lastUpdatedTxStamp,2006-11-20 17:37:37.991
(java.sql.Timestamp)][paymentApplicationId,20070(java.lang.String
)][paymentId,21180(java.lang.String)] (SQL Exception while executing the
following:INSERT INTO public.PAYMENT_APPLICATION (PAYMENT_APPLICATION_ID,
PAYMENT_ID, INVOICE_ID, INVOICE_ITEM_SEQ_ID, BILLING_ACCOUNT_ID,
TO_PAYMENT_ID, TAX_AUTH_GEO_ID, AMOUNT_APPLIED, LAST_UPDATED_STAMP,
LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?) (ERROR: column "amount_applied" is of type numeric
but expression is of type character varying))))]
Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
i encountered the error too

but the jar file which in the ofbiz's former version work well,and if i use the jar file download from postgreSQL website( postgresql-8.1-407.jdbc3.jar), error occured.

and the error occured in the makeValidValue method

now what should i do?
to use the early jar file?or to modify the makeValidValue method to implement the type cast?or use some other jar file?
Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

Jacques Le Roux
Administrator
Did you try to update to Postgres 8.2 ?

Jacques

De : "guo" <[hidden email]>

>
> i encountered the error too:(
>
> but the jar file which in the ofbiz's former version work well,and if i use
> the jar file download from postgreSQL website(
> postgresql-8.1-407.jdbc3.jar), error occured.
>
> and the error occured in the makeValidValue method
>
> now what should i do?
> to use the early jar file?or to modify the makeValidValue method to
> implement the type cast?or use some other jar file?
> --
> View this message in context: http://www.nabble.com/Problems-w--postgresql-8.1-407.jdbc3.jar-tf2676311.html#a11431007
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
yes, i have try on 8.1 and 8.2 ,but it does not work
Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

Daniel Martínez-4
Have you tried using latest jdbc driver? (8.2 or 8.3)

From http://jdbc.postgresql.org/download.html

--Newer driver releases will get additional features and bug fixes that
you may need. Much care is taken to make newer driver releases work
against older servers, so if you are --having a problem and suspect it
is the driver's fault, don't hesitate to try out the latest release on
an older server. The current development driver is known to work with
all server --versions back to, and including, 7.2.

I am using postgresql 8.2 and jdbc driver 8.3dev-600 . All works like a
charm

Regards,
--
Daniel

guo escribió:
> yes, i have try on 8.1 and 8.2 ,but it does not work
>  
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

BJ Freeman
In reply to this post by perfecttunny
driver =postgresql-8.2-505.jdbc3.jar
PostgreSQL version 8.2.4
works ok


guo sent the following on 7/4/2007 8:02 AM:
> yes, i have try on 8.1 and 8.2 ,but it does not work
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
postgreSQL 8.2.3
then ,neither 8.2-505 JDBC 3 nor 8.3dev-600 JDBC 3 does not work.

ERROR: column "priority" is of type numeric but expression is of type character varying

the java source as following:
GenericValue WorkEffort=delegator.makeValidValue("WorkEffort",FieldMap);
delegator.create(WorkEffort);
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

BJ Freeman
the error you show is not effected by the jars
it is a difference between the database created by the enitity and the code


guo sent the following on 7/5/2007 5:44 AM:
> postgreSQL 8.2.3
> then ,neither 8.2-505 JDBC 3 nor 8.3dev-600 JDBC 3 does not work.
>
> ERROR: column "priority" is of type numeric but expression is of type
> character varying
>
> the java source as following:
> GenericValue WorkEffort=delegator.makeValidValue("WorkEffort",FieldMap);
> delegator.create(WorkEffort);
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
i dont think so.
when i use the former jar file(which include in ofbiz's former version),it works
and the database has not been changed
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

BJ Freeman
am I missing something
if you have a jar that works what is the problem

guo sent the following on 7/5/2007 6:53 AM:
> i dont think so.
> when i use the former jar file(which include in ofbiz's former version),it
> works
> and the database has not been changed
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

Daniel Martínez-4
In reply to this post by perfecttunny
Just thinking out loud

Maybe is it that database changed from the former version? This could be
the reason why ofbiz uses a different type (from its entity definition
files) that the one in the actual database.

AFAIK there is no tool available to take care of upgrading the database
between versions

You can try backing up your database and then executing

java -jar ofbiz.jr -install -readers=seed

which will recreate the tables with the info from the entities definition.
--
Daniel

guo escribió:
> i dont think so.
> when i use the former jar file(which include in ofbiz's former version),it
> works
> and the database has not been changed
>  
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

masionas
In reply to this post by BJ Freeman
The problem is that the newer version of jar does not work. That means that if the postgres server is upgraded at some point which probably will require a newer jar as well, then an error can arise back.

BJ Freeman wrote
am I missing something
if you have a jar that works what is the problem

guo sent the following on 7/5/2007 6:53 AM:
> i dont think so.
> when i use the former jar file(which include in ofbiz's former version),it
> works
> and the database has not been changed
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

BJ Freeman
based a previous response
and since I am running 8.2.4 and new jars with no problem
it may be that a database created with old jars can not be used.

MrJohnBrown sent the following on 7/5/2007 1:57 PM:

> The problem is that the newer version of jar does not work. That means that
> if the postgres server is upgraded at some point which probably will require
> a newer jar as well, then an error can arise back.
>
>
> BJ Freeman wrote:
>> am I missing something
>> if you have a jar that works what is the problem
>>
>> guo sent the following on 7/5/2007 6:53 AM:
>>> i dont think so.
>>> when i use the former jar file(which include in ofbiz's former
>>> version),it
>>> works
>>> and the database has not been changed
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Norton AntiSpam] Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
In reply to this post by Daniel Martínez-4
thanks all!

i reinstalled postgreSQL(version 8.2.4), JDBC driver =8.2-505.jdbc3 ,and recreated the database
and in cmd lne ,executed "ant run-install"
then startup the ofbiz

In the java source
public static String ModifyEvent(HttpServletRequest request, HttpServletResponse response) throws Exception {
    Map returnMap = new HashMap();
    boolean BeginTrans=false;
    String workEffortId="";
    try {
      GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
      Map FieldMap=UtilHttp.getParameterMap(request);

      BeginTrans=TransactionUtil.begin();
      GenericValue WorkEffort=delegator.makeValidValue("WorkEffort",FieldMap);
      workEffortId=delegator.getNextSeqId("WorkEffort");
      WorkEffort.set("workEffortId",workEffortId);
      WorkEffort.set("lastStatusUpdate",UtilDateTime.nowTimestamp());
      delegator.create(WorkEffort);    
   }catch(Excepion e){
      ...
   }

and error occured.

but when i use another jdbc driver which is in OFBIZ's former version(i dont know what version ,the dirver's size is 222KB),it works!

So i guess about the reason is the Jar's version.
Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
In reply to this post by perfecttunny

Now ,i have no choice but to do type cast manually just as following
String priority=String.valueOf(FieldMap.get("priority"));
if (!priority.equals("")){
  FeldMap.put("priority",Double.valueOf(priority));
}
...
GenericValue WorkEffort=delegator.makeValidValue("WorkEffort",FieldMap);

Thanks and Regards
--
View this message in context: http://www.nabble.com/Problems-w--postgresql-8.1-407.jdbc3.jar-tf2676311.html#a11477025
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Problems w/ postgresql-8.1-407.jdbc3.jar

perfecttunny
In reply to this post by Sterling Okura-2
Now ,i have no choice but to do type cast manually just as following
String priority=String.valueOf(FieldMap.get("priority"));
if (!priority.equals("")){
  FeldMap.put("priority",Double.valueOf(priority));
}
...
GenericValue WorkEffort=delegator.makeValidValue("WorkEffort",FieldMap);

Thanks and Regards