mina框架需要写一个配置文件。但是这个配置文件写在哪里?是写在spring配置文件里么?我放到spring配置文件中,启动tomcat的时候报错:Error creating bean with name 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' defined in class path resource [applicationContext.xml]: Cannot create inner bean 'org.apache.mina.integration.beans.InetSocketAddressEditor#2cd728' of type [org.apache.mina.integration.beans.InetSocketAddressEditor] while setting bean property 'customEditors' with key [TypedStringValue: value [java.net.SocketAddress], target type [null]]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.mina.integration.beans.InetSocketAddressEditor] for bean with name 'org.apache.mina.integration.beans.InetSocketAddressEditor#2cd728' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.mina.integration.beans.InetSocketAddressEditor
这个怎么回事?他说这个类没有找到?是自己写的么?还有。在mina中。怎么调用业务逻辑层的方法。
那位大侠最好能给发一份demo给我。我的邮箱是helianxin@yeah.net。郁闷中。。很着急。小弟在此谢谢啦!~
2 个解决方案
#1
不懂,友情回贴。。。
#2
兄弟你没有配customEditors
<!-- 构造属性编辑器 -->
<bean
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.net.SocketAddress">
<bean class="org.apache.mina.integration.beans.InetSocketAddressEditor" />
</entry>
<entry key="java.nio.charset.Charset">
<bean class="com.ailk.ea.socket.minaUtil.CharsetEditor" />
</entry>
</map>
</property>
</bean>
#1
不懂,友情回贴。。。
#2
兄弟你没有配customEditors
<!-- 构造属性编辑器 -->
<bean
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.net.SocketAddress">
<bean class="org.apache.mina.integration.beans.InetSocketAddressEditor" />
</entry>
<entry key="java.nio.charset.Charset">
<bean class="com.ailk.ea.socket.minaUtil.CharsetEditor" />
</entry>
</map>
</property>
</bean>