简体   繁体   English

关闭Websphere时使用JNDI

[英]using JNDI when websphere is shutdown

I am trying to test my we based project.I have created main method and its call some db related classes.Now the db related classes uses JNDI , so when running the code i get exception 我正在尝试测试我们的基于项目的项目。我创建了main方法并调用了一些与db相关的类。现在与db相关的类使用了JNDI,因此在运行代码时出现异常

Can i use JNDI when websphere server is stopped?If now how can i go about it?i dont want to run entire flow, i want to test my functionality by calling classes from main method Websphere服务器停止时可以使用JNDI吗?如果现在该怎么办?我不想运行整个流程,我想通过从main方法调用类来测试我的功能

You can use "Simple JNDI" for this. 您可以为此使用“简单JNDI”。 Gives you a simple file based JNDI environment well suited for non-EE applications, or in situations where you do not want to occupy the network port. 为您提供一个基于文件的简单JNDI环境,非常适合非EE应用程序,或者您不想占用网络端口的情况。

http://www.osjava.org/simple-jndi/ http://www.osjava.org/simple-jndi/

You cannot use WebSphere's JNDI facilities when the server is in quiescing mode (shutting down). 服务器处于静默方式(关闭)时,不能使用WebSphere的JNDI工具。

I suspect something is a bit off with the way that you're testing your application. 我怀疑您测试应用程序的方式有些偏离。 To help you, you'll have to provide us with more information about your architecture. 为了帮助您,您必须向我们提供有关您的体系结构的更多信息。 Is it a standard servlet-JSP based WebApp that you're testing? 您要测试的是基于servlet-JSP的标准WebApp吗? What does your "main method" look like? 您的“主要方法”是什么样的?

Isaac 以撒

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM