小编Sta*_*ash的帖子

Apache Ignite在启动时挂起

我们在grails应用程序中使用apache ignite v2.2作为hibernate二级缓存.我们有4个节点集群,每个集群有10G RAM.第一个节点启动正常.但随后挂起了.有时第二次有时是第三或第四次 同样成功的创业公司也会发生但非常罕见 应用程序始终挂在同一个地方:

"host-startStop-1" #45 daemon prio=5 os_prio=0 tid=0x00007f7cac004800 nid=0x3d44 waiting on condition [0x00007f7cfdd81000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:338)
        at org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:216)
        at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:158)
        at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:150)
        at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager.onKernalStart(GridCachePartitionExchangeManager.java:551)
        at org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:843)
        at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1040)
        at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1896)
        at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1648)
        - locked <0x00000007890a1198> (a org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance)
        at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1076)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:596)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:520)
        at org.apache.ignite.Ignition.start(Ignition.java:322)
Run Code Online (Sandbox Code Playgroud)

在此过程中,所有其他节点都被锁定.组态:

IgniteConfiguration configuration = new IgniteConfiguration()
        List<CacheConfiguration> cacheConfigurations = []
        for (String name : caches) {
            CacheConfiguration cacheConfiguration = new CacheConfiguration<>()
            cacheConfiguration.setCacheMode(CacheMode.REPLICATED)
            cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
            cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC)
            cacheConfiguration.setName(name)
            cacheConfiguration.onheapCacheEnabled …
Run Code Online (Sandbox Code Playgroud)

grails grails-2.0 hibernate-cache ignite

11
推荐指数
1
解决办法
463
查看次数

触摸事件不会在输入iOS8独立Web应用程序上触发

在从主屏幕启动的独立网络应用程序中,在iOS 8.1(8.0)上,触摸事件(touchstart,touchmove,touchend)不会在输入/ textareas上触发,而是在Safari中的同一设备上触发.

我在iOS 6上测试了相同的网络应用程序,一切都按预期工作.

有没有人遇到同样的问题,并找到了解决此问题的方法?也许有正式的错误报告?不幸的是,我在这个问题上一无所获.

谢谢.

javascript javascript-events iphone-standalone-web-app ios8

7
推荐指数
1
解决办法
698
查看次数

如何通过父元素测试Component Bindings的更改?

我有一个像下面这样的组件,并希望测试该$onChange方法在绑定myBinding更改时的作用.

我整个上午都试过,但找不到办法解决这个问题.

angular
    .module('project.myComponent', [])
    .component('myComponent', {
        bindings: {
            myBinding: '<'
        },
        template: '<div>{{$ctrl.result}}</div>',
        controller: myComponentController
    });

function myComponentController($filter, someService) {
    var ctrl = this;
    ctrl.result = 0;

    $ctrl.$onChange = function (changes) {
        if(angular.isDefined(changes.myBinding)) {
            if(angular.isDefined(changes.myBinding.currentValue)) {
                if(angular.isDefined(changes.myBinding.currentValue != changes.myBinding.previousValue)) {
                    myService.doSomething(changes.myBinding.currentValue).then(
                        function(data) {
                            ctrl.result = changes.myBinding.currentValue * 3;
                        }
                    );                  
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我希望我的测试表现得像是更改绑定值的组件父级.

require('angular-mocks');

describe('myComponment', function() {
    var element, scope;

    beforeEach(inject(function(_$rootScope_, _$compile_) {

    }));

    fit('should display the controller defined title', function() { …
Run Code Online (Sandbox Code Playgroud)

components unit-testing jasmine angularjs angularjs-components

6
推荐指数
1
解决办法
1465
查看次数

IONIC 2 Globalization Plugin错误

我正在做一个带有角度2和打字稿的离子2应用程序,我不得不使用离子/ Cordova提供的全球化插件.在第二次加载应用程序时确定首选语言时,插件始终会遇到错误.

因此错误情况是这样的:我将手机的语言从英语更改为法语并运行我的应用程序.该应用程序完美无瑕,该插件检测到我使用的是法语.我关闭应用程序并再次重新打开它然后插件检测到错误并捕获它然后以警报的形式显示它.

这事儿常常发生.

这是我用来检测语言的代码:

let ln='';
      this.globalization.getPreferredLanguage()
        .then(res => {ln =res.value;
          console.log(ln);
          if(ln.substring(0,2) ==='fr'){
            this.translate.setDefaultLang('fr');
            this.translate.reloadLang('fr');
            localStorage.setItem("lang","1");
          }else{
            if(ln.substring(0,2)==="en"){
              this.translate.setDefaultLang('en');
              this.translate.reloadLang('en');
              localStorage.setItem("lang","2");
            }else{
              this.translate.setDefaultLang('en');
              this.translate.reloadLang('en');
              localStorage.setItem("lang","2");
            }
          }

        })
        .catch(e => {
          console.log(e);
          this.translate.setDefaultLang('en');
          this.translate.reloadLang('en');
          localStorage.setItem("lang","2");
          let altert= this.AlertC.create({
            title: "Language selection problem" ,
            message: "We have encountered an error in identifying your preferred language, so we put it to english as default.",
            buttons: [
              {
                text: 'OK',
                handler: () => {
                  console.log('Cancel clicked');
                }
              },
            ]
          });

          altert.present(); …
Run Code Online (Sandbox Code Playgroud)

globalization cordova ionic2 angular

5
推荐指数
0
解决办法
381
查看次数

HTML 选择自动选择第一个条目

我有以下代码:

  <select #typ class="input" (change)="changeIndex(typ.value)">
        <option *ngFor="let creation of creationComponent>{{creation.name}}</option>
  </select>
Run Code Online (Sandbox Code Playgroud)

如果我启动应用程序,选择会自动选择第一个选项。但我不想要这样。这是为什么?我该如何解决它?

html javascript typescript angular

0
推荐指数
1
解决办法
3116
查看次数