Tomcat 5.5 Axis2应用程序范围问题-无法创建单个实例 [英] Tomcat 5.5 Axis2 application scope problem - Unable to create single instance

查看:94
本文介绍了Tomcat 5.5 Axis2应用程序范围问题-无法创建单个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Tomcat 5.5上部署了axis2 Web服务. Web服务将按预期运行.但是我注意到我正在获取重复的日志条目.经过研究,很明显,正在创建该类的多个实例-即第一次运行该类时,有一个日志条目;第二次,两次输入,依此类推.

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.

我添加了scope ="application"参数,但是并没有解决问题.我在服务标签和单独的参数标签中都添加了它,但无济于事.

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.

此类具有许多关键的全局变量,日志记录是其中之一.就目前而言,我很沮丧,但我仍未达到解构全局变量的目的(重大改革,违反了本部门的代码约定).全局变量是罪魁祸首吗?还是我缺少其他的Tomcat/Axis2配置?

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?

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

Will post services.xml or other code upon request.

预先感谢-比尔

推荐答案

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

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

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

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.

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

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.

这篇关于Tomcat 5.5 Axis2应用程序范围问题-无法创建单个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