小编Tom*_*mer的帖子

需要关于HornetQ <地址设置>的加密

我正在使用Jboss 7.1.1.final,我想定义2个不同的DLQ,一个用于某个队列,另一个用于所有其余队列.

我找到了这个配置:

<address-settings>
   <address-setting match="jms.queue.exampleQueue">
      <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
      <max-delivery-attempts>3</max-delivery-attempts>
      <redelivery-delay>5000</redelivery-delay>
      <expiry-address>jms.queue.expiryQueue</expiry-address>
      <last-value-queue>true</last-value-queue>        
      <max-size-bytes>100000</max-size-bytes>
      <page-size-bytes>20000</page-size-bytes>
      <redistribution-delay>0</redistribution-delay>
      <send-to-dla-on-no-route>true</send-to-dla-on-no-route>
      <address-full-policy>PAGE</address-full-policy>
   </address-setting>
</address-settings>
Run Code Online (Sandbox Code Playgroud)

match属性可用于匹配某个队列,我对此配置有几个问题:

  1. 如果我定义2 address-setting,一个用外卡匹配所有,一个只匹配一个队列,那么一个队列定义是否优先?我是否需要在比赛前将其全部定义或者无关紧要?
  2. 在示例中,它们匹配队列jms.queue.exampleQueue,我有一个队列定义为:

    <jms-queue name="MissionResult">
        <entry name="queue/MissionResult"/>
    </jms-queue>
    
    Run Code Online (Sandbox Code Playgroud)

    我应该在match属性中加入什么以匹配它?

hornetq jboss7.x

4
推荐指数
1
解决办法
1701
查看次数

如何使用java反射过滤方法

我想从类中获取所有方法但排除继承的方法,例如:wait,toString,hash等.

是否有内置的方法来做或者我需要定义黑名单并检查方法名称吗?

java reflection

3
推荐指数
1
解决办法
1647
查看次数

如何告诉Maven将某个项目jar复制到EAR lib?

我有一个包含许多子项目的应用程序,当前我使用maven2进行编译并将其打包到EAR,然后将其部署在JBOSS 4.2.3上。

到目前为止,所有jar都只位于EAR根目录下,但是现在我们移至JBOSS 7.1,为了使一个jar被其他jar识别(我需要Commons项目对所有其他项目可用),它必须位于EAR / lib(这是JBOSS 7.1的要求)。

我的问题是,如何告诉Maven将特定的jar复制到EAR / lib?

/ * 更新 ** /

这是我用来构建EAR的方法:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <outputDirectory>../../outputs/java</outputDirectory>
                <version>5</version>
                <modules>
                    <jarModule>
                        <groupId>com.example.common</groupId>
                        <artifactId>common</artifactId>
                        <includeInApplicationXml>
                            true
                        </includeInApplicationXml>
                    </jarModule>
                    .....
                </modules>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>ear</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <sourceDirectory>EarContent</sourceDirectory>
    <resources>
        <resource>
            <directory>EarContent\META-INF</directory>
            <targetPath>../Manager-1.0/META-INF</targetPath>
            <excludes>
                <exclude>application.xml</exclude>
            </excludes>
        </resource>
    </resources>
</build>
Run Code Online (Sandbox Code Playgroud)

java maven-2 jboss7.x maven-ear-plugin

3
推荐指数
1
解决办法
3971
查看次数

HTML/CSS/JS构建工具

我有一个项目,包含许多静态HTML和js文件.我需要一个可以连接和缩小它们的构建工具.

我看到了这个精彩的截屏视频,解释了如何使用ant和YUI.我唯一缺少的是在创建缩小版本之后,如何替换HTML中对JS/CSS文件的引用,以便它将引用新的缩小版本?

是否有更好/更容易的工具(不是GPL/LGPL许可证)?

javascript css ant build minify

3
推荐指数
1
解决办法
2123
查看次数

自定义JavaScript数组的排序功能

我有这个非常简单的排序方法:

sortByNumericAttr : function (a, b,attr){            
        a = a[attr];
        b = b[attr];
        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
}
Run Code Online (Sandbox Code Playgroud)

这里的想法是我有不同的对象与不同的attr需要排序(id,类型等),所以我想而不是为每个编写不同的排序函数(其中所有差异只是排序的属性),我写通用方法并将属性传递给它.

