jjzjj

PersistenceException

全部标签

Android,帮助一个简单的框架PersistenceException

我正在尝试使用org.simpleframework.xml。在我的Android项目中处理xml数据的类。我不明白如何构建我的类“点”构造函数以匹配xml定义:在运行时我得到这个异常:org.simpleframework.xml.core.PersistenceException:Constructornotmatchedforclasskoine.marcos.wifidemo.Point我的xml数据是这样的:文件点.xml:-52-97-68-83文件Rssi.java:@RootpublicclassRssi{@Attribute(required=false)protec

java - 在 Spring 中将 PersistenceException 转换为 DataAccessException

我正在尝试处理Spring+JPA+Hibernate环境中的唯一键约束冲突。我使用PersistenceExceptionTranslationPostProcessor将PersistenceException转换为DataAccessException。当违反唯一键约束时,我希望抛出DuplicateKeyException或DataIntegrityViolationException,但我得到的只是一个包装了PersistenceException。使用DataAccessException层次结构的全部意义不是在于它足够细粒度而不必查找特定于供应商的错误代码吗?我如何让Sp

java - Play Framework : PersistenceException: The type is not a registered entity? (Ebean)

我正在学习适用于Java的PlayFramework2.0教程,但在尝试保存ebean模型(task.save())时遇到此错误。[PersistenceException:Thetype[classmodels.Task]isnotaregisteredentity?Ifyoudon'texplicitlylisttheentityclassestouseEbeanwillsearchforthemintheclasspath.IftheentityisinaJarchecktheebean.search.jarspropertyinebean.propertiesfileorche

javax.persistence.PersistenceException : No Persistence provider for EntityManager named

我正在尝试按照老师文档中提供的信息设置一个简单的jpa2.0项目。我已经处理这个问题好几个小时了,但无论我做什么,当我尝试创建EntityManagerFactory时,我总是遇到这个异常:我发现了很多关于此异常的类似问题,但没有我能够开始工作的解决方案。我在这里做错了什么?我从Eclipse创建了这个项目(没有命令提示符)Exceptioninthread"main"javax.persistence.PersistenceException:NoPersistenceproviderforEntityManagernamedcourseatjavax.persistence.Per

java - org.simpleframework.xml.core.PersistenceException : Constructor not matched for class A

我正在使用SimpleXML进行序列化(写入XML),没有任何问题。但是,当我尝试读取并反序列化为XML时,出现以下异常。我正在使用lombok插件来提供构造函数,例如“@RequiredArgsConstructor”。错误消息是:“org.simpleframework.xml.core.PersistenceException:构造函数与A类不匹配”。如果你愿意,我可以提供代码以获得更详细的信息 最佳答案 A类是否有一个没有参数的构造函数?这些是反序列化所必需的(尽管可以私有(private)化)。如果您只有带参数的构造函数,

android - 混淆器 - PersistenceException : Constructor not matched for class

我在我的应用程序中使用retrofit2.0和simpleframework.xml库。问题是当我在没有proguard的情况下运行应用程序时它工作正常但是当我运行proguard时我在日志中收到以下错误。E/ERROR:java.lang.RuntimeException:org.simpleframework.xml.core.PersistenceException:ConstructornotmatchedforclassA类A没有/默认构造函数应该可以工作。我仍然添加了一个NoArgumentConstructor。但这并没有解决问题。A级@Root(name="data",

java - MySQL PersistenceException, Play 中的 "Connection is closed"! 2.2

我正在试用Play框架并使用2.2.0版本和Java版本。我想使用MySQL作为数据库,我已经按照网站上的说明进行操作。我可以运行evolution脚本,但无法将任何内容保存到数据库中。在数据库中创建的表。我在尝试调用我的Controller中的Ebean.save()方法时得到了[PersistenceException:java.sql.SQLException:Connectionisclosed!]。我所做的是:设置build.sbt并添加插件libraryDependencies++=Seq(javaJdbc,javaEbean,cache,"mysql"%"mysql-co

MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException

类型异常报告消息Requestprocessingfailed;nestedexceptionisorg.mybatis.spring.MyBatisSystemException:nestedexceptionisorg.apache.ibatis.exceptions.PersistenceException:描述服务器遇到一个意外的情况,阻止它完成请求。例外情况org.springframework.web.util.NestedServletException:Requestprocessingfailed;nestedexceptionisorg.mybatis.spring.MyB

nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error querying database

将项目部署到博客上出现错误,连接数据库失败,注意在本地运行和在服务器上数据库密码nestedexceptionisorg.apache.ibatis.exceptions.PersistenceException:\n###Errorqueryingdatabase.Cause:org.springframework.jdbc.CannotGetJdbcConnectionException:FailedtoobtainJDBCConnection;nestedexceptionisjava.sql.SQLException:Accessdeniedforuser‘root’@‘localho

java - 三层架构和异常(exception)

为每一层应用程序设置异常被认为是一种很好的做法(即PresentationException、ServiceException、PersistenceException等)。但是,如果我的服务层直接调用DAO方法(持久层的方法)而不进行额外的操作呢?像这样:publicclassMyService{privateIPersonDAOdao=newPersonDAO();publicvoiddeletePerson(intid){dao.deletePerson(id);}}我是否应该用try-catchblock包装这个DAO方法调用并将可能的异常重新抛出为ServiceExcepti
12