Java – WebSphere attempts to load spring related patterns from the Internet
I encountered some problems running spring in J2EE applications
Brief introduction:
I'm using WebSphere 6.1 (I don't know if it's WebSphere specific or more general)
Workpiece:
>The web application (War) publishes all required spring dependencies in Maven in the WEB-INF / lib folder. > The war is then packaged in the ear and deployed on the application server
I don't have any spring configuration files or spring references in the application Just the jar file is in WEB-INF / lib, not just spring
When the application is deployed and the application starts loading, the application server starts 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 wants to get them from the Internet through the URL specified above
Question:
How do I force the application server to use the local (in the Web Archive) mode? Or may this check be disabled completely?
On the other hand, when the application starts, everything works perfectly (later I tried IOC)
The application server does not have an Internet connection, and all attempts to resolve this schema will cause a connection wait timeout
What I tried:
The spring. Net that will contain the URL mapping Schemas put the schema in the Web Archive into the meta - inf folder Classloader (checked) can access all these files (spring. Schemas and XML schema)
Any help would be appreciated
/I [stupid J2EE developer]
Update 1:
Here is the exact message I got from the 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
Solution
I have this problem with the Commons validator framework What I do is change the namespaces in the XML file [usually specify them] to point to the local version I host on my web server For spring, I guess it's ApplicationContext xml.
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 does work
Let me know what's going on