今天遇到 Could not determine type for: java.util.List

今天遇到 Could not determine type for: java.util.List

用hibernate 映射好好的竟然出现这个问题 

以前也遇到过,但不知道怎么给解决了,今天又遇到了,我用到的是用注解标注的映射关系

后来仔细砍了,原来注解要么写在字段上,要么写在getter上,不能混合使用,否则会报错

 

原出处:http://blog.csdn.net/piggerman/article/details/2170388

 

--- --- --- ---> 点击查看更多最新原创博文<--- --- --- ---

 

技术交流

 

展开阅读全文

org.hibernate.MappingException: Could not determine type for: string , at table

11-18

Books.javarn[code=Java]rnpackage com.ssh.books.model;rnrnimport java.sql.Date;rnrnpublic class Books rn private String bookId;rn private String name;rn private String author;rn private String publish;rn private Date date;rn private String isbn;rn private int page;rn private String bookPrice;rn private String content;rn rn rnrn public String getBookId() rn return bookId;rn rn public void setBookId(String bookId) rn this.bookId = bookId;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public String getAuthor() rn return author;rn rn public void setAuthor(String author) rn this.author = author;rn rn public String getPublish() rn return publish;rn rn public void setPublish(String publish) rn this.publish = publish;rn rn public Date getDate() rn return date;rn rn public void setDate(Date date) rn this.date = date;rn rn public String getIsbn() rn return isbn;rn rn public void setIsbn(String isbn) rn this.isbn = isbn;rn rn public int getPage() rn return page;rn rn public void setPage(int page) rn this.page = page;rn rn public String getBookPrice() rn return bookPrice;rn rn public void setBookPrice(String bookPrice) rn this.bookPrice = bookPrice;rn rn public String getContent() rn return content;rn rn public void setContent(String content) rn this.content = content;rn rnrnrnrnrnBooks.hbm.xmlrn[/code]rnrn[code=XML]rnrnrnrnrnrnrn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrnrnrn[/code]rnrnrn[color=#FF0000]rnCaused by: org.hibernate.MappingException: Could not determine type for: string , at table: books, for columns: [org.hibernate.mapping.Column(book_id)]rn[/color] 论坛

Could not load type 是什么意思?

12-06

rnrn小弟初次接解C#,运行以后程式时出现rnCould not load type 'WebApplicationCSharp.VC15'rn<%@ Page language="c#" Codebehind="VC15.aspx.cs" AutoEventWireup="false" Inherits="WebApplicationCSharp.VC15" %>rn的错误,百思不得其解,查阅有关书籍和网站也没找到解答.希望各位过来人能指点一二.感激万分.rn附源码.rnvc15.aspxrn<%@ Page language="c#" Codebehind="VC15.aspx.cs" AutoEventWireup="false" Inherits="WebApplicationCSharp.VC15" %>rnrnrn rn 活用 AutoPostBack 属性rn rn rn rn rn rn rn rn 请从清单中选取所需的书籍rn rn 用实例学 ASP.NET(使用 VB.NET 与 ADO.NET)rn 用实例学 ASP.NET(使用 Visual C# 与 ADO.NET)rn 用实例学 XML Web Servicesrn 用实例学 Visual Basic.NETrn 用实例学 Visual C#rn SQL Server 2000 Transact-SQL 程式设计rn 用实例学 ADO.NET(以 ASP.NET 为例)rn rn rn rnrnrnvc15.aspx.csrnrnusing System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnrnnamespace WebApplicationCSharprnrn rn public class VC15 : System.Web.UI.Pagern rn protected System.Web.UI.WebControls.Label Label1;rn protected System.Web.UI.WebControls.ListBox BookListBox;rn protected System.Web.UI.WebControls.Label Message;rn rn private void Page_Load(object sender,rn System.EventArgs e)rn rn rn rnrn #region Web Form Designer generated codern override protected void OnInit(EventArgs e)rn rn //rn rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn rn /// rn private void InitializeComponent()rn rn this.BookListBox.SelectedIndexChanged += new System.EventHandler(this.BookListBox_SelectedIndexChanged);rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrnrn private void BookListBox_SelectedIndexChanged(object sender, System.EventArgs e)rn rn if (BookListBox.SelectedItem.Text != null)rn Message.Text = "您选择的书籍: " + BookListBox.SelectedItem.Text;rn elsern Message.Text = "";rn rn rnrn 论坛

移植samba3.0.8 后运行 ERROR: Could not determine network interfaces

10-06

今天将samba3.0.8移植到arm9开发板上面。rn# ./configure --host=arm-linuxrn#make rn生成nmbd , smbd等相关文件rnrn复制nmbd, smbd及自己新建的一个测试smb.conf分别到如下位置:rn/usr/local/samba/bin/nmbdrn/usr/local/samba/bin/smbdrn/usr/local/samba/lib/smb.confrnrn采用rn/usr/local/samba/bin/nmbd -o -Drn/usr/local/samba/bin/smbd -o -Drn程序自动退出,查看rn/usr/local/samba/var/log.nmbdrn/usr/local/samba/var/log.smbdrnrn[code=Assembly]rn# cat /usr/local/samba/var/log.nmbdrn[1970/01/01 00:00:21, 0] nmbd/nmbd.c:main(668)rn Netbios nameserver version 3.0.8 started.rn Copyright Andrew Tridgell and the Samba Team 1994-2004rn[1970/01/01 00:00:21, 1] lib/util_unistr.c:load_case_tables(63)rn creating lame upcase tablern[1970/01/01 00:00:21, 1] lib/util_unistr.c:load_case_tables(78)rn creating lame lowcase tablern[1970/01/01 00:00:22, 0] lib/interface.c:load_interfaces(195)rn ERROR: Could not determine network interfaces, you must use a interfaces config linern[/code]rnrn# cat /usr/local/samba/var/log.smbdrn[1970/01/01 00:00:18, 1] lib/util_unistr.c:load_case_tables(63)rn creating lame upcase tablern[1970/01/01 00:00:18, 1] lib/util_unistr.c:load_case_tables(78)rn creating lame lowcase tablern[1970/01/01 00:00:19, 0] smbd/server.c:main(760)rn smbd version 3.0.8 started.rn Copyright Andrew Tridgell and the Samba Team 1992-2004rn[1970/01/01 00:00:19, 0] lib/interface.c:load_interfaces(195)rn ERROR: Could not determine network interfaces, you must use a interfaces config linernrnrn我以前移植samba2.2.12是没有出现这个问题。rnsmb.conf 增加 rninterfaces = eth0rn也没有效果rn在网络上找了好久,也有人碰到类似情况,但是并没有解决方法。rn请大侠,指点,究竟是什么原因导致此情况的出现。或者怎样解决 , 不胜感激 论坛

antlib.xml:37: Could not create task or type of type: componentdef.

05-22

求大神帮忙!rn我用的是JAVA的方式调用的antrnrnJAVA代码如下rn[code=java]rnpackage com.jb.automaticupgrade.versionUtil.service.impl;rnrnimport java.io.File;rnrnimport org.apache.tools.ant.BuildException;rnimport org.apache.tools.ant.Project;rnimport org.apache.tools.ant.ProjectHelper;rnrnimport com.jb.automaticupgrade.versionUtil.service.ComplieProjectHandler;rnrnpublic class AntComplieProjectImpl implements ComplieProjectHandler rnrn public void ComplieProject(String southPath, String targetPath) rn File buildeFile = new File(southPath);rn try rn Project p = new Project();rn p.fireBuildStarted();rn p.init();rn ProjectHelper projectHelper = ProjectHelper.getProjectHelper();rn projectHelper.parse(p, buildeFile);rn p.executeTarget("build");rn catch (BuildException e) rn e.printStackTrace();rn rn rnrnrn[/code]rnrn但是 运行的时候爆这样的错误rnF:\complierTemp\com.jb.f1.kernel.io\build.xml:9: The following error occurred while executing this line:rnjar:file:/D:/F1AutomaticUpgradeWorkSpace/com.jb.f1.automaticUpgrade/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.rnrnAnt could not find the task or a class this task relies upon.rnrnThis is common and has a number of causes; the usual rnsolutions are to read the manual pages then download andrninstall needed JAR files, or fix the build file: rn - You have misspelt 'componentdef'.rn Fix: check your spelling.rn - The task needs an external JAR file to executern and this is not found at the right place in the classpath.rn Fix: check the documentation for dependencies.rn Fix: declare the task.rn - The task is an Ant optional task and the JAR file and/or librariesrn implementing the functionality were not found at the time yourn yourself built your installation of Ant from the Ant sources.rn Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to thern task and make sure it contains more than merely a META-INF/MANIFEST.MF.rn If all it contains is the manifest, then rebuild Ant with the neededrn libraries present in $ant.home/lib/optional/ , or alternatively,rn download a pre-built release version from apache.orgrn - The build file was written for a later version of Antrn Fix: upgrade to at least the latest release version of Antrn - The task is not an Ant core or optional task rn and needs to be declared using .rn - You are attempting to use a task defined using rn or but have spelt wrong or not rn defined it at the point of usernrnRemember that for JAR files to be visible to Ant tasks implementedrnin ANT_HOME/lib, the files must be in the same directory or on thernclasspathrnrnPlease neither file bug reports on this problem, nor email thernAnt mailing lists, until all of these causes have been explored,rnas this is not an Ant bug.rn at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)rn at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:332)rn at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:236)rn at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:761)rn at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:221)rn at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:198)rn at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:176)rn at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:388)rn at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)rn at org.apache.tools.ant.Task.perform(Task.java:363)rn at org.apache.tools.ant.Target.execute(Target.java:341)rn at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)rn at com.jb.automaticupgrade.versionUtil.service.impl.AntComplieProjectImpl.ComplieProject(AntComplieProjectImpl.java:20)rn at com.jb.automaticupgrade.versionUtil.test.Test.main(Test.java:12)rnCaused by: jar:file:/D:/F1AutomaticUpgradeWorkSpace/com.jb.f1.automaticUpgrade/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.rnrnAnt could not find the task or a class this task relies upon.rnrnThis is common and has a number of causes; the usual rnsolutions are to read the manual pages then download andrninstall needed JAR files, or fix the build file: rn - You have misspelt 'componentdef'.rn Fix: check your spelling.rn - The task needs an external JAR file to executern and this is not found at the right place in the classpath.rn Fix: check the documentation for dependencies.rn Fix: declare the task.rn - The task is an Ant optional task and the JAR file and/or librariesrn implementing the functionality were not found at the time yourn yourself built your installation of Ant from the Ant sources.rn Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to thern task and make sure it contains more than merely a META-INF/MANIFEST.MF.rn If all it contains is the manifest, then rebuild Ant with the neededrn libraries present in $ant.home/lib/optional/ , or alternatively,rn download a pre-built release version from apache.orgrn - The build file was written for a later version of Antrn Fix: upgrade to at least the latest release version of Antrn - The task is not an Ant core or optional task rn and needs to be declared using .rn - You are attempting to use a task defined using rn or but have spelt wrong or not rn defined it at the point of usernrnRemember that for JAR files to be visible to Ant tasks implementedrnin ANT_HOME/lib, the files must be in the same directory or on thernclasspathrnrnPlease neither file bug reports on this problem, nor email thernAnt mailing lists, until all of these causes have been explored,rnas this is not an Ant bug.rn at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:493)rn at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:391)rn at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)rn at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)rn at org.apache.tools.ant.Task.perform(Task.java:364)rn at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:330)rn ... 12 morern--- Nested Exception ---rnjar:file:/D:/F1AutomaticUpgradeWorkSpace/com.jb.f1.automaticUpgrade/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.rnrnAnt could not find the task or a class this task relies upon.rnrnThis is common and has a number of causes; the usual rnsolutions are to read the manual pages then download andrninstall needed JAR files, or fix the build file: rn - You have misspelt 'componentdef'.rn Fix: check your spelling.rn - The task needs an external JAR file to executern and this is not found at the right place in the classpath.rn Fix: check the documentation for dependencies.rn Fix: declare the task.rn - The task is an Ant optional task and the JAR file and/or librariesrn implementing the functionality were not found at the time yourn yourself built your installation of Ant from the Ant sources.rn Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to thern task and make sure it contains more than merely a META-INF/MANIFEST.MF.rn If all it contains is the manifest, then rebuild Ant with the neededrn libraries present in $ant.home/lib/optional/ , or alternatively,rn download a pre-built release version from apache.orgrn - The build file was written for a later version of Antrn Fix: upgrade to at least the latest release version of Antrn - The task is not an Ant core or optional task rn and needs to be declared using .rn - You are attempting to use a task defined using rn or but have spelt wrong or not rn defined it at the point of usernrnRemember that for JAR files to be visible to Ant tasks implementedrnin ANT_HOME/lib, the files must be in the same directory or on thernclasspathrnrnPlease neither file bug reports on this problem, nor email thernAnt mailing lists, until all of these causes have been explored,rnas this is not an Ant bug.rn at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:493)rn at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:391)rn at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)rn at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)rn at org.apache.tools.ant.Task.perform(Task.java:364)rn at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:330)rn at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:236)rn at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:761)rn at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:221)rn at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:198)rn at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:176)rn at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:388)rn at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)rn at org.apache.tools.ant.Task.perform(Task.java:363)rn at org.apache.tools.ant.Target.execute(Target.java:341)rn at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)rn at com.jb.automaticupgrade.versionUtil.service.impl.AntComplieProjectImpl.ComplieProject(AntComplieProjectImpl.java:20)rn at com.jb.automaticupgrade.versionUtil.test.Test.main(Test.java:12)rnrn但是我使用命令的方式编译是可以对我的项目正常编译的,只有使用ANT api的时候报错!已经查了很长时间了rn求解答!!!! 论坛

