gpt4 book ai didi

java - NetSuite java.lang.NoClassDefFoundError : sun/io/MalformedInputException on getConnection

转载 作者:太空宇宙 更新时间:2023-11-04 06:28:11 25 4
gpt4 key购买 nike

尝试使用 DriverManager 在 java 中连接时出现以下错误。我查遍了整个网络并没有找到解决方案。有人可以告诉我以下错误的原因或解释如何解决它。

conn = DriverManager.getConnection(connectionString, login, password);

"C:\Program Files\Java\jdk1.8.0_20\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:54111,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "Z:\scripts\Local\NetSuite\bin;Z:\scripts\Local\NetSuite\lib\c3p0-0.9.5-pre8.jar;Z:\scripts\Local\NetSuite\lib\mchange-commons-java-0.2.7.jar;Z:\scripts\Local\NetSuite\lib\mysql-connector-java-5.1.23-bin.jar;Z:\scripts\Local\NetSuite\lib\NQjc.jar;Z:\scripts\Local\NetSuite\netsuite.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_20\jre\lib\ext\zipfs.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.5\lib\idea_rt.jar" connection.Main
Connected to the target VM, address: '127.0.0.1:54111', transport: 'socket'
Using connection string: jdbc:ns://odbcserver.na1.netsuite.com:1708;ServerDataSource=NetSuite.com;encrypted=1;CustomProperties=(AccountID=3650326;RoleID=3)
Exception in thread "main" java.lang.NoClassDefFoundError: sun/io/MalformedInputException
at com.netsuite.oautil.UtilTransliterator.OptimizeNewTransliteratorUsingSunIO(Unknown Source)
at com.netsuite.oautil.UtilTransliterator.OptimizeNewTransliteratorUsingVM(Unknown Source)
at com.netsuite.oautil.UtilTransliterator.GetNewTransliterator(Unknown Source)
at com.netsuite.oautil.UtilTransliterator.GetNewTransliterator(Unknown Source)
at com.netsuite.openaccess.ssp.Ssp7.<init>(Unknown Source)
at com.netsuite.openaccess.ssp.Ssp8.<init>(Unknown Source)
at com.netsuite.openaccess.ssp.Ssp9.<init>(Unknown Source)
at com.netsuite.openaccess.ssp.SspFactory.ProcessReply(Unknown Source)
at com.netsuite.openaccess.ssp.SspFactory.GetSsp(Unknown Source)
at com.netsuite.openaccess.ctxt.conn.ConnectionContext.doConnect(Unknown Source)
at com.netsuite.openaccess.ctxt.conn.ConnectionContext.connect(Unknown Source)
at com.netsuite.jdbc.openaccess.OpenAccessImplConnection.open(Unknown Source)
at com.netsuite.jdbc.oabase.BaseConnection.connect(Unknown Source)
at com.netsuite.jdbc.oabase.BaseConnection.setupImplConnection(Unknown Source)
at com.netsuite.jdbc.oabase.BaseConnection.open(Unknown Source)
at com.netsuite.jdbc.oabase.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at connection.DBNetSuite.<init>(DBNetSuite.java:59)
at connection.DBNetSuite.getInstance(DBNetSuite.java:85)
at connection.DBNetSuite.getTableName(DBNetSuite.java:110)
at connection.Main.main(Main.java:12)
Caused by: java.lang.ClassNotFoundException: sun.io.MalformedInputException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 22 more
Disconnected from the target VM, address: '127.0.0.1:54111', transport: 'socket'

Process finished with exit code 1

最佳答案

该 NetSuite 库使用的异常不是 Java API 的一部分,但曾经是 Sun/Oracle Java 实现中内部类的一部分。由于该类不是 API 的一部分,Oracle(以及在此之前的 Sun)可以随意删除它;他们做到了。它不包含在 Java 8 Update 25 中;不知道什么时候被删除了。

这就是为什么不应在应用程序中使用 Java 附带的 sun.*com.sun.*com.oracle.* 包中的类的原因之一,因为它们可能会发生更改,并且可能随时被删除。

您应该询问 NetSuite,他们是否有不使用此类的较新驱动程序。

关于java - NetSuite java.lang.NoClassDefFoundError : sun/io/MalformedInputException on getConnection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26491583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com