English 中文(简体)
禁用@Webservice 启动时加载
原标题:Disable @Webservice loading during start up

启动时如何禁用@Webservice 装入, 以便在 xfire 中节省一些装载时间?

@Webservice anotement 有一堆服务。 它们都在启动过程中被装入, 导致启动速度缓慢。 如果我在 dev 实例中测试非服务, 我不想加载这些服务。 我在想是否有办法设置系统属性来禁用它 。

最佳回答

当然, 在您的 Web. xml 中, 您在其中配置 xfire 服务器 :

<servlet>
    <servlet-name>xfire</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>-1</load-on-startup>
</servlet>

启动时装货的负值表示服务器仅在集装箱感觉喜欢时才初始化,对大多数集装箱而言,这意味着在第一次请求时初始化。

根据服务器的规格 :

The load-on-startup element indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the web application. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded. If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive 128 integer or 0, the container must load and initialize the servlet as the application is deployed. The container must guarantee that servlets marked with lower integers are loaded before servlets marked with higher integers. The container may choose the order of loading of servlets with the same load-on-start-up value.

因此,请查阅网络容器的文件,以确保在您的情况中,这产生预期的效果。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签