at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at com.csi.servlet.ShopUpServlet.doPost(ShopUpServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
时间: 2023-10-03 21:03:09 浏览: 245
这个错误通常发生在试图将一个非数字字符串转换成数字类型时,例如使用`Double.parseDouble()`方法将一个非数字字符串解析成浮点数。如果出现此错误,可能是因为传递给`Double.parseDouble()`方法的字符串不是一个有效的数字字符串。请检查传递给该方法的字符串是否正确,并确保它只包含数字字符和小数点符号。如果字符串不是数字字符串,则需要修改代码以确保传递给方法的字符串是一个有效的数字字符串,或者使用其他方法将其转换为数字类型。如果字符串是数字字符串,则需要检查代码中是否存在其他错误,例如使用了不正确的变量或参数。
相关问题
Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842) at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122) at java.lang.Float.parseFloat(Float.java:451) at InsertHandleData.actionPerformed(InsertHandleData.java:28) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
这是一个Java的异常信息,具体是一个NumberFormatException异常。该异常通常在字符串转换为数字时发生,此处发生在将空字符串转换为浮点数时。在InsertHandleData.java文件的第28行出现了问题。可能是因为你尝试将一个空字符串转换为浮点数,但空字符串不能被解析为有效的数字。要解决这个问题,你需要检查代码逻辑,确保在转换之前字符串不为空。你可以添加一些条件判断来处理空字符串的情况,或者在转换之前先验证字符串是否为空。
ln: failed to create symbolic link ‘/etc/taihao-apps/hive-conf/spark-defaults.conf’: Permission denied java.lang.UnsupportedClassVersionError: com/aliyun/platform/transfer/Writer : Unsupported major.minor version 52.0 at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2436) at java.lang.Class.getDeclaredFields(Class.java:1806) at com.sun.btrace.BTraceMBean.isMBean(BTraceMBean.java:216) at com.sun.btrace.BTraceMBean.registerMBean(BTraceMBean.java:187) at com.sun.btrace.BTraceRuntime.init(BTraceRuntime.java:2548) at com.sun.btrace.BTraceRuntime.forClass(BTraceRuntime.java:631) at AppTimeLineCollector.<clinit>(Unknown Source) at sun.misc.Unsafe.ensureClassInitialized(Native Method) at com.sun.btrace.BTraceRuntime.defineClassImpl(BTraceRuntime.java:2462) at com.sun.btrace.BTraceRuntime.defineClass(BTraceRuntime.java:547) at com.sun.btrace.runtime.BTraceProbeSupport.defineClass(BTraceProbeSupport.java:219) at com.sun.btrace.runtime.BTraceProbePersisted.register(BTraceProbePersisted.java:448) at com.sun.btrace.agent.Client.loadClass(Client.java:322)
这个错误信息包含了两个错误:
1. ln: failed to create symbolic link ‘/etc/taihao-apps/hive-conf/spark-defaults.conf’: Permission denied
这个错误是由于你没有足够的权限创建软链接。你可以使用sudo命令以管理员权限运行该命令,例如:
sudo ln -s /path/to/spark-defaults.conf /etc/taihao-apps/hive-conf/spark-defaults.conf
2. java.lang.UnsupportedClassVersionError: com/aliyun/platform/transfer/Writer : Unsupported major.minor version 52.0
这个错误是由于你的Java版本与使用的类文件版本不兼容造成的。你需要升级Java版本或使用与你当前Java版本兼容的类文件。你可以通过以下命令检查你当前的Java版本:
java -version
如果Java版本过低,你可以安装更新的版本。如果你无法升级Java版本,你可以使用与你当前Java版本兼容的类文件。
阅读全文