Anonymous | Login | Signup for a new account | 12-17-2024 11:57 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0002345 | [Quercus] | major | always | 01-18-08 16:42 | 01-23-08 21:53 | ||||
Reporter | gorck | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.1.3 | ||||||
Summary | 0002345: Cannot create a BigDecimal, seems to call wrong constructor | ||||||||
Description |
It appears BigDecimal is not working. php script running under tomcat 5.5.25 with quercus jars. I can run many php scripts and am even able to return a list of my own dtos from a Spring Managed Bean. However for the life of me I can't get a BigDecimal instantiated via Quercus in a php script. I have even tried to use a my own custom BigDecimalFactory coded in java and it wont work. I must use BigDecimal in my Dtos. I dont have a choice not to use BigDecimals If this is not a bug will someone explain to me how to instantiate a java.math.BigDecimal in php. Here is the simple php script I also tried the lines that are commented out. <?php import java.lang.Double; import java.math.BigDecimal; $double = Double::parseDouble(3.1); var_dump($double); //works shows as a float //none of the following work I get the same stack trace basically for all of them $bigDecimal = new BigDecimal($double); //$bigDecimal = new BigDecimal(3.1); //$bigDecimal = new BigDecimal("3.1"); //$bigDecimal = BigDecimal::valueOf($double); var_dump($bigDecimal); The stack trace I get is: java.lang.NumberFormatException: For input string: "3.1" java.lang.NumberFormatException.forInputString(Unknown Source) java.lang.Long.parseLong(Unknown Source) java.lang.Long.(Unknown Source) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) java.lang.reflect.Constructor.newInstance(Unknown Source) com.caucho.quercus.env.JavaConstructor.invoke(JavaConstructor.java:96) com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:615) com.caucho.quercus.env.JavaOverloadMethod.call(JavaOverloadMethod.java:179) com.caucho.quercus.program.JavaClassDef.callNew(JavaClassDef.java:445) com.caucho.quercus.env.QuercusClass.callNew(QuercusClass.java:478) com.caucho.quercus.expr.NewExpr.eval(NewExpr.java:99) com.caucho.quercus.expr.Expr.evalCopy(Expr.java:399) com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:86) com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64) com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99) com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239) com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:61) com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119) com.caucho.quercus.servlet.QuercusServletImpl.service(QuercusServletImpl.java:163) com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:353) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) It appears as though the somehow the incorrect BigDecimal constructor is being called. The one that takes a long instead of a double and Long.parseLong is throwing a NumberFormatException on 3.1. Any help is much appreciated. rsinner@cms-solutions.com |
||||||||
Additional Information | |||||||||
Attached Files | bigDecimal.php [^] (374 bytes) 01-18-08 16:42 | ||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed. 27 unique queries executed. |