could not find deserializer for type 请高手指教

08-02

服务器端是移动给的,我们用WSDL2Java生成客户端rn报错:rnAxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/Server.userExceptionrn faultSubcode: rn faultString: org.xml.sax.SAXException: Deserializing parameter 'event': could not find deserializer for type http://schemas.prbt.cmcc.comGetPwdEvtrn faultActor: rn faultNode: rn faultDetail: rn http://xml.apache.org/axis/stackTrace: AxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/Server.userExceptionrn faultSubcode: rn faultString: org.xml.sax.SAXException: Deserializing parameter 'event': could not find deserializer for type http://schemas.prbt.cmcc.comGetPwdEvtrn faultActor: rn faultNode: rn faultDetail: rnrnorg.xml.sax.SAXException: Deserializing parameter 'event': could not find deserializer for type http://schemas.prbt.cmcc.comGetPwdEvtrn at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)rn at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)rn at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)rn at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)rn at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)rn at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)rn at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)rn at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)rn at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)rn at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)rn at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)rn at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)rn at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)rn at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)rn at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)rn at org.apache.axis.client.Call.invokeEngine(Call.java:2583)rn at org.apache.axis.client.Call.invoke(Call.java:2553)rn at org.apache.axis.client.Call.invoke(Call.java:2248)rn at org.apache.axis.client.Call.invoke(Call.java:2171)rn at org.apache.axis.client.Call.invoke(Call.java:1691)rn at com.ws.um.UserManageSoapBindingStub.getPwd(UserManageSoapBindingStub.java:336)rn at TestWS.main(TestWS.java:41)rnrnrnprbt_UserManage_v1.0.wsdlrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn...............................rnrn省略rn...............................rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrnrn 论坛

