Coder Social home page Coder Social logo

Comments (20)

Redick01 avatar Redick01 commented on August 16, 2024 1

您好,说下我这变报错的具体信息吧,是创建DubboPropertyConfig这个bean的时候报错,大概是DubboPropertyConfig注入ServletContext的时候找不到要注入的Class,我这边是使用的dubbo2.8.4,并且使用的是tomcat插件通过dubbo发布http服务。

from sayi.github.com.

sakunoo avatar sakunoo commented on August 16, 2024

正好需要,非常感谢作者开源

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

@sakunon 目前还是alpha版本,欢迎共同来完善。-:)

from sayi.github.com.

ZoonChen avatar ZoonChen commented on August 16, 2024

作者有没有讨论群?可以一起交流一下

from sayi.github.com.

ZoonChen avatar ZoonChen commented on August 16, 2024

HttpMatch 中的 findRefMethods(Method[] interfaceMethods, String operationId,String requestMethod) 方法 Collections.sort(ret, new Comparator() {
@OverRide
public int compare(Method o1, Method o2) {
return o2.getParameterCount() - o1.getParameterCount();
}
});
getParameterCount()方法 没有定义
可不可以提交fix一下这个问题

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

@ZoonChen 基于JDK8开发的

from sayi.github.com.

hfq-yangyang-yangyang avatar hfq-yangyang-yangyang commented on August 16, 2024

能否支持springfox

from sayi.github.com.

hfq-yangyang-yangyang avatar hfq-yangyang-yangyang commented on August 16, 2024

用的 docker swaggerapi/swagger-ui
输入input框 http://10.10.11.180:12102/swagger-dubbo/swagger.json 点击 explore按钮。
发现一个不能跨域的问题,
加了 @crossorigin(origins = "*") 问题解决

@controller
@crossorigin(origins = "*")
@RequestMapping("${swagger.dubbo.doc:swagger-dubbo}")
@Api(hidden = true)
public class SwaggerDubboController {

from sayi.github.com.

hfq-yangyang-yangyang avatar hfq-yangyang-yangyang commented on August 16, 2024

跨域解决后就是下面问题

Sayi/swagger-dubbo#13

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

swagger-dubbo V2.0.1 更新日志:

  • 支持最新的dubbo注解方式(@dubbocomponentscan)的服务发现
  • 修复某些情况下Swagger数据以JSON格式暴露,而不是String
  • Spring boot 示例
  • 跨域支持的一种解决方案
  • 修复若干BUG

from sayi.github.com.

Redick01 avatar Redick01 commented on August 16, 2024

你好,支持dubbo2.8.4吗?我这边启动报错~

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

@Redick01 目前官方dubbo最新版本是2.6.2。你的项目应该缺少这个pom:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
</dependency>

from sayi.github.com.

Redick01 avatar Redick01 commented on August 16, 2024

很高兴您能回复我,我在这个之前也试过添加这个依赖包,依然报错。以下是我报错的具体信息,麻烦您抽空看下~
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubboPropertyConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.servlet.ServletContext com.deepoove.swagger.dubbo.config.DubboPropertyConfig.servletContext; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.ServletContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at com.ruubypay.MainClass.main(MainClass.java:27)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.servlet.ServletContext com.deepoove.swagger.dubbo.config.DubboPropertyConfig.servletContext; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.ServletContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 13 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.ServletContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 15 more

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

@Redick01 你是用Main方法启动的,缺少web容器。

HTTP模拟请求需要Web容器。

from sayi.github.com.

xujunhua555 avatar xujunhua555 commented on August 16, 2024

我有个疑问,我目前很多项目上都有dubbo服务,那么我现在想把这些dubbo服务都统一放到swagger-dubbo这个webapp中进行统一展现,这该如何优雅的实现

from sayi.github.com.

Sayi avatar Sayi commented on August 16, 2024

@xujunhua555 我的想法是通过Zookeeper去发现这些服务,然后通过swagger-dubbo暴露API文档。

from sayi.github.com.

xujunhua555 avatar xujunhua555 commented on August 16, 2024

from sayi.github.com.

kclizhiwei avatar kclizhiwei commented on August 16, 2024

在使用dubbo2.5.3(公司硬性要求)和Spring boot整合时,发现ReferenceManager中从ServiceBean时,取不到,有遇到这种情况吗

from sayi.github.com.

finduuu avatar finduuu commented on August 16, 2024

为什么http://localhost:8080/项目名称/swagger-dubbo/swagger.json 这个接口返回的是404,地址错了吗
这个是swagger-dubbo.properties的配置
swagger.dubbo.doc=swagger-dubbo
swagger.dubbo.http=h

swagger.dubbo.application.version = 2.0
swagger.dubbo.application.groupId = com.myhexin.yyzt
swagger.dubbo.application.artifactId = yyzt-cbas-api

#rpc or local
swagger.dubbo.cluster = rpc

swagger.dubbo.enable = true

@Sayi

from sayi.github.com.

TheNorthMemory avatar TheNorthMemory commented on August 16, 2024

Java零注入 DUBBO+SWAGGER纯前端集成方案,只要会写OAS2,就能消费服务

from sayi.github.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.