我有3个.xml文件:格式化程序规则,代码模板和清理规则.如何将其导入Eclipse?
我有aop配置的问题.这是我的spring xml配置的一部分:
<bean id="conLogger" class="com.pomkine.pXMPP.connection_service.ConnectionLogger"/>
<aop:config>
<aop:aspect ref="conLogger">
<aop:pointcut id="connect"
expression= "execution(* com.pomkine.pXMPP.connection_service.connectionManager.connect(..))" />
<aop:after pointcut-ref="connect"
method="connected"/>
</aop:aspect>
</aop:config>
Run Code Online (Sandbox Code Playgroud)
这是我的主要方法:
public static void main (String [] args) {
ApplicationContext ac = new ClassPathXmlApplicationContext("com/pomkine/pXMPP/connection_service/connection-manager.xml");
connectionManager cm=(connectionManager)ac.getBean("connectionManager");
try {
cm.connect();
cm.disconnect();
} catch (XMPPException e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我得到NoClassDefFoundError异常.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connect': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
Run Code Online (Sandbox Code Playgroud)
无法弄清问题是什么.非常感谢任何帮助.
我正在尝试使用apache httpclietn-4.2.2获取'Set Cookie'标头并遇到一些问题.
Firebug中的标题:
Set-Cookie remixreg_sid=deleted; expires=Thu, 10-Nov-2011 04:32:30 GMT; path=/;
domain=.vk.com remixapi_sid=deleted; expires=Thu, 10-Nov-2011 04:32:30 GMT; path=/;
domain=.vk.com remixrec_sid=deleted; expires=Thu, 10-Nov-2011 04:32:30 GMT; path=/;
domain=.vk.com remixsid=0000000000000000000000000000000000000000000000000000; expires=Mon, 04-Nov-2013 16:10:24 GMT; path=/; domain=.vk.com
Run Code Online (Sandbox Code Playgroud)
我是如何获得它的:
//location is a header with url I need to do GET request to
Header location = response.getFirstHeader("Location");
HttpGet httpGet = new HttpGet(location.getValue());
httpClient.getParams().setParameter(
//tried to use different policies
ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2965);
Header [] allHeaders=response.getAllHeaders();
Run Code Online (Sandbox Code Playgroud)
在allHeaders中,我有除"Set Cookie"之外的所有标题.我有这样的警告:
WARNING: Invalid cookie header: "Set-Cookie: remixlang=0; expires=Mon, 18-Nov-2013
03:21:47 GMT; path=/; …Run Code Online (Sandbox Code Playgroud) 在Activemq服务器上启用STOMP协议(在它仅启用默认协议之前)之后,它开始失败并显示oom.我只有一个客户端使用STOMP.它可以在没有失败的情况下工作一周,或者在重启后一天失败.这是配置文件:
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
lazy-init="false" scope="singleton"
init-method="start" destroy-method="stop">
</bean>
<!--
The <broker> element is used to configure the ActiveMQ broker.
-->
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core" brokerName="cms-mq" dataDirectory="${activemq.data}">
<destinationInterceptors>
<virtualDestinationInterceptor>
<virtualDestinations>
<virtualTopic name="VirtualTopic.>" selectorAware="true"/>
</virtualDestinations>
</virtualDestinationInterceptor>
</destinationInterceptors>
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" producerFlowControl="false">
</policyEntry>
<policyEntry queue=">" producerFlowControl="false">
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap="70" />
</memoryUsage>
<storeUsage>
<storeUsage limit="4 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="4 gb"/> …Run Code Online (Sandbox Code Playgroud)