我在 j2ee 应用程序中运行 spring 时遇到一些问题。
简短介绍:
我使用WebSphere 6.1(我不知道这是websphere特定的还是更普遍的问题)
文物:
- Web 应用程序(war),其中 WEB-INF/lib 文件夹中的 maven 发布了所有需要的 spring 依赖项。
- 然后将war打包到ear中并部署到应用服务器上。
I don't应用程序中尚有任何 spring 配置文件或对 spring 的引用。里面只有jar文件WEB-INF/lib
没有更多关于春天的事情了。
当应用程序部署并且应用程序开始加载应用程序服务器时,开始查找一些 spring 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
它想通过上面指定的 url 从互联网上获取它们。
问题:
如何强制应用程序服务器使用本地的模式(在网络存档中)?
或者也许根本禁用此检查?
另一方面,当应用程序启动时,一切工作都完美(后来我尝试使用 IoC)。
应用程序服务器没有 Internet 连接,并且解析此架构的所有尝试都会导致等待连接超时。
我尝试什么:
Put 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