<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core" xmlns:soap="http://cxf.apache.org/bindings/soap" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:jms="http://cxf.apache.org/transports/jms" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schema/bindings/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-local.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" /> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:config.properties</value> </list> </property> </bean> <!-- GTMSShrccAcctService --> <jms:conduit name="{http://swift.service.srcb.com/abstraction/atomic/technical.SendMsg2MpsService/v1}SendMsg2MpsServicePort.jms-conduit"> <jms:clientConfig clientReceiveTimeout="60000" /> <jms:sessionPool lowWaterMark="5" highWaterMark="80" /> <jms:address destinationStyle="queue" jndiConnectionFactoryName="${SendMsg2Mps.jndiConnectionFactoryName}" jndiDestinationName="${SendMsg2Mps.jndiDestinationName}" jndiReplyDestinationName="${SendMsg2Mps.jndiReplyDestinationName}"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="com.sun.jndi.fscontext.RefFSContextFactory" /> <jms:JMSNamingProperty name="java.naming.provider.url" value="${JMSNamingPropertyValue}" /> </jms:address> </jms:conduit> <jaxws:client id="SendMsg2MpsClient" xmlns:s="http://swift.service.srcb.com/abstraction/atomic/technical.SendMsg2MpsService/v1" serviceClass="com.amerisia.ebills.peripheryInterface.client.SendMsg2MpsClient.v1.SendMsg2MpsServicePortType" serviceName="s:SendMsg2MpsService" endpointName="s:SendMsg2MpsServicePort" wsdlLocation="file:src/resourcesWsdl/SWIFT_EBILLS_Client/SendMsg2MpsService.wsdl" address="jms:/"> <jaxws:properties> <!-- 修改默认的SOAP编码 --> <entry key="org.apache.cxf.message.Message.ENCODING" value="utf-8" /> </jaxws:properties> <!-- 增加日志特征 --> <jaxws:features> <bean class="org.apache.cxf.feature.LoggingFeature" /> </jaxws:features> </jaxws:client> </beans>
简单的java类main函数访问
static ApplicationContext context=new ClassPathXmlApplicationContext("resourcesXml/ApplicationContext_jms_SendMsg2MpsClient.xml");
报错:还弹出对话框:
java.lang.ExceptionInInitializerError
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Line 13 in XML document from class path resource [com/amerisia/ebills/peripheryInterface/client/resourcesXml/ApplicationContext_jms_SendMsg2MpsClient.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Element type "beans" must be declared.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:135)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:144)
at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:79)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:249)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56)
at com.amerisia.ebills.peripheryInterface.client.SendMsg2MpsClient.v1.SendMsg2MpsServicePortType_SendMsg2MpsServicePort_Client.<clinit>(SendMsg2MpsServicePortType_SendMsg2MpsServicePort_Client.java:37)
Caused by: org.xml.sax.SAXParseException: Element type "beans" must be declared.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:195)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:128)
... 7 more
求解决方案????