Tagged Questions
2
votes
4answers
43 views
Why in Java incompatibility of types to casting is checked at runtime and type mismatch to converting at compile time?
Let's say there are 2 classes. And Child extends Parent.
public class Parent {}
and
public class Child extends Parent {}
I know that the following code is incorrect:
Child obj = new Parent(); ...
1
vote
0answers
52 views
pdf-renderer runtime exception java.lang.NoClassDefFoundError: com/sun/pdfview/PDFFile
I've added the pdf-renderer-1.0.5.jar as an external JAR to my java GWT project.
While accessing "PDFFile pdfFile = new PDFFile (buf);" in the following code I get
java.lang.NoClassDefFoundError: ...
0
votes
1answer
30 views
Rollback with catched RuntimeException
I clearly need some help about transaction roll back. I'm working on a Spring/JPA/Hibernate application.
For me, RuntimeException even if they are catched, are rolling back the transaction. I deduce ...
0
votes
0answers
47 views
the page 1 was request but the document has only 0 pages
So I am trying to generate a report that may contain many pages depending upon the user input and data.
Similar error was summarized here but its not seen to be the actual solution of the problem.
...
1
vote
1answer
69 views
java.lang.RuntimeException: exception while registering MBean, com.scale7.cassandra.pelops.pool:type=PooledNode-my_keyspace-localhost
I am working on a project in which I need to insert data into Cassandra database. So for that I am using Pelops client.
I have a Multithreaded code which will insert into Cassandra database using ...
1
vote
1answer
145 views
Caching bitmaps without External SD Card
The images will not cache on internal storage and crashes on devices without an External SD Card. I have tried what I know and nothing worked. Here is the ImageCache.java
package ...
0
votes
1answer
334 views
Android - Creating a PopupMenu on clicking an ActionBar button
I am trying to make a PopupMenu appear after I click a button in an action bar.
I have got the buttons in the file - action.xml in the 'menu' folder.
This contains the buttons for the ActionBar.
...
-2
votes
6answers
88 views
NullPointerException for Android Java
I had a previous question similar to my current problem, and that was when I retrieved null values from my String arrays, now my problem is that I think I'm also getting null values from my integar ...
0
votes
0answers
53 views
Connector.open(String s) causes a RuntimeException
I have a little program here where I try to create a server socket on the port 1234.
public class SocketTest {
public static void main(String[] args) {
try {
...
3
votes
2answers
87 views
Java - How to deal with checked exceptions *as a group*?
EDIT: This question relates to Java 1.6 (and below). Apologies for not making this clear in the original post.
The hierarchy here shows Java Exception is divided into two types: RuntimeException and ...
0
votes
2answers
71 views
RuntimeException with SQLite database - Android
I tried to alter some of my file names on my laptop and I must have screwed something up with my program. The program runs fine until when it gets to the point where it needs to open the SQLite ...
0
votes
1answer
148 views
Java Runtime.exec() hanging
I am getting into the Defunct zombie process whenever the below code is executed. Could someone help me to resolve this issue.
private static boolean executeCommand(String command)
throws ...
2
votes
1answer
182 views
Android Preference for API lower and higher than 3.0
Im having a FC issue on my preference setup. I looked on the web for some preference examples to work for both API lower and higher than 3.0. So I got 2 xml preference files just like the tutorial. ...
0
votes
1answer
119 views
Object Animator throws Runtime Exception though everything looks okay to me. Please point out what is causing this
It was running okay before adding and object animator to animate an ImageView. But after creating an animation, it started throwing Runtime Exceptions. I can not figure out what is the problem though ...
0
votes
0answers
18 views
Eclipse RCP RunTimeException
The following code runs ok, but eclipse RCP framework is catching a RunTimeException (ModalContextThread run method of ModalContext class) and there's no information about the reason.
for(int i=0; ...
1
vote
0answers
248 views
Difference between RuntimeException and Exception with @ApplicationException(rollback=true) in EJB container
I call account EJB method in JSF bean like that :
try{
account.someFunction(...);
}catch(SimRuntimeException e){
logger.log(Level.FATAL, "SimRuntimeException catched !");
...
3
votes
2answers
231 views
Java uncaughtExceptionHandler not working
I have a global exception handler routine which wraps some exceptions in runtime exceptions
Like this
public class ExceptionHandler
{
public static void handle(){
throw new RuntimeException(e);
...
-1
votes
3answers
84 views
How does Java efficiently check for ArrayIndexOutOfBounds? [closed]
What mechanism does Java use to efficiently check if the array element I'm trying to access is out of bounds. The one way I thought it could do it is by having metadata before the array in memory. But ...
0
votes
0answers
39 views
Would like an understanding on how AspectJ manages RuntimeExceptions with “After Throws”
The problem I currently would like to understand is how AspectJ handles "After Throws" aspects with a subclass of the Runtime Exceptions
I currently have this aspect.
public aspect MyExceptionAspect ...
2
votes
1answer
73 views
Java Data Objects Specification using only Runtime Exceptions?
We are evaluating JDO for using as the Data Management Layer in our application . The requirement is to have a well abstracted Data management with zero dependencies with any of the Data stores.
We ...
1
vote
2answers
1k views
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=intent} to activity
In my app I hit a button called Pick Photo and it loads the gallery. When I click an image in the gallery, the app force closes and in my logcat I receive the following:
...
0
votes
1answer
110 views
Where can I find an updated version of “libvlc” that will work with vlcj 2.1.0?
I am trying to compile code for the Java binding of VLC player with vlcj 2.1.0 and I am getting the error:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: This version of vlcj ...
4
votes
3answers
290 views
Is it possible to catch all exceptions except runtime exceptions?
I have a statement that throws a lot of checked exceptions. I can add all catch blocks for all of them like this:
try {
methodThrowingALotOfDifferentExceptions();
} catch(IOException ex) {
...
1
vote
1answer
180 views
How to solve this hibernate runtime exception?
I am trying to run following code in eclipse
package com.trial;
import java.sql.*;
import java.io.*;
import org.hibernate.*;
import org.hibernate.cfg.*;
public class AddStudent {
private ...
-2
votes
1answer
174 views
Java Blackberry NullPointerException
I have a program that at the moment doesn't do anything other than display the time and allow the user to press a button that will lead him to a different screen which i turn will display a dialog to ...
0
votes
1answer
190 views
Android: Cannot instantiate receiver
I am developing an android application that receives SMS messages and uses this data inside the application. Because I want the SMS messages' BroadCastreceiver to close when I close the application, I ...
0
votes
0answers
103 views
RunTimeException trying to load admob adview from xml
I'm trying to put ads into my application from Admobs. I've done this for a previous application of mine and ran into no errors. However, when trying to put ads into this app it force closes with a ...
1
vote
3answers
165 views
how to trace a file from where exception is thrown?
I am getting an exception in my tomcat's log window, but I am not sure in which file the error is, here is the log output
Oct 19, 2012 11:09:36 AM org.apache.catalina.core.ApplicationContext log
...
0
votes
1answer
181 views
Why is this code throwing a ClassCastException in netbeans while its runing fine in eclipse
//Runtime Exception
Runtime exception occurs when following code is called in netbeans. works fine in eclipse.
public List<Ticket> findOpenTickets() {
Session session = null;
...
0
votes
2answers
183 views
J2ME - LWUIT Java runtime exception - You must include the platform port before the LWUIT in the classpath>
Before you ask, yes I did see and try the solution here already.
But it didn't work. I keep getting the error. "You must include the platform port before the LWUIT in the classpath."
I am using ...
1
vote
3answers
213 views
Why runtime exception is unchecked exception?
Generally if any class extends Exception , it becomes checked exception. Runtime exception also extends Exception. Then how is it unchecked exception?
Is it like they have a custom check in compiler ...
4
votes
2answers
167 views
int i=99 is working however int i = 099 not working
In Java, I noticed that when I write
int i = 99;
it works fine. However when I say
int i = 099;
I get an exception:
java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: ...
4
votes
1answer
133 views
Method Over riding and Inheritance and Exceptions
Can a method in a subclass override a method in the parent class and throw a run time exception when the method in the parent class throws no exception? Something like this:
class X { public void ...
0
votes
0answers
189 views
Getting an error in my Developer Console on one of my Go Launcher Themes
This seems to only happen on my free themes. none of my paid themes seem to ever have any errors. Any idea why this error is happening?
java.lang.ClassNotFoundException
Source method ...
0
votes
1answer
340 views
Android coverflow : Error inflating class pl.polidea.coverflow.CoverFlow
I try to add the android coverflow in my own android projet
when myt activity launched , I get the following error:
06-18 15:32:35.690: E/AndroidRuntime(15146):
java.lang.RuntimeException: Unable ...
0
votes
2answers
43 views
Catching Runtime Exceptions in 3rd party code
I have developed a framework which allows other people to plug-in different implementations of optimizers. These optimizers are run asynchronously and I have attached listeners to run before and after ...
0
votes
2answers
128 views
All RuntimeException / Un-checked exception advocates, how would you handle this scenario?
Scenario:
For a web-site which requires registration based on user id, the user id must be unique. Lets say a user has attempted to register with 'foo' user id, which already exists (with other ...
0
votes
0answers
201 views
RuntimeException for xpath
i have a function which in this function, i use Xpath to get the position of a node as below:
Node goTo;
.....
private Node xpathgo(Node node) throws XPathExpressionException {
XPath ...
0
votes
1answer
96 views
java: Exceptions: always reach finally? [duplicate]
Possible Duplicate:
Does a finally block always run?
let's imagine the following scenario:
public void myMethod() throws MyException
try
{
// do something
// an Exception ...
0
votes
1answer
43 views
RunTimeExcception is checked/unchecked?
I am confused with checked/unchecked exception. I think RunTimeException is unchecked exception then why Its coming under the Exception class ??
Consider a case .. My superclass constructor is ...
0
votes
3answers
171 views
Best way to do Error Handling
I'm thinking of implementing better ways of error handling through exceptions. When I'm deep in my code and want to return an error, I have two options:
Throw an exception that extends runtime ...
2
votes
2answers
400 views
How do I find this RuntimeException in Android (stack trace)?
I have this strack trace from the Developer Console on Google Play so I have no way to reproduce this exception cause I don't know what triggers it. The user also didn't leave any message, so...
...
2
votes
1answer
255 views
In Java, why dont I need to import RuntimeException to use it?
If I try to use IOException without the fully qualified name and without importing, I get a compilation error. But it doesn't happen when I do the same with, say, RuntimeException or Exception.
Why is ...
2
votes
4answers
94 views
Design issue: to what extent should I rely on exceptions for the flow of control?
I am working on a java web application and I have a few questions regarding design.
Basically in its current version, it relies heavily on catching exceptions to determine the flow of control.
For ...
5
votes
1answer
444 views
Guava EventBus: don't catch RuntimeException
I use guava's EventBus, unfortunately it catches and logs the InvocationTargetException that occurs when an event-handler throws a RuntimeException. Can i disable this behaviour?
0
votes
2answers
447 views
java.lang.RuntimeException with android application
I'm having problems with my application. Shortly after compiling, the application randomly closes. Checking LogCat shows that it is a java.lang.RuntimeException. I've been through all of the forum ...
2
votes
1answer
1k views
Android Fatal error “Unable to instantiate Activity”
I am getting a fatal error in an application that I have been working on. The log file and code is as follows. From what I can tell it is not even getting to the main activity.
Log File:
Shutting ...
1
vote
4answers
235 views
Java what is the benefit of Throwing RuntimeException
What is the benefit of declaring (Unchecked Exception)throws exception along method signature b/c it does not force caller to keep in try catch block.
public void testRuntimeEx()throws ...
0
votes
1answer
1k views
how to resolve org.eclipse.core.internal.resources.ResourceException
i never encountered this exception before
org.eclipse.core.internal.resources.ResourceException: Resource '/External Plug-in Libraries' is not open.
at ...
0
votes
1answer
185 views
CurrencyWidget app run time errors
I am new to android programming, just got the code from http://www.droiddraw.org/tut4.html and trying to make a currency converter application. I am planning to get the currency conversion rates from ...