一个关于Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'. 的问题

10-18

如题,之前写了一个很简单的webservice接口,然后我在本地调试是好的,本地win10系统,使用vs2013写的。 然后发布,把发布好的文件放入服务器,服务器是win server 2008 r2,如果新建一个站点的话,那么这个接口是可以正常跑起来的。 但是现在的要求是要把这个接口放到之前的站点中,于是添加虚拟目录,然后又把虚拟目录转为应用程序。 于是就报错了。 可以确定应用连接池没有问题, 因为之前新建站点的时候用的也是那个应用连接池。 报错如下。 rnrnServer Error in '/WeixinSelect' Application.rn--------------------------------------------------------------------------------rnrnCould not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'. rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.Web.HttpException: Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'.rnrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. rnrnStack Trace: rnrnrn[HttpException (0x80004005): Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'.]rn System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +8807995rn System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +52rnrn[ConfigurationErrorsException: Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'.]rn System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +360rn System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +27rn System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +44rn System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +52rn System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +165rn System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1088rn System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +95rn System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194rn System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339rn System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253rnrn[HttpException (0x80004005): Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'.]rn System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946548rn System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97rn System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256rnrn rnrnrn--------------------------------------------------------------------------------rnVersion Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 rn请大神指导。 论坛

Could not autowire. No beans of 'RedisConnectionFactory' type found

05-16

RedisConnectionFactory factory 提示错误rnrn[code=java]rn@Configurationrnpublic class RedisConfig rnrn @Beanrn public RedisTemplate redisTemplate(RedisConnectionFactory factory)rn RedisTemplate template = new RedisTemplate<>();rn template.setConnectionFactory(factory);rnrn Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class);rn ObjectMapper mapper = new ObjectMapper();rn mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);rn mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);rn serializer.setObjectMapper(mapper);rn template.setValueSerializer(serializer);rn //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值rn template.setHashValueSerializer(serializer);rn //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值rn template.setStringSerializer(new StringRedisSerializer());rn template.setHashKeySerializer(new StringRedisSerializer());rnrn template.afterPropertiesSet();rn return template;rn rnrnrnrn 4.0.0rn rn org.springframework.bootrn spring-boot-starter-parentrn 2.1.5.RELEASErn rn rn com.chern demorn 0.0.1-SNAPSHOTrn springbootDemorn Demo project for Spring Bootrnrn rn 1.8rn rnrn rn rn org.springframework.bootrn spring-boot-starterrn rnrn rn org.springframework.bootrn spring-boot-starter-testrn testrn rnrn rn org.springframework.bootrn spring-boot-starter-data-redisrn rn rn redis.clientsrn jedisrn 2.9.3rn rn rn com.fasterxml.jackson.corern jackson-databindrn 2.9.8rn rn rnrn rn rn rn org.springframework.bootrn spring-boot-maven-pluginrn rn rn rnrnrnrn[/code] 论坛

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