Goodmorning、 文字列を大きな小数に解析していますが、パターンを設定するとエラーが返されます。コードは非常にシンプルで、私はドキュメンテーションと他のポストからここにstackoverflow私はそれがどのようなアドレスを覚えていない撮影した。それは以下の通りです:文字列をbigdecimalに変換する際にエラーが発生しました
DecimalFormatSymbols symbols = new DecimalFormatSymbols();
symbols.setGroupingSeparator('.');
symbols.setDecimalSeparator(',');
String pattern = "#.##0,0#";
DecimalFormat decimalFormat = new DecimalFormat(pattern, symbols);
decimalFormat.setParseBigDecimal(true);
(BigDecimal) decimalFormat.parse(entity.getQta()))
エラーがこのラインでスローされます。GWTデバッガの
DecimalFormat decimalFormat = new DecimalFormat(pattern, symbols);
のStackTrace:
com.smartgwt.client.core.JsObject$SGWT_WARN:
09:29:12.673:MOU6:WARN:RPCManager:ATTENZIONE: si e' verificato un errore imprevisto [SC: 500]undefined - response: {clientContext: Obj,
status: -1,
invalidateCache: true,
data: "ATTENZIONE: si e' verificato un errore i..."[59],
internalClientContext: Obj,
context: undef,
startRow: 0,
endRow: 0,
totalRows: 0} at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
java.lang.reflect.Constructor.newInstance(Constructor.java:422) at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338) at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219) at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576) at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:304) at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.data.DataSource.processResponse(DataSource.java) at
com.sgss.common.client.ds.SgssGwtRpcDataSource.handleFailure(SgssGwtRpcDataSource.java:205) at
com.sgss.common.client.ds.SgssGwtRpcDataSource$GenericAsyncCallback.onFailure(SgssGwtRpcDataSource.java:148) at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:237) at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:259) at
com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412) at sun.reflect.GeneratedMethodAccessor417.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338) at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219) at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576) at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284) at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:356) at
sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293) at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547) at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Thread.java:745)
編集:私は私の中にGWT(SMartGwtをmetionedませんでした私はバックエンドでこのような解析をしています。これはsmartgwtを使用せず、春と冬のみです。
解析する値を含める[mcve]とデフォルトのFORMATロケールを入力してください。 –
あなたの質問と一緒にエラーメッセージを投稿するだけです。 –
@Jon Skeet entity.getQta()は、1.743.711,67のような文字列であり、ロケールはit_IT – softwareplay