发表于: 2017-06-01 23:31:51
3 1256
今天完成的事:
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="StuService" targetNamespace="http://StuService">
<component name="StuComponent">
<implementation.spring location="spring-tuscany.xml"/>
<service name="StuService" >
<tuscany:binding.rmi uri="rmi://127.0.0.1:8088/StuService"/>
</service>
</component>
<?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:sca="http://www.springframework.org/schema/sca"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/sca
http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd" >
<sca:service name="StuService" type="com.jnshu.service.StudentService" target="StuService"/>
<bean id="StuService" name="StuServcie" class="com.jnshu.impl.StudentServiceImpl"/>
<import resource="spring-mybatis.xml"/>
</beans>
Node node = NodeFactory.newInstance().createNode("Calculator.composite");
node.start();
System.out.println("service启动");
StudentService c= (StudentService) Naming.lookup("//localhost:8099/StuService");
明天计划的事:
遇到的问题:
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring-mybatis.xml]
Offending resource: class path resource [spring-tuscany.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-mybatis.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
尝试解决
都未成功,然后放了一个大招【重启电脑】 依然不见效果
收获:无
总结:无奈。
评论