2010-07-21 24 views
3

我的j2ee应用程序中运行spring有一些问题。WebSphere试图从互联网上加载Spring相关模式

简短的介绍:

我使用WebSphere 6.1(我不知道这是特定于WebSphere或更一般的问题)

工件:

  1. Web应用程序(WAR)在WEB-INF/lib文件夹中maven发布所有需要的spring依赖项。
  2. 然后将战争打包并部署在应用程序服务器上。

有任何spring配置文件或引用应用程序中的春天呢。只是在WEB-INF/lib内的jar文件,没有更多关于春天。

当应用程序部署和应用程序启动时加载的应用程序服务器开始寻找一些春天的XML模式:

http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tool/spring-tool-2.0.xsd http://www.springframework.org/schema/tool/spring-tool-2.5.xsd http://www.springframework.org/schema/tool/spring-tool-3.0.xsd

它希望把他们从互联网上的网址如上所述。

问:

如何强制应用服务器使用位于本地模式(以Web归档)? 或者也许禁用这个检查?

另一方面,当应用程序启动完美的作品(后来我尝试使用IoC)。

应用程序服务器没有互联网连接,所有解决此模式的尝试都会导致等待连接超时。

我做的尝试:

spring.schemas包含的URL映射到位于Web归档到META-INF文件夹模式。所有这些文件(spring.schemas和xml模式)可通过ClassLoader(选中)进行访问。

任何帮助将不胜感激。

/me [stupid j2ee developer]

更新1:

这里是我需要从WebSphere日志文件的准确消息:

[22.07.10 15:45:58:626 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/tool/spring-tool-2.0.xsd: Operation timed out: connect:could be due to invalid address 
[22.07.10 15:46:20:112 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/beans/spring-beans-2.0.xsd: Operation timed out: connect:could be due to invalid address 
[22.07.10 15:46:41:124 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/tool/spring-tool-2.5.xsd: Operation timed out: connect:could be due to invalid address 
[22.07.10 15:47:02:118 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/beans/spring-beans-2.5.xsd: Operation timed out: connect:could be due to invalid address 
[22.07.10 15:47:23:130 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/tool/spring-tool-3.0.xsd: Operation timed out: connect:could be due to invalid address 
[22.07.10 15:47:44:129 MSD] 00000043 XMLParser  W java.net.SocketException occurs during processing http://www.springframework.org/schema/beans/spring-beans-3.0.xsd: Operation timed out: connect:could be due to invalid address 
+0

好*有些东西*正试图取消引用这些模式。当连接超时时,你会得到一个堆栈跟踪,以确定哪个组件正在触发它? – skaffman 2010-07-22 10:13:52

+0

问题已更新 – ProgramWriter 2010-07-22 11:55:29

回答

0

这可能是一个类加载器的问题,即从另一个WAR文件是试图访问Spring模式。或者,应用程序服务器可能会尝试加载web.xml中指定的spring文件。

您可以尝试将spring.schemas和XSD文件放在EAR目录的根目录中。如果任何其他WAR文件试图加载文件,则基于默认的PARENT_FIRST类加载器策略,它应该能够找到模式。为了完全排除类加载器问题,如果上一步没有帮助,请尝试将XSD文件放入JRE/lib/ext目录中的jar文件中,然后重新启动服务器。

1

我有commons验证框架这个问题。我所做的是更改xml文件中的名称空间[它们通常指定的位置],以指向我驻留在Web服务器上的本地版本。对于春天来说,我想这是ApplicationContext.xml。

http://www.springframework.org/schema/beans/spring-beans-2.0.xsd HTTP://yourservername/springns/schema/beans/spring-beans-2.0.xsd

这不是完美的解决方案,但它的工作原理。

让我知道它是怎么回事。