Tomcat 5.5 Axis2应用程序范围问题-无法创建单个实例

发布于 2024-09-24 18:41:37 字数 365 浏览 5 评论 0原文

我在 Tomcat 5.5 上部署了 axis2 Web 服务。 Web 服务按预期运行。但我注意到我收到了重复的日志条目。经过研究后发现,该类的多个实例正在被创建 - 即第一次运行时,一个日志条目;第二次,两次参赛,依此类推。

我添加了scope =“application”参数,但这并没有解决问题。我将其添加到服务标签中并作为单独的参数标签添加,但没有效果。

这个类有许多关键的全局变量,日志记录就是其中之一。尽管我很沮丧,但我仍然没有达到解构全局变量的程度(重大修改,打破了我部门的代码约定)。全局变量是罪魁祸首吗?或者我还缺少其他 Tomcat/Axis2 配置吗?

将根据要求发布 services.xml 或其他代码。

提前致谢 - 比尔

I have deployed an axis2 web service on Tomcat 5.5. The web service functions as expected. But I noticed I was getting duplicated log entries. After researching it became clear that multiple instances of the class were being created - ie the first time it ran, one log entry; second time, two entries and so on.

I added the scope="application" parameter, but that has not solved the problem. I added it both in the service tag and as a separate parameter tag to no avail.

This class has many key global variables, logging being one of them. Frustrated as I am, I still haven't gotten to the point of deconstructing the globals (major overhaul, breaks code conventions in my department). Are global variables the culprit? Or is there some other Tomcat/Axis2 config I am missing?

Will post services.xml or other code upon request.

Thanks in advance - Bill

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秉烛思 2024-10-01 18:41:37

我已经解决了问题...不一定明白为什么,但我现在有了正确的行为...

我作为 Web 服务的一部分创建的 services.xml 文件(WEB-INF/services/myService/META-INF)被 tomcat/conf/server.xml 中的配置覆盖,我之前仅使用上下文块引用 myService。为了使 myService 具有独特的服务级别参数,它必须在 tomcat/conf/server.xml 中有自己的配置...而不仅仅是上下文引用。

在我看来,这不是 server.xml 中最好的配置...服务和上下文。这样就不是动态的。不幸的是,我遵循许多个月前在这里设定的标准,所以我无能为力。

I have solved the problem...don't necessarily understand why but I now have the correct behavior...

The services.xml file I created as part of the web service (WEB-INF/services/myService/META-INF) was being overridden by config in tomcat/conf/server.xml, where I had previously only referred to myService with a context block. In order for myService to have unique service-level parameters, it has to have it's own config in tomcat/conf/server.xml...not just a context reference.

It seems to me that this is not the best config...services and contexts in server.xml. It's not dynamic that way. Unfortunately I am following a standard set here many moons ago, so nothing I can do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文