Giter VIP home page Giter VIP logo

xdiamond's Issues

mvn exec:java -Dexec.mainClass="io.github.xdiamond.example.ClientExampleMain"运行报错

[WARNING]
java.lang.ClassNotFoundException: io.github.xdiamond.example.ClientExampleMain
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:36 min

把 crash.cli 显式地加到依赖里

有些用户在编绎时,不能通过。发现是 crash.cli 并没有引入。可能是某些maven仓库同步出错了。

<dependency>
    <groupId>org.crashub</groupId>
    <artifactId>crash.cli</artifactId>
    <version>1.3.1</version>
</dependency>

在官方的maven仓库里是通过crash.embed.spring直接引入了的。

        <dependency>
            <groupId>org.crashub</groupId>
            <artifactId>crash.embed.spring</artifactId>
            <version>1.3.1</version>

xdiamond 连接server报错

[ERROR] io.github.xdiamond.client.XDiamondConfig - load xdiamond config from server error! test|captcha|1.0|product
java.util.concurrent.TimeoutException: null
at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:49)
at io.github.xdiamond.client.XDiamondConfig.init(XDiamondConfig.java:127)

[INFO] io.github.xdiamond.client.net.XDiamondClient - Reconnecting to 10.0.0.97:8804
[INFO] io.github.xdiamond.client.net.XDiamondClient - connection to 10.0.0.97:8804 success.

[WARN] org.springframework.context.annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xDiamondConfig' defined in class path resource [spring-context-springboot-example.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException

springboot配置xdiamond的多环境,如何实现?

spring-xdiamond配置文件的注入方式如下:

@SpringBootApplication()
@EnableScheduling
@ImportResource("classpath:spring-xdiamond-springboot.xml")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
我想将xdiamond.server.ip,port等参数通过application.properties配置,可以吗?
因为项目中由dev,product等等多套环境,每次上线都需要手动替换spring-xdiamond的配置IP,好麻烦啊!
求教!

讨论一些需求,想法

权限控制:
权限控制是参考gitlab来做的,把开发者区分的develop, master, owner级别,只能对应级别的开发者才可以看到对应级别的profile的配置。

不过有这样的需求,提供只读权限。比如某些开发人员可以查看线上的配置,但是他不能修改。

断开重连问题

`
void channelUnregistered(final ChannelHandlerContext ctx) {
currentRetryTimes++;
if (currentRetryTimes > maxRetryTimes) {
return;
}

int currentRetryInterval = retryIntervalSeconds;
if (bBackOffRetryInterval) {
  // 注意currentRetryInterval 可能会溢出
  currentRetryInterval = retryIntervalSeconds * (currentRetryTimes >= 30 ? 1 << 30 : 1 << currentRetryTimes);
  if (currentRetryInterval <= 0) {
    currentRetryInterval = maxRetryIntervalSeconds;
  }
}
if (currentRetryInterval > maxRetryIntervalSeconds) {
  currentRetryInterval = maxRetryIntervalSeconds;
}
logger.info("Waiting for " + currentRetryInterval + "s to reconnect");

final EventLoop loop = ctx.channel().eventLoop();
loop.schedule(new Runnable() {
  @Override
  public void run() {
    logger.info("Reconnecting to {}:{}", serverAddress, port);
    configureBootstrap(new Bootstrap(), loop).connect().addListener(new FutureListener<Void>() {
      @Override
      public void operationComplete(Future<Void> future) throws Exception {
        if (!future.isSuccess()) {
          logger.error("can not connection to {}:{}", serverAddress, port, future.cause());
        } else {
          logger.info("connection to {}:{} success.", serverAddress, port);
        }
      }
    });
  }
}, currentRetryInterval, TimeUnit.SECONDS);

}
`

这里首次断开后,只会重连一次吗? 如果这次也连不上,后面就不做任何处理了。。。

包依赖问题

工程里面有几处依赖包问题导致无法编译
org.springframework:spring:jar:2.5.6.SEC03 (对应源文件CacheConfig)
javax.servlet.api:servlet-api:2.4 (对应源文件WebConfigurer)

xdiamond-server/src/main/resources/my-ehcache.xml 里面有一行dtd的配置,需要删除掉

删除掉这一行,避免启动时要连网下载:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd">

