[Logo] The Limax project
  [Search] 搜索   [Recent Topics] 最新主题   [Hottest Topics] 热门主题   [Members]  会员列表   [Groups] 返回首页 
[Register] 会员注册 / 
[Login] 登入 
文章发表人是: fly
论坛首页 » 个人资料 fly » 文章发表人是 fly
发表人 内容
switcher使用的是默认的监听端口,监听provider是10100,监听客户端是10000
服务器provider设置也是10100
自己写的demo,已启动服务器和limax.jar,客户端控制台输出:
onManagerInitialized limax.endpoint.EndpointConfigBuilderImpl$2 limax.endpoint.EndpointManagerImpl
onSocketConnected
onKeyExchangeDone
onErrorOccured 0 16 null
onAbort limax.net.StateTransportImpl (/127.0.0.1:49311-/127.0.0.1:10000) java.io.IOException: the channel has reached end-of-stream
onManagerUninitialized limax.endpoint.EndpointManagerImpl

跟文档上描述的输出不一致,onErrorOccured提示source=0,code=16,查了下是SWITCHER_LOST_PROVIDER错误
跟进去查了一下,是这个地方返回错误了:
synchronized int checkProvidersReady(Map<Integer, Byte> pvids) {
for (Map.Entry<Integer, Byte> e : pvids.entrySet()) {
ProviderArgs args = getProviderArgs(e.getKey());
if (null == args)
return ErrorCodes.SWITCHER_LOST_PROVIDER;

请问该如何解决?

example.server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="example" xmlnsi="http://www.w3.org/2001/XInclude">
<xi:include href="example.share.xml" />
<state name="Server">
<namespace ref="share" />
</state>
<service name="ExampleServer" useGlobalId="false" useZdb="false">
<manager name="ExampleServer" type="provider" initstate="Server" port="10100"/>
</service>
</project>

example.client.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="example" xmlnsi="http://www.w3.org/2001/XInclude">
<xi:include href="example.share.xml" />
<state name="Client">
<namespace ref="share" />
</state>
<service name="ExampleClient">
<manager name="ExampleClient" type="client" initstate="Client" port="10000"/>
</service>
</project>

private ClientManagerImpl(ClientManagerConfig config, final ClientListener listener, Manager wrapper)
throws Exception {
this.config = config;
this.listener = listener;
this.wrapper = wrapper;
this.dispatcher = config.getDispatcher();

Throwable t = dispatcher.run(new Dispatchable() { // 这个地方出错,this.dispatcher为null
操作步骤如下:
1. 运行sample.bat,生成项目gen、src;
2. eclipse导入sampleclient和sampleserver;
3. 依次运行auany,globalid,limax;
4. sampleserver目录下创建zdb目录,启动sampleserver,正常;
5. 启动sampleclient,这时候出现错误:
Exception in thread "main" java.lang.NullPointerException
at limax.net.ClientManagerImpl.<init>(ClientManagerImpl.java:76)
at limax.net.ClientManagerImpl.<init>(ClientManagerImpl.java:70)
at limax.net.ClientManagerImpl$1.newInstance(ClientManagerImpl.java:30)
at limax.net.Engine.add(Engine.java:154)
at limax.net.Engine.add(Engine.java:169)
at Main.main(Main.java:71)

配置都是用的默认的xml配置文件,未做任何改动,ip为本地127.0.0.1,端口默认的10000
需要怎么改才能正确启动?
2015-11-13 16:11:58.423 WARN <limax.net.io.NetModel.processPool.13> ExampleServer limax.net.StateTransportImpl (/127.0.0.1:29720-/127.0.0.1:43400) process Exception : 0000000080830280802e002f1778a694fc3c457e8d938d2d470fb79c31ef2a22816017550689e3701452a22fb8f70b1a2bee9fc874b90a11416c07ce8933299dd9251022739ecc1770c69323647a0ec842fd5987fdc41c13dfee646e92f0d4082b79005dcefd327990880a1611e7daa63010601c5d4ab4215aa8f9a5f99405bcf622bcfb9a9ae98ff1
limax.codec.CodecException: limax.codec.CodecException: unknown protocol (0, 131)
at limax.net.StateTransportImpl$CodecSink.update(StateTransportImpl.java:196)
at limax.net.StateTransportImpl.process(StateTransportImpl.java:47)
at limax.net.io.NetTaskImpl.onExchange(NetTaskImpl.java:297)
at limax.net.io.NetTaskImpl.run(NetTaskImpl.java:112)
at limax.util.HashExecutor$SerialExecutor$1.run(HashExecutor.java:69)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at limax.util.ConcurrentEnvironment$Worker.run(ConcurrentEnvironment.java:197)
Caused by: limax.codec.CodecException: unknown protocol (0, 131)
at limax.net.State.decode(State.java:133)
at limax.net.StateTransportImpl$CodecSink.update(StateTransportImpl.java:194)
... 8 more

demo跟系统提供的sample基本一致,服务器能run起来了,能够进行监听
但是客户端一连接服务器,还没有进行任何协议的发放,服务器端就显示如上错误,不知道是什么原因


 
论坛首页 » 个人资料 fly » 文章发表人是 fly
前往:   
Powered by JForum 2.1.9 © JForum Team