问题描述
javax.naming.ServiceUnavailableException [Root exception is java.net.UnknownHostException: Unknown protocol: 'H3']at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:34)at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:783)at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:367)at weblogic.jndi.Environment.getContext(Environment.java:315)at weblogic.jndi.Environment.getContext(Environment.java:285)at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)at javax.naming.InitialContext.init(InitialContext.java:223)at javax.naming.InitialContext.<init>(InitialContext.java:197)at com.test.Test.main(Test.java:25)Caused by: java.net.UnknownHostException: Unknown protocol: 'H3'at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:213)at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:352)... 8 more使用weblogic11g自带的连接池配置mysql的时候,说找不到H3的协议,。。。 问题补充:lerous 写道
解决方案
没有H3吧,应该是T3,改了试试下面可提供参考:public static InitialContext getInitialContext() throws NamingException { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); env.put(Context.PROVIDER_URL,"t3://localhost:7001"); InitialContext context = new InitialContext(env); return context; }
解决方案二:
把代码拿来看看嘛at com.test.Test.main(Test.java:25)
解决方案三:
你配置错了吧?没有H3协议,应该是JNDI才对