private static InitialContext getInitialContext(String url) throws NamingException { Hashtable<String, String> env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY); env.put(Context.PROVIDER_URL, url); return new InitialContext(env); }
我为添加WebLogic jar添加了以下Maven依赖项
<dependency> <groupId>weblogic</groupId> <artifactId>weblogic</artifactId> <version>12.2.1</version> </dependency> <dependency> <groupId>weblogic</groupId> <artifactId>webservices</artifactId> <version>12.2.1</version> </dependency>
但是maven的依赖性并没有得到解决。我需要添加任何maven存储库吗?
如果还需要什么,谁能给我指点一下吗?
当做
Weblogic在maven存储库中不提供客户端jar工件。你必须得到 wlthint3client.jar WL_HOME\server\lib weblogic服务器的目录。这个jar包含调用weblogic服务器的客户端所需的所有类。
wlthint3client.jar
WL_HOME\server\lib
然后,您可以在您的maven存储库中手动安装它,并在您的 pom.xml
pom.xml
最后,您可以查找 InitialContext 使用 weblogic.jndi.WLInitialContextFactory
InitialContext
weblogic.jndi.WLInitialContextFactory