Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2345 | major | always | 01-18-08 16:42 | 01-23-08 21:53 | |
|
|||||
Reporter: | gorck | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.3 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.5 | ||
|
|||||
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 |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: | bigDecimal.php [^] (374 bytes) 01-18-08 16:42 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|