私信  •  关注

Suresh

Suresh 最近回复了
5 年前
回复了 Suresh 创建的主题 » python2.7名称“uu path_uuuu”未定义

您可以在包demopkg1的“uu init_uuy.py”文件中使用上述代码行。 “uu init_uuu.py”文件包含:

import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)

现在使用另一个文件test.py,代码行如下:

import demopkg1
print ('demopkg1 file          :', demopkg1.__file__)
print ('demopkg1 path          :', demopkg1.__path__)

当您将执行包含包“demopkg1”的文件test.py时,给出以下输出:

demopkg1 file          : E:\Work\Python\demopkg1\__init__.py
demopkg1 path          : ['E:\\Work\\Python\\demopkg1']
5 年前
回复了 Suresh 创建的主题 » 无法读取对象内容spring boot activemq

我通过直接使用pojo而不是将其作为javax.jms.message使用来解决这个错误。另外,消息转换器bean也应按以下方式初始化:

//使用textmessage将消息内容序列化到json

@Bean
public MessageConverter jacksonJmsMessageConverter() {
    MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setTargetType(MessageType.TEXT);
    converter.setTypeIdPropertyName("_type");
    return converter;
}

请查看我在Github中的代码:

https://github.com/sureshpec04/spring-boot-jms