Skip to content

http add test frameword#261

Merged
AlbumenJ merged 10 commits intoapache:masterfrom
yzz1232:master
Jan 21, 2021
Merged

http add test frameword#261
AlbumenJ merged 10 commits intoapache:masterfrom
yzz1232:master

Conversation

@yzz1232
Copy link
Contributor

@yzz1232 yzz1232 commented Jan 15, 2021

No description provided.

Copy link
Member

@kylixs kylixs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution!

@kylixs
Copy link
Member

kylixs commented Jan 18, 2021

还有一个错误,dubbo-samples-http-jetty启动失败,请检查一下是缺少依赖或者冲突的依赖:

2021-01-17 09:00:51.803:INFO::main: Logging initialized @2846ms to org.eclipse.jetty.util.log.StdErrLog
Error: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletHandler
	at org.apache.dubbo.remoting.http.jetty.JettyHttpServer.<init>(JettyHttpServer.java:77)
	at org.apache.dubbo.remoting.http.jetty.JettyHttpBinder.bind(JettyHttpBinder.java:31)
	at org.apache.dubbo.remoting.http.HttpBinder$Adaptive.bind(HttpBinder$Adaptive.java)
	at org.apache.dubbo.rpc.protocol.http.HttpProtocol.doExport(HttpProtocol.java:110)
	at org.apache.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:87)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:66)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:153)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:62)
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
	at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$2(RegistryProtocol.java:258)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:256)
	at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:209)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:64)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:151)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:60)
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:492)
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:325)
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:300)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:206)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$16(DubboBootstrap.java:943)
	at java.util.HashMap$Values.forEach(HashMap.java:981)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:930)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:749)
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59)
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52)
	at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at org.apache.dubbo.samples.http.HttpProvider.main(HttpProvider.java:29)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.ServletHandler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 38 more

@kylixs
Copy link
Member

kylixs commented Jan 18, 2021

好像是删除了这个依赖导致ClassNotFound,请补上:

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
        </dependency>

还有一个jackson版本冲突的问题,可以参考下面的配置:

    <dependencyManagement>
        <dependencies>

    ....

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.9.10.8</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>2.9.10</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.9.10</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

   ....
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

    </dependencies>

Copy link
Member

@kylixs kylixs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请修复pom依赖问题

@yzz1232
Copy link
Contributor Author

yzz1232 commented Jan 18, 2021

请修复pom依赖问题

请修复pom依赖问题

已修复

Copy link
Member

@kylixs kylixs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution!

@AlbumenJ AlbumenJ merged commit bd4cf46 into apache:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants