springboot+redis单元测试存入对象再取对象无法反序列化

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_41738613/article/details/83020048

springboot 2.0.5

redis 3.2.100

这是我用单元测试想测试下现在能不能存取对象,但是在运行后就会抛出这个错误。

刚开始我以为是我配置RedisTemplate有问题,所以看看我的RedisTemplate

但是不管怎么看都没有问题,所以仔细看报错的地方

(no Creators, like default construct, exist)这句话说了没有默认构造器,所以我看了我保存的对象真的没有构造器,加上了默认构造器之后便完美运行了。

 

 

展开阅读全文

CByteArray 对象无法存入Vector?

07-28

[code=C/C++]rntypedef ::std::vector VECTFRAMEBODY;rnVECTFRAMEBODY m_vectFrmBody;rnCByteArray baFrmBody;rndosomthing();rnm_vectFrmBody.push_back(baFrmBody);rn[/code]rnrn这里就会报错,就是这一句m_vectFrmBody.push_back(baFrmBody);rnCompiling...rnTXDlg.cpprnE:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xutility(39) : error C2582: 'CByteArray' : 'operator =' function is unavailablern E:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(170) : see reference to function template instantiation 'void __cdecl std::fill(class CByteArray *,class CByteArray *,const class CByteArray &)' being compiledrnE:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xutility(25) : error C2582: 'CByteArray' : 'operator =' function is unavailablern E:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(174) : see reference to function template instantiation 'class CByteArray *__cdecl std::copy_backward(class CByteArray *,class CByteArray *,class CByteArray *)' being compiledrnE:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(34) : error C2558: class 'CByteArray' : no copy constructor availablern E:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : see reference to function template instantiation 'void __cdecl std::_Construct(class CByteArray *,const class CByteArray &)' being compiledrn执行 cl.exe 时出错.rnCreating browse info file...rnrnDBTest.exe - 1 error(s), 0 warning(s)rnrnrn看样子CByteArray是无法压入Vector? 真的是这样吗? 高手们有没有办法,我真的很想用Vector 保存CByteArray ,T_T 论坛

没有更多推荐了,返回首页