Giter VIP home page Giter VIP logo

Comments (20)

nobodyiam avatar nobodyiam commented on May 14, 2024
  1. 外部依赖 - 参见mvn-repo
  2. apollo-client客户端自身,包括apollo-client、apollo-core和apollo-buildtools的jar包以及apollo的pom,可以参考2.8 部署apollo-client

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

大神,还有个问题,就是我本地web项目目前没有使用spring-boot,是用tomcat容器来启动的war包,这样的话在我项目里面怎么配置apollo-configservice的连接地址,我看demo中都是在启动时加参数-Ddev_meta=http://localhost:8080,是需要在tomcat启动脚本里面加这种参数么? 能否在项目中配置连接apollo-configservice? 我看.net版本的是有一个配置文件配置的,请问java的有么?

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

依赖还是有点问题,我把外部依赖和apollo-client那些jar都上传到本地nexus里面了,然后在项目中添加依赖之后,项目中的每个jar都有一个重复的依赖,不知道是哪里错了,您遇到过这种问题么?

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

打包的时候默认会把dev_meta等信息打到apollo-core.jar中的apollo-env.properties的,所以一般情况下不需要通过-Ddev_meta传入的。

如果实在需要加-D参数的话,可以修改tomcat启动脚本。

另一个问题项目中的每个jar都有一个重复的依赖,这个具体是指啥?

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

我现在的问题是项目里面 apollo-client api用不了, 说一下我操作的步骤吧,我下载了外部依赖的jar包(百度云那个),手动上传到私服,然后使用build.sh打包,把apollo-client、apollo-core和apollo-buildtools的jar包以及apollo的pom都手动上传到私服,然后项目里面引入 apollo-client的dependency,然后maven就报错了,看依赖里面 所有的jar都是2份,我现在很纳闷不知道哪里出问题了,还有就是apollo-master的pom报错,我看里面是dependency了一些携程的jar好像找不到

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

不要看ide的显示,pom里面我们是通过maven profile区分是否使用携程特定依赖的。

你把mvn clean compile的错误信息贴出来。

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project apollo-common: Fatal error compiling: 无效的目标发行版: 1.8 -> [Help 1]

编译前几个都是success 到common就failed了,看报错是编译的jdk版本问题

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

编译apollo需要jdk 1.8的,估计是JAVA_HOME设置的不对,看下mvn --version

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

这样的话 我是不是需要重新打包上传 apollo-client相关的jar和pom

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

只要重新上传apollo-core的jar就可以了

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

还有个问题 如果我要用deploy上传到私服,只需要在settings里面配置


<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
             <releases.repo>http://${your_nexus_url}/nexus/content/repositories/${release-repository}</releases.repo>
             <snapshots.repo>http://${your_nexus_url}/nexus/content/repositories/${snapshotrepository}</snapshots.repo>
        </properties>
        ...
</profiles>

就可以么?
apollo的pom中并没有配置 deploy,这样上传会报错

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

apollo的parent pom里面定义了DistributionManagement的,除了指定仓库地址外,还得在settings.xml中指定仓库的用户名和密码。

https://github.com/ctripcorp/apollo/blob/mvn-repo/com/ctrip/framework/framework-parent/1.3.0/framework-parent-1.3.0.pom

刚刚把文档更新了一下,可以看下如何添加用户名和密码。https://github.com/ctripcorp/apollo/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97#28-%E9%83%A8%E7%BD%B2apollo-client

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

大神,还有个问题,
portal上删除项目时提示,‘不能删除私有的项目‘, 开发环境没接sso,默认用户是apollo,这个用户不能删除项目么?

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

私有项目目前不允许删除的

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

apollo管理的项目会每30秒刷一次心跳日志。这个日志能关闭么

2017-04-12 10:37:20,002 DEBUG -  Long polling from ...
2017-04-12 10:37:19,992 DEBUG -  Long polling response...

这种日志

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

日志的关闭通过调整日志的级别就可以了呀,你改一下应用的日志配置呗,对Apollo客户端而言,只要开到WARN级别以上就可以了。

from apollo.

kangpoves avatar kangpoves commented on May 14, 2024

哦 哦 知道了,我之前没配置log4j,都是默认的

from apollo.

CHF00123 avatar CHF00123 commented on May 14, 2024

包已经上传到私服上了,maven工程也引用成功了,但是tomcat启动还是报错:Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/ctrip/framework/apollo/tracer/Tracer

Caused by: java.lang.NoClassDefFoundError: com/ctrip/framework/apollo/tracer/Tracer

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

@CHF00123 你这个是Tracer类加载失败了,应该是一些间接依赖没有引进来,估计是上传私服的时候只传了jar包,没有传pom文件。

建议通过mvn deploy来上传,如果只能手动上传的话,参照一下分布式部署文档中的指引,有好几个文件夹都要上传的。

from apollo.

nobodyiam avatar nobodyiam commented on May 14, 2024

apollo-client已经推送到Maven**仓库, 点击此链接查看

from apollo.

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.