所以,如果它是这样写的,我可以称之为:

arr.sort(utils.sortByNumericAttr,'typeId');
Run Code Online (Sandbox Code Playgroud)

基于此功能,如何实现此效果或类似效果?

javascript jquery

3
推荐指数
1
解决办法
66
查看次数

chrome csp阻止了浏览器同步

我有一个运行浏览器同步的任务。

var options = {
        proxy :          'localhost:9000/html' ,
        port :           3000 ,
        files :          [
            config.root + config.srcPaths.htmlBundle ,
            config.htmlRoot + 'main.css' ,
            '!' + config.htmlRoot + '**/*.scss'
        ] ,
        injectChanges :  false ,
        logFileChanges : true ,
        logPrefix :      'broserSync ->' ,
        notify :         true ,
        reloadDelay :    1000
    };
browserSync( options );
Run Code Online (Sandbox Code Playgroud)

browsersync会检测到更改并尝试注入更改,但chrome阻止此错误:

拒绝连接到“ ws:// localhost:3000 / browser-sync / socket.io /?EIO = 3&transport = websocket&sid = gOQQPSAc3RBJD2onAAAA”,因为它违反了以下内容安全策略指令:“ default-src'self'”。请注意,未明确设置“ connect-src”,因此将“ default-src”用作后备。

未捕获到的SecurityError:无法构造'WebSocket':拒绝连接到'ws:// localhost:3000 / browser-sync / socket.io /?EIO …

google-chrome content-security-policy gulp browser-sync

3
推荐指数
2
解决办法
5551
查看次数

Vue:空数组自动填充观察者对象

我试图在数据中初始化一个空数组,然后从服务器获取一个 JSON 并填充它。

问题是数组总是有一个额外的 Observer 对象,所以当我记录它时,我看到:

空项目数组:[ ob:观察者]

这是一段代码摘录:

data() {
        return {
            items: []
        }
    },
 created() {
         this.$http.get('/api/menus').then(function (response) {

            console.log('items before', this.items); //THIS LOGS items before: [__ob__: Observer]
             this.items = [].concat(response.body);
            this.items.forEach(function (item) {
              console.log('item', item);

              item.$add('active', false);

              item.tests.forEach(function (test) {
                  test.$add('active', false);
              });
        });

         }).catch(function (err) {
             console.error('err', err);

         });

     },
Run Code Online (Sandbox Code Playgroud)

问题是,当尝试向数组中的对象添加新属性时,出现错误:

错误类型错误:item.$add 不是函数

当我调试时,我看到它发生了,因为它认为观察者对象是数组的一部分。

正常吗?我应该检查 $add 是否存在?在视图中渲染它时,Vue 是否忽略了这个对象?

javascript vue.js vuejs2

3
推荐指数
1
解决办法
7987
查看次数

如何配置jboss 7将日志写入不同的文件夹

我正在使用Jboss 7.1.1,我有以下日志定义:

<subsystem xmlns="urn:jboss:domain:logging:1.1">
        <console-handler name="CONSOLE">
            <level name="INFO"/>
            <formatter>
                <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
            </formatter>
        </console-handler>
        <periodic-rotating-file-handler name="FILE">
            <formatter>
                <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
            </formatter>
            <file relative-to="jboss.server.log.dir" path="server.log"/>
            <suffix value=".yyyy-MM-dd"/>
            <append value="true"/>
        </periodic-rotating-file-handler>
        <size-rotating-file-handler name="ACEII">
            <level name="DEBUG"/>
            <formatter>
                <pattern-formatter pattern="%z{utc}%d{dd/MM/yyyy HH:mm:ss,SSS} %-5p [%c] %s%E%n"/>
            </formatter>
            <file relative-to="jboss.server.log.dir" path="ACEII.log"/>
            <rotate-size value="10M"/>
            <max-backup-index value="10"/>
            <append value="true"/>
        </size-rotating-file-handler>
        <logger category="ace2" use-parent-handlers="false">
            <level name="DEBUG"/>
            <handlers>
                <handler name="ACEII"/>
            </handlers>
        </logger>
        <logger category="com.arjuna">
            <level name="WARN"/>
        </logger>
        <logger category="org.apache.tomcat.util.modeler">
            <level name="WARN"/>
        </logger>
        <logger category="sun.rmi">
            <level …