否则会抛出异常:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.sf.ehcache.CacheManager]: Factory method 'cacheManager' threw exception; nested exception is net.sf.ehcache.CacheException: Error configuring from input stream. Initial cause was http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd

使用客户端高级配置bSyncToSystemProperties没有生效

试了一下客户端高级配置:bSyncToSystemProperties,发现源码中对于这个属性是这样解析的:
if (!StringUtils.isEmpty(bSyncToSystemProperties)) { bSyncToSystemProperties = helper.replacePlaceholders(bSyncToSystemProperties, properties); xDiamondConfig.setbSyncToSystemProperties(Boolean.getBoolean(bSyncToSystemProperties)); }
在spring中这样配置:
<bean id="xDiamondConfig" class="io.github.xdiamond.client.spring.XDiamondConfigFactoryBean"> ... <property name="bSyncToSystemProperties" value="true" /> </bean>
这样写属性注入失败(实际并没有拿到true,而是null),Boolean.getBoolean(name)方法是从环境变量中获取value,而实际是直接注入了值"true",这里似乎应该改为Boolean.valueOf(),是我使用有误还是?
不过还是要说,xdiamond很好很强大 :)

spring boot的java config配置问题

参考了作者的 https://github.com/hengyunabc/xdiamond/wiki/%E6%94%AF%E6%8C%81spring-boot%E9%87%8C%E7%9A%84@ConfigurationProperties 里面的xml配置,想做个java config配置,使用@bean实例化XDiamondConfigFactoryBean,但是读取命令行参数时总是失败。比如--xdiamond.serverHost=127.0.0.1,这个参数要应用到XDiamondConfigFactoryBean的serverHost属性,但是总是为空,请问是什么引起的,该怎么解决这个问题?谢谢

不断产生config的临时文件

windows下xdiamond服务端启动的时候,会在目录下C:\Users\Administrator.xdiamond不断生成以config前缀的临时文件,如:config8560528275070450078.tmp。
你们有什么解决方案吗?

编译不过----org.crsh.cli.impl不存在

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project xdiamond-server: Compilation failure: Compilation failure:
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[35,25] 程序包org.crsh.cli.impl不存在
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[36,36] 程序包org.crsh.cli.impl.completion不存在
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[37,24] 程序包org.crsh.cli.spi不存在
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[198,13] 找不到符号
[ERROR] 符号: 类 CompletionMatch
[ERROR] 位置: 类 io.github.xdiamond.web.crash.CRaSHConnector
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[199,13] 找不到符号
[ERROR] 符号: 类 Completion
[ERROR] 位置: 类 io.github.xdiamond.web.crash.CRaSHConnector
[ERROR] xdiamond/xdiamond-server/src/main/java/io/github/xdiamond/web/crash/CRaSHConnector.java:[200,13] 找不到符号
[ERROR] 符号: 类 Delimiter
[ERROR] 位置: 类 io.github.xdiamond.web.crash.CRaSHConnector
[ERROR] -> [Help 1]

用户使用案例收集

非常感谢使用xdiamond的用户。

如果可以的话,请在留言里写上你们使用的公司名(不方便的话,可以匿名),接入的项目数量等,这对于开发者一说,是很大的鼓励!非常感谢!

关于用户权限的问题

增加用户的时候,为什么会增加一个用户组?

删除用户组的时候,数据库数据删除的不够干净。关联数据无法删除

默认登录验证方式

默认验证是ldap,默认选中是在js里面控制的吗?
没有找到在哪里,能指点一下吗?

xdiamond-server的CRaSHConnector报错

import org.crsh.cli.impl.Delimiter;
import org.crsh.cli.impl.completion.CompletionMatch;
import org.crsh.cli.spi.Completion;
这三个引入报错,The import org.crsh.cli cannot be resolved

安装部署启动tomcat报错Error while adding the mapper 'interface io.github.xdiamond.persistence.ProjectMapper' to configuration.

org.mybatis.spring.mapper.MapperFactoryBean - Error while adding the mapper 'interface io.github.xdiamond.persistence.ProjectMapper' to configuration.
org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.cache.CacheException: Could not instantiate cache implementation (class io.github.hengyunabc.mybatis.FacadeCache). Cause: java.lang.reflect.InvocationTargetException
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.loadXmlResource(MapperAnnotationBuilder.java:164) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:118) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:71) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:651) ~[mybatis-3.2.7.jar:3.2.7]

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.