IDEMPIERE-949 Web services is loading spring schema resources from spring web site.

This commit is contained in:
Heng Sin Low 2013-05-22 15:12:26 +08:00
parent bf58706421
commit 5cfb18cd60
4 changed files with 67 additions and 25 deletions

View File

@ -638,6 +638,7 @@ public final class Adempiere
DB.updateMail();
System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
return true;
} // startupEnvironment

View File

@ -10,15 +10,15 @@
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/cxf-rt-frontend-jaxws-2.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/stax2-api-3.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/xmlschema-core-2.0.3.jar" sourcepath="E:/spring/xmlschema-core-2.0.3-sources.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/cxf-2.6.2.jar" sourcepath="E:/bizzidium/apache-cxf-2.6.2-src.zip"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/cxf-2.6.2.jar" sourcepath="WEB-INF/lib/src/apache-cxf-2.6.2-src.zip"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/neethi-3.0.2.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/wsdl4j-1.6.2.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-expression-3.0.7.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-asm-3.0.7.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-core-3.0.7.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-beans-3.0.7.RELEASE.jar" sourcepath="E:/spring/spring-beans-3.0.7.RELEASE-sources.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-beans-3.0.7.RELEASE.jar" sourcepath="WEB-INF/lib/src/spring-beans-3.0.7.RELEASE-sources.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-context-3.0.7.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-web-3.0.7.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/spring-web-3.0.7.RELEASE.jar" sourcepath="WEB-INF/lib/src/spring-web-3.0.7.RELEASE-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="WEB-INF/src"/>

View File

@ -0,0 +1,32 @@
/**
*
*/
package com.trekglobal.ws;
import javax.servlet.ServletContextEvent;
/**
* @author hengsin
*
*/
public class ContextLoaderListener extends
org.springframework.web.context.ContextLoaderListener {
/**
*
*/
public ContextLoaderListener() {
}
@Override
public void contextInitialized(ServletContextEvent event) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
super.contextInitialized(event);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
}

View File

@ -3,29 +3,38 @@
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<init-param>
<param-name>config-location</param-name>
<param-value>/META-INF/cxf/services.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/META-INF/cxf/services.xml
</param-value>
</context-param>
<listener>
<listener-class>
com.trekglobal.ws.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
</web-app>
<!-- END SNIPPET: webxml -->