WebSphere尝试从Internet加载与Spring相关的模式 [英] WebSphere tries to load Spring related schemas from internet

查看:121
本文介绍了WebSphere尝试从Internet加载与Spring相关的模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在j2ee应用程序中运行spring时遇到一些问题.

I have some problem running spring in my j2ee application.

简短介绍:

我使用WebSphere 6.1(我不知道这是Websphere特定或更普遍的问题)

I use WebSphere 6.1 (i don't know that it is websphere specific or more general problem)

工件:

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

还没有在应用程序中没有任何Spring配置文件或对spring的引用.只需在WEB-INF/lib内添加jar文件,而与spring无关.

I don't have any spring configuration files or references to spring in the application yet. Just jar files inside WEB-INF/lib and nothing more about spring.

在部署应用程序并开始加载应用程序服务器时,开始寻找一些spring xml模式:

When application is deployed and application starts loading application server start looking for some spring xml schemas:

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

它想通过上面指定的网址将其从互联网上带走.

It want to took them from internet by url's specified above.

问题:

如何强制应用程序服务器使用本地(在Web存档中)的模式? 还是完全禁用此检查?

How to force application server to use schemas located locally (in web archive)? Or maybe disable this checks at all?

另一方面,当应用程序启动时,所有功能都可以正常运行(后来我尝试使用IoC).

On the other hand when application starts all works perfectly (later i had try to use IoC).

应用程序服务器没有Internet连接,尝试解决该架构的所有尝试都会导致连接超时.

Application server doesn't have internet connection and all attempts to resolve this schemas results in waiting for connection time-out.

我的尝试:

将包含URL映射的spring.schemas放置到位于Web存档中的架构的META-INF文件夹中.所有这些文件(spring.schemas和xml模式)都可以通过ClassLoader访问(选中).

Put spring.schemas containing url's mappings to schemas located in web archive into META-INF folder. All this files (spring.schemas and xml schemas) is accessible by ClassLoader (checked).

任何帮助将不胜感激.

/me [stupid j2ee developer]

更新1:

以下是我从Websphere日志文件中提取的确切消息:

Here is exact messages that i take from websphere log file:

[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

推荐答案

我在Commons Validator框架中遇到了这个问题.我所做的是更改xml文件(通常在其中指定)中的命名空间,以指向我托管在Web服务器上的本地版本.对于春季,我猜是ApplicationContext.xml.

I had this problem with commons validator framework. What I did was to change the namespaces in the xml file [where they are normally specified] to point to a local version that I hosted on my webserver. For spring, I guess it is the ApplicationContext.xml.

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

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

这不是完美的解决方案,但它可以工作.

This is not the perfect solution, but it works.

让我知道怎么回事.

这篇关于WebSphere尝试从Internet加载与Spring相关的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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