Run Code Online (Sandbox Code Playgroud)

java logging jboss7.x

2
推荐指数
1
解决办法
2万
查看次数

如何在地图上获得一定范围内的点数

我正在使用google maps API v2 for android.一旦用户打开页面我就会得到他当前的位置并在那里放置一个标记.

现在我想从我的数据库中读取一个位置列表,找出哪些位于某个半径(用户定义的半径)并仅显示范围内的那些点的标记,我该怎么做?

android google-maps google-maps-markers

2
推荐指数
1
解决办法
836
查看次数

PostgreSQL:如何获得特定半径内的所有点

我正在使用Postgresql 9.3和iv'e安装了cube和earthdistance扩展.

我正在尝试按照本教程,所以我有一个简单的事件表,包含4个字段:id,name,lat,lng.

现在我正在尝试运行此查询,以获取半径1公里范围内的所有事件:

SELECT events.id, events.name FROM events WHERE earth_box(31.789225, 34.789612, 1000) @> ll_to_earth(events.lat, events.lng);
Run Code Online (Sandbox Code Playgroud)

但我一直收到这个错误:

20:59:34 Kernel error: ERROR:  function earth_box(numeric, numeric, integer) does not exist
  HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)

所以我用铸造运行同样的东西:

  SELECT events.id, events.name FROM events WHERE earth_box(CAST(31.789225 AS float8), CAST(34.789612 AS float8), 1000) @> ll_to_earth(events.lat, events.lng);
Run Code Online (Sandbox Code Playgroud)

我得到:

   21:16:17 Kernel error: ERROR:  function earth_box(double precision, double precision, integer) does not exist
                                                              ^ …
Run Code Online (Sandbox Code Playgroud)

postgresql geospatial earthdistance

2
推荐指数
1
解决办法
1462
查看次数

如何使用cypress模拟vuex存储操作

我有一个登录过程,在向服务器发送请求并获得响应后,我执行以下操作:

 this.$auth.setToken(response.data.token);
 this.$store.dispatch("setLoggedUser", {
     username: this.form.username
 });
Run Code Online (Sandbox Code Playgroud)

现在,我想在使用赛普拉斯进行测试时模拟这种行为,因此我不需要每次运行测试时都实际登录。

所以我创建了一个命令:

Cypress.Commands.add("login", () => {
  cy
    .request({
      method: "POST",
      url: "http://localhost:8081/api/v1/login",
      body: {},
      headers: {
        Authorization: "Basic " + btoa("administrator:12345678")
      }
    })
    .then(resp => {
      window.localStorage.setItem("aq-username", "administrator");
    });

});
Run Code Online (Sandbox Code Playgroud)

但是我不知道如何模仿“ setLoggedUser”操作,有什么想法吗?

vue.js vuex cypress

2
推荐指数
1
解决办法
898
查看次数

如何在javascript中将字符串拼接到不均匀的部分

我有一个输入字段,其上有自动完成功能(自定义自动完成).

当用户键入单词时,应出现匹配短语,但用户键入的单词应具有不同的颜色.

因此,如果我有像"Hello World"这样的字符串并且用户输入"ll",他应该得到一个包含"ll"的匹配短语列表,但是"ll"应该有不同的颜色.

所以,我需要一种方法来拼接的"Hello World",所以我会得到:["he","ll","o World"]然后我可以换"LL"<span>和风情呢.

javascript jquery

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

cypress:无法从窗口对象访问应用程序

我需要在 cypress 测试中访问我的 vuex 存储,所以我将应用程序添加到我的 main.js 中的 window 对象:

const app = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");

window.vueApp = app;
Run Code Online (Sandbox Code Playgroud)

然后我尝试在我的登录命令(commands.js)中访问它:

cy
    .request({
      method: "POST",
      url: "http://localhost:8081/api/v1/login",
      body: {},
      headers: {
        Authorization: "Basic " + btoa("administrator:12345678")
      }
    })
    .then(resp => {
      console.log("app:", window.vueApp);
      ...
      window.localStorage.setItem("aq-username", "administrator");
    });
Run Code Online (Sandbox Code Playgroud)

但它总是未定义,我做错了什么?

vue.js cypress

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