Giter Site home page Giter Site logo

disconf-demos-java's Issues

spring boot的结构被破坏了。

spring boot的无xml配置的思路似乎被打破了。觉得不是很有友好。

@configuration
public class DisConfConfig {

/**
 * 第一次扫描
 * @return
 */
@Bean(destroyMethod="destroy")
public DisconfMgrBean disconfMgrBean(){
	System.out.println("第一次扫描");
	DisconfMgrBean mgb = new DisconfMgrBean();
	mgb.setScanPackage("com.lvmama");
	return mgb;
}

/**
 * 第二次扫描
 * @return
 */
@Bean(initMethod="init",destroyMethod="destroy")
public DisconfMgrBeanSecond disconfMgrBeanSecond(){
	DisconfMgrBeanSecond mgb = new DisconfMgrBeanSecond();
	System.out.println("第二次扫描");
	return mgb;
}

/**
 * 代理文件
 * @return
 */
@Bean
public ReloadablePropertiesFactoryBean factroyBean(){
	ReloadablePropertiesFactoryBean bean = new ReloadablePropertiesFactoryBean();
	List<String> files = new ArrayList<String>();
	files.add("application.properties");
	bean.setLocations(files);
	System.out.println("reload config 文件");
	return bean;
}

@Bean
public PropertyPlaceholderConfigurer configurer(ReloadablePropertiesFactoryBean propertiesBean){
	
	PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
	configurer.setIgnoreResourceNotFound(true);
	configurer.setIgnoreUnresolvablePlaceholders(true);
	try {
		configurer.setPropertiesArray(propertiesBean.getObject());
	} catch (IOException e) {
		e.printStackTrace();
	}
	return configurer;
}

}

standalone-demo打可执行jar报错,maven3.0.4,jdk1.8,执行mvn clean package

[ERROR] Failed to execute goal com.github.knightliao.plugin:starter-shade-maven-plugin:1.0.0:shade (default) on project disconf-standalone-demo: Error creating shaded jar: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.knightliao.plugin:starter-shade-maven-plugin:1.0.0:shade (default) on project disconf-standalone-demo: Error creating shaded jar: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:546)
at org.apache.maven.plugins.shade.mojos.StarterShade.execute(StarterShade.java:118)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.ClassCastException: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession
at org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder.buildDependencyGraph(Maven31DependencyGraphBuilder.java:99)
at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:91)
at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:66)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.updateExcludesInDeps(ShadeMojo.java:1126)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.rewriteDependencyReducedPomIfWeHaveReduction(ShadeMojo.java:1053)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.createDependencyReducedPom(ShadeMojo.java:969)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:538)
... 22 more

单机版demo 部署失败

/opt/disconf/starter-run/env:行1: $'\r': 未找到命令
/opt/disconf/starter-run/env:行3: $'\r': 未找到命令
/opt/disconf/starter-run/env:行8: $'\r': 未找到命令

log_1490175839.log 2>&1 &jar:logback.xml:ParallelGCThreads=2PermSize=128m -XX:ReservedCodeCacheSize=64m

spring-boot demo url

你好,我安装了disconf-spring-boot-demo,请问web端口和路径是?我试了localhost:8080和8081都不行

springboot打包成war运行时下载不到配置文件

disconf版本2.6.36
文档说2.6.33版本起已经解决springboot jar包方式运行取文件路径的问题
但我这边因为里面有jsp文件,所以要打包成War,然后启动时会报找不到application.yml文件,这个文件我是托管在disconf中,本地用代码方式直接运行是可以取到,但一打包成War就不行了。

在eclipse中启动项目,disconf保错

问题描述:
在Eclipse,使用maven启动web项目时,其disconf保错,具体信息如下:
java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut anyPublicMethod

 但如打包成war包,则可在tomcat中正常启动。
 另如使用STS则可启动成功。

环境信息:
disconf版本:2.6.32
xml配置信息:





<bean id="configproperties_no_reloadable_disconf"
  class="com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean">
    <property name="locations">
        <list>
            <value>classpath:jdbc.properties</value>
            <value>classpath:systemconfig.properties</value>
        </list>
    </property>
</bean>

<bean id="propertyConfigurerForProject1"
  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="ignoreResourceNotFound" value="true"/>
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="propertiesArray">
        <list>
            <ref bean="configproperties_no_reloadable_disconf"/>
        </list>
    </property>
</bean>

编译disconf-standalone-demo失败

mvn clean package 报错如下:
Failed to execute goal com.github.knightliao.plugin:starter-shade-maven-plugin:1.0.0:shade (default) on project disconf-standalone-demo: Error creating shaded jar: org.sonatype.aether.util.DefaultRepositorySystemSession cannot be cast to org.eclipse.aether.RepositorySystemSession -> [Help 1]
请问这个错误是什么情况?请指教!

怎么让 disconf 托管 applicationContext.xml 中的dubbo 注册地址?

您好!
我的业务场景是这样的
项目使用 dubbo,微服务很多,所以想有一个统一的配置中心。
applicationContext.xml 中配置了 dubbo的一些配置,比如dubbo注册中心地址我想通过 disconf 来管理
但现在发现启动时会报错,说解析不了${zookeeper.host},这里的zookeeper.host是我在 disconf 上传的配置文件中的一个配置项
期待您的回复!

以下的是我的 disconf.xml 内容





<!-- 使用托管方式的disconf配置(无代码侵入, 配置更改会自动reload)-->
<bean id="configproperties_disconf"
      class="com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean">
    <property name="locations">
        <list>
            <value>classpath*:resources.properties</value>
        </list>
    </property>
</bean>

<bean id="propertyConfigurer"
      class="com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer">
    <property name="ignoreResourceNotFound" value="true"/>
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="propertiesArray">
        <list>
            <ref bean="configproperties_disconf"/>
        </list>
    </property>
</bean>

<aop:aspectj-autoproxy proxy-target-class="true"/>

其中resources.properties是我放置相关配置项的属性文件

以下是我的 disconf.properties

# 是否使用远程配置文件
# true(默认)会从远程获取配置 false则直接获取本地配置
disconf.enable.remote.conf=true

# 配置服务器的 HOST,用逗号分隔  127.0.0.1:8000,127.0.0.1:8000
disconf.conf_server_host=192.168.1.199:9527

# 版本, 请采用 X_X_X_X 格式
disconf.version=1.0

# APP 请采用 产品线_服务名 格式
disconf.app=yycx_v2.4

# 环境
disconf.env=local

# debug
disconf.debug=true

# 忽略哪些分布式配置,用逗号分隔
disconf.ignore=

# 获取远程配置 重试次数,默认是3次
disconf.conf_server_url_retry_times=1

# 获取远程配置 重试时休眠时间,默认是5秒
disconf.conf_server_url_retry_sleep_seconds=1

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.