-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples中的tars-spring-boot-server运行时报错 #54
Comments
这个需要理提供一下平台上面servant的配置。平台上HttpObj的配置类型是否你正常。再提供一下tras的版本 |
版本应该是:1.7.0-SNAPSHOT,我把commit记下来了:
另外,项目的pom.xml里有个parent的tars-examples版本必须是1.6.1才能编译通过,其它依赖的tars库都是1.7.0-SNAPSHOT,不知道是否有影响。 详细配置如下: |
依赖需要都使用1.7.0。里面的日志库两个版本中并不通用。所以依赖需要使用新版本的依赖库才可以 |
遇到同样问题 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
各位大佬,tars-spring-boot-server运行时报错。看起来像是按tars协议处理了,应该是走非tars协议才对。求帮忙看下,谢谢!
代码:
`package com.qq.tars.quickstart.server;
import com.qq.tars.server.core.ContextManager;
import com.qq.tars.spring.annotation.EnableTarsServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.qq.tars.spring.annotation.TarsHttpService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@EnableTarsServer
@TarsHttpService("HttpObj")
@RestController
public class QuickStartApplication {
public static void main(String[] args) {
SpringApplication.run(QuickStartApplication.class, args);
}
@RequestMapping(path = "/test")
public String test() {
return "hello world";
}
}`
启动时有报这个错,但能正常启动,端口监听也正常。
Exception in thread "ServantThreadPool-exec-null-1" java.lang.NoClassDefFoundError: com/qq/tars/server/core/ContextManager at com.qq.tars.server.core.TarsServantProcessor.process(TarsServantProcessor.java:180) at com.qq.tars.net.core.nio.WorkThread.run(WorkThread.java:80) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: com.qq.tars.server.core.ContextManager at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:92) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 5 more
收到http请求后,服务报的错如下。看起来像是按tars协议处理了,应该是走非tars协议才对。
com.qq.tars.net.protocol.ProtocolException: the length header of the package must be between 0~10M bytes. data length:504f5350 at com.qq.tars.rpc.protocol.tars.TarsCodec.decodeRequest(TarsCodec.java:254) at com.qq.tars.net.core.nio.TCPSession.readRequest(TCPSession.java:119) at com.qq.tars.net.core.nio.TCPSession.read(TCPSession.java:97) at com.qq.tars.net.core.nio.TCPAcceptor.handleReadEvent(TCPAcceptor.java:77) at com.qq.tars.net.core.nio.Reactor.dispatchEvent(Reactor.java:183) at com.qq.tars.net.core.nio.Reactor.run(Reactor.java:104)
The text was updated successfully, but these errors were encountered: