Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reg:zookeeper标签不支持spel表达式 #129

Closed
yygymmmmsee opened this issue Sep 5, 2016 · 1 comment
Closed

reg:zookeeper标签不支持spel表达式 #129

yygymmmmsee opened this issue Sep 5, 2016 · 1 comment

Comments

@yygymmmmsee
Copy link

yygymmmmsee commented Sep 5, 2016

在XML文件中配置

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:reg="http://www.dangdang.com/schema/ddframe/reg"
    xmlns:job="http://www.dangdang.com/schema/ddframe/job"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.dangdang.com/schema/ddframe/reg
                        http://www.dangdang.com/schema/ddframe/reg/reg.xsd
                        http://www.dangdang.com/schema/ddframe/job
                        http://www.dangdang.com/schema/ddframe/job/job.xsd
                        ">
    <!--配置作业注册中心 -->

    <reg:zookeeper id="registryCenter" server-lists="#{environment['elasticjob.zookeeper.regCenter']}" namespace="elasticjob/elasticjob-test" base-sleep-time-milliseconds="1000" max-sleep-time-milliseconds="3000" max-retries="3" />

    <!-- 配置作业-->
    <job:simple id="testSpringBootElasticJob" class="cn.com.job.TestElasticJob" registry-center-ref="regCenter" cron="0/10 * * * * ?"   sharding-total-count="3" sharding-item-parameters="" />
</beans>

application.properties

elasticjob.zookeeper.regCenter=127.0.0.1:2182

启动时抛出异常:

2016-09-05 19:49:48 [ERROR] o.a.c.f.imps.CuratorFrameworkImpl - Background exception was not retry-able or retry gave up
java.net.UnknownHostException: #{environment['elasticjob.zookeeper.regCenter']}: unknown error
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_77]
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_77]
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_77]
    at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_77]
    at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_77]
    at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_77]
    at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61) ~[zookeeper-3.4.6.jar:3.4.6-1569965]
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445) ~[zookeeper-3.4.6.jar:3.4.6-1569965]
    at org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(DefaultZookeeperFactory.java:29) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl$2.newZooKeeper(CuratorFrameworkImpl.java:150) ~[curator-framework-2.10.0.jar:na]
    at org.apache.curator.HandleHolder$1.getZooKeeper(HandleHolder.java:94) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.HandleHolder.getZooKeeper(HandleHolder.java:55) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.ConnectionState.reset(ConnectionState.java:218) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.ConnectionState.start(ConnectionState.java:103) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.CuratorZookeeperClient.start(CuratorZookeeperClient.java:190) ~[curator-client-2.10.0.jar:na]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:259) ~[curator-framework-2.10.0.jar:na]
    at com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:104) [elastic-job-core-1.1.1.jar:na]
    at com.dangdang.ddframe.reg.spring.namespace.SpringZookeeperRegistryCenter.postProcessBeanFactory(SpringZookeeperRegistryCenter.java:78) [elastic-job-spring-1.1.1.jar:na]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284) [spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:181) [spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) [spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) [spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at cn.com.sina.alan.ea.EaElasticJobApp.main(EaElasticJobApp.java:16) [classes/:na]
2016-09-05 19:49:57 [ERROR] o.springframework.boot.SpringApplication - Application startup failed
com.dangdang.ddframe.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
    at com.dangdang.ddframe.reg.exception.RegExceptionHandler.handleException(RegExceptionHandler.java:47) ~[elastic-job-core-1.1.1.jar:na]
    at com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:116) ~[elastic-job-core-1.1.1.jar:na]
    at com.dangdang.ddframe.reg.spring.namespace.SpringZookeeperRegistryCenter.postProcessBeanFactory(SpringZookeeperRegistryCenter.java:78) ~[elastic-job-spring-1.1.1.jar:na]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:181) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at cn.com.sina.alan.ea.EaElasticJobApp.main(EaElasticJobApp.java:16) [classes/:na]
Caused by: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
    at com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:108) ~[elastic-job-core-1.1.1.jar:na]
    ... 12 common frames omitted
@terrymanu terrymanu added the bug label Sep 22, 2016
@terrymanu
Copy link
Member

duplicate with #141

@terrymanu terrymanu added duplicate and removed bug labels Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants