Wie löst man so/io/MalformedInputException während der JNDI-lookup auf remote-WebSphere
Ich benutze WebSphere 8.5, meine host-Anwendung und konfiguriert einige JDBC-Ressourcen auf dem Anwendungsserver.
Auch ich entwickelte eine client-Anwendung, die mithilfe des thin-client-runtime-Bibliothek.
Wenn Sie die JNDI-look-up erfolgt in der folgenden Weise:
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:serv:2809");
Context initialContext = new InitialContext(env);
DataSource ds = (DataSource) initialContext.lookup("cell/node/servers/server/MYDB");
wird folgende Ausnahme ausgegeben:
java.lang.NoClassDefFoundError: sun/io/MalformedInputException
at com.ibm.rmi.iiop.CDRReader.getTcsCConverter(CDRReader.java:451)
at com.ibm.rmi.iiop.CDRReader.readStringOrIndirection(CDRReader.java:532)
at com.ibm.rmi.iiop.CDRReader.read_string(CDRReader.java:518)
at com.ibm.rmi.IOR.read(IOR.java:337)
at com.ibm.rmi.iiop.Connection._locate(Connection.java:531)
at com.ibm.rmi.iiop.Connection.locate(Connection.java:490)
at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:229)
at com.ibm.rmi.corba.Corbaloc.locateUsingINS(Corbaloc.java:307)
at com.ibm.rmi.corba.Corbaloc.resolve(Corbaloc.java:378)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3796)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3263)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3694)
at com.ibm.ws.naming.util.WsnInitCtxFactory.stringToObject(WsnInitCtxFactory.java:1645)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getWsnNameService(WsnInitCtxFactory.java:1502)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1040)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(Unknown Source)
at ch.bit.easy.wf.util.Database.getConnection(Database.java:74)
at ch.bit.easy.wf.ops.test.TestDBAccess.testSuccessfullyLimitedQuery(TestDBAccess.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: sun.io.MalformedInputException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
- Hast du falsch verstanden, das problem. Es ist ein NoClassDefFoundError.
- Diese Klasse sollte in das JDK. Sie verwenden wahrscheinlich die falsche JDK (vielleicht 8) zum starten des client.
- möglich, Duplikat der sun/io/MalformedInputException beim Versuch, eine Remote-Verbindung zu JMS-Warteschlange, die auf websphere
- Hi @user1498635, haben Sie einen Weg gefunden, dieses problem zu lösen, ohne Umschalten form von Java 8 auf Java 7?
- leider nicht. Das problem wurde gelöst, der Wechsel zu Java 8.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Wenn Sie wollen, verwenden Sie die Oracle JDK 8.0 mit IBM Websphere, versuchen Sie zu ersetzen 'ibmorb.jar" in den classpath auf eine neuere (die mit new java.nio.charset.MalformedInputException Klasse).
Finden Sie es hier:
Hoffe, dass diese Hilfe.
Im Fall von Sterling Commerce agents(Sterling 9.5 mit JDK 8), erhalten Sie möglicherweise die unten Ausnahme beim starten des Agenten/Integration-Server.
Ursache : In JDK 8 , MalformedInputException wurde verschoben, auf ein anderes Paket und sterling noch erwarten, in der gleichen packance werfen diesen Fehler.
*
*
Lösung :
Nehmen Sie die rt.jar aus früheren java-Versionen(1.6 oder 1.7), in der Sonne.io.MalformedInputException noch im gleichen Paket wie sterling erwartet und machen die Thirdparty installation der jar.
Es funktioniert 🙂