小编Eme*_*let的帖子

为什么DefaultMessageListenerContainer不应该使用CachingConnectionFactory?

我正在阅读关于DefaultMessageListenerContainer的 spring文档

它说:"注意:不要将Spring的CachingConnectionFactory与动态扩展结合使用.理想情况下,根本不要将它与消息监听器容器一起使用,因为通常最好让监听器容器本身在其生命周期内处理适当的缓存.此外,停止和重新启动侦听器容器只能使用独立的本地缓存连接 - 而不能使用外部缓存连接."

谁有人解释原因?

spring-jms

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

bootstrap类路径未与-source 1.6一起设置

我正在将我的应用程序从java 1.6升级到1.7.当我尝试使用Maven 3.2.1进行构建时,我的构建失败并出现以下错误消息:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-app5: Compilation failure: Compilation failure:
[ERROR] could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6  
Run Code Online (Sandbox Code Playgroud)

我正在使用java 1.7热点,之前我使用的是1.6 jrockit.我的应用程序是多模块,很少有模块像往常一样编译和构建,这个模块失败了.

我已正确设置java home并且mvn --version显示在输出下方:

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T23:07:52+05:30)
Maven home: C:\Users\me\Maven3\apache-maven-3.2.1-bin\apache-maven-3.2.1\bin\..
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\jdk17051\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"  
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

classpath jvm-hotspot maven-3

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

@Order 可以应用于@Transactional 吗?

我有一个用@Transactional 和另一个自定义注释@Custom 注释的方法。此自定义注释包含在建议中。操作顺序如下:

1.Transactional method gets called
2.Sees @Transactional and @Custom
3.As @Custom is intercepted by around advice, it first executes code before invocation of method
4.invocationContext.proceed()
5.Transaction gets created
6.Actual method runs
7.Back to around advice and executes code after method invocation
Run Code Online (Sandbox Code Playgroud)

我想在调用建议之前创建事务。像下面这样:

1.Transactional method gets called
2.Sees @Transactional and @Custom
3.Transaction gets created (propagate this transaction to @Custom)
4.As @Custom is intercepted by around advice, it first executes code before invocation of method
5.invocationContext.proceed()
6.Actual method runs
7.Back …
Run Code Online (Sandbox Code Playgroud)

spring spring-aop spring-transactions

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

对于尝试恢复的目标,JMS 消息侦听器调用程序的设置失败

在我的应用程序中运行集成测试时,我在我的集​​成测试之一的故障安全测试报告中收到以下错误消息:

listener.DefaultMessageListenerContainer,WARN,Setup of JMS message listener invoker failed for destination 'jms/myapp.OneWorker' - trying to recover. Cause: Destination [jms/myapp.OneWorker] not found in JNDI; nested exception is javax.naming.NameNotFoundException: jms/myapp.OneWorker
Run Code Online (Sandbox Code Playgroud)

下面是我的配置细节:

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.factory.initial">
                org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
            <prop key="java.naming.provider.url">vm://localhost:0</prop>
            <prop key="java.naming.security.principal">system</prop>
            <prop key="java.naming.security.credentials">system</prop>
        </props>
    </property>
</bean>

<bean id="jndiQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName" value="jmsFactory" />
</bean>

<bean id="queueConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory" ref="jndiQueueConnectionFactory" />
    <property name="sessionCacheSize" value="1" />
</bean>

<bean id="destinationResolver"
    class="org.springframework.jms.support.destination.JndiDestinationResolver">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="cache" value="true" …
Run Code Online (Sandbox Code Playgroud)

spring spring-jms

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

${surefire.forkNumber} 始终解析为 null

我在 pom.xml 的系统属性中使用 ${surefire.forkNumber} 根据maven文档,它应该解析为当前正在运行的fork数量。但它解析为空。
下面是我的 pom 文件的片段:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <forkCount>3</forkCount>
                    <reuseForks>true</reuseForks>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <systemPropertyVariables>
                         <database.name>My_Test_Schema_${surefire.forkNumber}</database.name>
                    </systemPropertyVariables>
                </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

请任何人提供一些线索...

maven

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