exception

org.hibernate.exception.DataException although is catched

别等时光非礼了梦想. 提交于 2019-12-24 11:25:18
问题 I am working with Hibernate (hibernate3.jar) with and object "Cliente", like this: public class Cliente { private nombre; ... //set and get } The "nombre" attribute is mapped as: <property name="nombre" type="string"> <column name="nombre" length="30" not-null="true" /> </property> As you can see above, there is a character length limit squals to 30 . Here the things get complicated... I am trying to update the name with a long name in order to force an error: Session session = HibernateUtil

Unable to wrap DAO exception in service layer using Spring MVC

懵懂的女人 提交于 2019-12-24 11:22:03
问题 I am trying to handle custom exception handling using Spring MVC. DAO layer exception handler by service layer and service layer wrap that exception and handle that exception by Controller exception handler by Spring MVC. Following is my code: @Override public void saveNewMachineDetails(Machine machine, Configurations configurations) throws DataNotPersist{ logger.info("call service saveNewMachineDetails method"); try{ machineRepository.saveAndFlush(machine); }catch(Exception ex){ // logger

xamarin build pass on simulator but fails on real device

故事扮演 提交于 2019-12-24 11:21:16
问题 I am creating an app using xamarin to be cross plateform. My android version works well on a simulator and a real device. The ios version works only in the simulator. When I try to debug on a real device I get this error Error MT2002: Failed to resolve "System.Reflection.Emit.DynamicMethod" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" (MT2002) with noting more... 回答1: Check the Xamarin.iOS limitations: http://developer.xamarin.com/guides/ios

JNDI InitialContext not working in simple netbeans project

喜你入骨 提交于 2019-12-24 11:00:46
问题 Warning: New to Java I have a simple Netbeans project - I wanted to just learn about interacting with DB's coming from php I thought I would have a go with a local one running on my computer. Lots of the examples out there say to use the InitialContext() object to refer to the database resource. After following the examples I get the following exception - Lots of Google stuff points to some .xml file - which I have no idea about or even where it exists in the Netbeans project? I'm not using a

Error when trying to test an isolated IQueryable

元气小坏坏 提交于 2019-12-24 10:57:13
问题 Context: I want to test whether a piece of code that purports to layer some operations on top of an IQueryable<T> actually does so. But when I start with code that is known to work, and try to write a test to exercise it, I get an unintelligible error. Actual Question: I would like to understand that error, what it means, and why it is happening. Not an X-Y questions!! I'm not interested here in what the best way to achieve my original goal is, or whether this test would have achieved it. I'm

Android android.database.CursorIndexOutOfBoundsException: Index 2 requested, with a size of 2

和自甴很熟 提交于 2019-12-24 10:47:31
问题 I have this log 07-27 21:42:05.635: ERROR/AndroidRuntime(26094): FATAL EXCEPTION: main 07-27 21:42:05.635: ERROR/AndroidRuntime(26094): android.database.CursorIndexOutOfBoundsException: Index 2 requested, with a size of 2 07-27 21:42:05.635: ERROR/AndroidRuntime(26094): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580) 07-27 21:42:05.635: ERROR/AndroidRuntime(26094): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214) 07-27 21:42

NegativeArraySizeException ANTLRv4

℡╲_俬逩灬. 提交于 2019-12-24 10:39:41
问题 I have a 10gb file and I need to parse it in Java, whereas the following error arises when I attempt to do this. java.lang.NegativeArraySizeException at java.util.Arrays.copyOf(Arrays.java:2894) at org.antlr.v4.runtime.ANTLRInputStream.load(ANTLRInputStream.java:123) at org.antlr.v4.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:86) at org.antlr.v4.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:82) at org.antlr.v4.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:90) How can

How to handle exception due to expired authentication ticket using UpdatePanel?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 10:39:15
问题 I am pretty sure the reason of the error is because the forms authentication "ticket" has expired. When the users have not done any pagerequest for the last 20 minutes and click on any of GridView links (to edit, delete, sort...) the exception is raised: Sys.WebForms.PageRequestManagerServerErrorException 12031. The exception is only raised when the GridView is inside an UpdatePanel . If I delete the UpdatePanel, the application redirects the user to the login page, which should be the

Gradle build / test failed - kryo.KryoException: Buffer overflow

余生颓废 提交于 2019-12-24 10:38:44
问题 While running a Gradle build, tests are failing. PS: 1. Gradle is using the correct JDK (1.6) to build. 2. I tried this with JDK 1.7, same error comes there as well. 3. I don't see this error when I build it locally (with JDK 1.6) on a linux/windows 4. machine but one of the machine is giving me this error. My ?s 1. What can be done to fix the com.esotericsoftware.kryo.KryoException: Buffer overflow error. 2. Why Gradle process failed, even when test section in build.gradle says: test {

Catching some exceptions but ignoring others - why doesn't this work?

旧街凉风 提交于 2019-12-24 10:35:18
问题 I have something similar to this. void func() { try { //socket disconnects in middle of ..parsing packet.. } catch(Exception ex) { if(!ex.getMessage().toString().equals("timeout") || !ex.getMessage().toString().equals("Connection reset")) { debug("Exception (run): " + ex.getMessage()); ex.printStackTrace(); } } Why is it that when I get a connection reset exception or a timeout exception, it still goes inside the condition. I tried without toString and with no luck. 回答1: You shouldn't catch