w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Ok in simulator but throwing exception in ios device
First, you need to set an exception breakpoint in Xcode - there are many posts here on how to do that. Second, after each of you statements where an object is created or returned, add an assert: NSURL *foo = ... assert(foo); Doing this will help you find the first issue not the last one.

Categories : Iphone

In Karaf OSGI, I am getting ClassNotFoundException for a class that is IN the bundle that is throwing the exception
Oh, what tangled webs we weave when we want to avoid using services :-( This utter mess is caused by Java's lack of a service registry. I assume your problem is that jersey tries to load from YOUR bundle since it finds the services directory in that bundle. Since you don't have those classes, Jersey balks correctly. The original solution is to place those files in the services directory in the jersey bundle, requiring you to open up that bundle. If the jersey bundle exports the implementation packages (the anathema of modularity but often done in code that does not understand OSGi) you could import those packages in your bundle even though you do not use them directly. Another alternative, which I have not checked out, is to use an OSGi hack: fragments. You can make a fragment to the j

Categories : Java

System.Net.WebException: Error: NameResolutionFailure when Calling WCF Services throwing exception in mono android application
I know this is an old post, but was facing the same error, so thought to share the solution. The best solution I found, when that exception occurs while the Wifi is connected, is just to retry my server call with a slight sleep in between. It works most of the time, otherwise if the second call fails I cancel the request. This error can also raise if the user's Wifi is very unstable or the signal is very low. The same error occurs if there is no internet connection at all, even if connected to Wifi.

Categories : Android

Migrating to EntityFramework 5 - NotMapped attribute in base class throwing exception
I am able to get it working by commenting the NotMapped attribute in the User (base) Entity, and instead using the Fluent API Ignore as given below. public class DonorContext : DbContext { protected override void OnModelCreating(DbModelBuilder modelBuilder) { //Added for EF 5 modelBuilder.Entity<User>().Ignore(u => u.StringVersion); } } Since I have only a few NotMapped attributes for Inherited Entities, I can get away with the above workaround. I hope Ignore behavior is same as NotMapped, and using one in place of other does not cause any issues.

Categories : Entity Framework

IBM Worklight - exception when trying to open application in Android device
In addition to what I have mentioned in my comment to your question, the most common cause to this is using Worklight 5.0.5/6.x in conjunction with ADT v22. To fix the issue, follow these steps: Right-click on your generated Android project and choose "properties". From the left pane, choose "Java Build Path' Tick the "Android Private Libraries" checkbox Refresh the project / re-build the app As for changing the name of the application, see instructions in this SO question: IBM Worklight - how to rename an application and change its icon, splash image

Categories : Android

Using C# File class to edit file, but throwing exception
If this is a file on a live site then there's a good chance that the web server has a lock on it. Assuming your working in Windows, try using Process Explorer to see what has a lock on the file.

Categories : C#

Can I send a build of my app to people without them having a registered device?
The "iOS Developer Enterprise Program" allows you to distribute iOS apps to devices without having them registered, but it is allowed only for the distribution of in-house apps within a company. (The article http://www.iphonehacks.com/2013/07/apple-revokes-gba4ios-signing-certificate.html tells that the iOS Enterprise Program was abused to freely distribute apps and as a consequence, Apple revoked the certificate.)

Categories : Iphone

Throwing an exception while handling an exception
That's a bit misleading; it's fine to throw from an exception handler (which is what I'd understand by "while handling an exception"), as long as there's another handler to catch it. The problem is if you throw an exception from the destructor of an object that's being destroyed during stack unwinding. In that case, there are two unhandled exceptions, and the usual exception mechanism can only deal with one; so the response is to call terminate. Example: struct dodgy {~dodgy() {throw "Don't do this!";}}; try { dodgy d; throw 1; } catch (...) { // Never reached: destroying `d` killed the program. }

Categories : C++

I am running a RMI application and no security manager: RMI class loader disabled exception comes
The problem actualy lies in a classloading. When you're transferring some non-jdk objects (i.e. objects of your own classes) via RMI you need to ensure, that both JVMs, client and server, has your custom class in a classpath. In your case server lacks Client.prog class, so it's unable to reconstruct an object from binary representation - Client.prog class bytecode is necessary for that. There are generally two ways to resolve this issue: Easy one: copy all your data transfer object classes to both client's and servers's classpath. So none of them will be confused with unknown classes. For a somewhat serious you might even want to create a separate JAR with DTO classes for the ease of maintenance. Challenging one: enable remote classloading. In short, this technique enables your server to

Categories : Java

Web Service Throwing Exception
I'd have to see more of the code to get a better idea of which methods are yours and such, but at first glance I can see that you are passing in a few nulls into the service's GetListItems method. While this may be completely innocent, I'd have a look at the service's code/documentation if you can access it and see if it is expecting actual values instead of null. As a side note, if you are the one who created the service, I would try to make it in a way that I wouldn't have to manually build XML queries. I would try to make a WCF service that provides methods to accomplish what you want with minimal headaches.

Categories : Dotnet

Geocoder throwing odd exception
First off, you are trying to add objects to an immutable dictionary. The part of the exception beginning [<__NSDictionaryI 0x873a3c0> setValue:forUndefinedKey: gives a class name of __NSDictionaryI, which is an immutable member of the NSDictionary class cluster - so you cannot add any objects to it at run-time. You need to ensure that self.placeDictionary is assigned to an NSMutableDictionary instance before this code is called. Unfortunately, you are also using the wrong method to add the objects - you're using setValue:forKey: instead of setObject:forKey:. Since this method is part of the NSKeyValueCoding informal protocol, you're not stopped from doing this at compile time. You should instead use setObject:forKey: which is the correct method to set key-value pairs on an NSMutable

Categories : IOS

Exception - why even bother throwing?
Your client wants detailed error reporting. What went wrong, and where did it go wrong. They don't have a clue what a null pointer exception is. And even then, that in itself is not particularly helpful without the stack trace. So a null pointer gets passed into your RetrieveReportX method? Check if it's null and throw a ReportXNoIdentifierException rather than letting it auto-throw a null pointer exception. Then you'll have a error handler somewhere that, based on these custom exceptions, can report exactly what went wrong in what (human) process, and your client is happy because rather than NullPointerException at [stacktrace], they can see "An identifier was not supplied when attempting to retrieve report X."

Categories : Java

Throwing exception when the same key inserted into std::map
can std::map be forced to throw it? No. The behaviour of std::map is well-defined, and doesn't include throwing exceptions on duplicate insertions. If you want this behaviour, you should write a wrapper class.

Categories : C++

Android NFC throwing exception
I think that when you call mInfoText.setTextColor(Color.WHITE) mInfoText is null. Try initialising with findViewById() before you call setTextColor

Categories : Android

Bindings throwing exception
You have not included the code that is the root problem, but the exception says that the binding code is attempting to cast a String to a Date ... and that's a big no-no in Java! I suspect the problem is that you have a date-of-birth field in the User object that has type Date and the binding object is attempting to reflectively assign a String to it. If this is the problem, then you need to add a custom Converter to the relevant Binding object to convert between String and Date objects. It looks like you will need to write a custom converter to do the job. References: Adding a Converter - https://netbeans.org/kb/docs/java/gui-binding.html?print=yes An example of a custom Converter - https://weblogs.java.net/blog/pkeegan/archive/2007/11/beans_binding_c.html

Categories : Java

Throwing a terminate exception
Your error is saying that the setText method was sent to a UIView, not a UILabel. Thus, it would appear that you may have accidentally linked the IBOutlet to the UIView, as opposed to the UILabel (which is easy to do if you manually wrote the IBOutlet line). So, go into Interface Builder, remove the IBOutlet link in the "outlets inspector" (the last tab on the right) for the UIView (probably on the main view), and link up the IBOutlet for the label. By the way, you can avoid this sort of confusion if you refrain from manually writing that IBOutlet code, but rather control-drag from the label to the .h file in the assistant editor (and Interface Builder will write the IBOutlet line of code for you and it will be fairly easily identified if you accidentally grabbed the wrong control). See M

Categories : Objective C

throwing exception or asserting in java
An IllegalArgumentException is perfect for that purpose: if (arr1.length != arr2.length) { throw new IllegalArgumentException("Arrays do not have the same length: " + arr1.length + " != " + arr2.length); } I recommend throwing an exception, because this way, the caller of your method can decide what to do when that happens. The caller can exit the application by putting a System.exit(-1); statement or calling your custom terminate procedure (where you save changes, resources, settings, etc) in the catch body for IllegalArgumentException. FYI: Yes, assert is a feature you have to enable manually. Alternatively, you could print out the stacktrace of the error and exit immediately. But I do not recommend: if (arr1.length != arr2.length) {

Categories : Java

word.shape.name throwing Exception
I am unable to duplicate your error, however I am able to get your code to run with a few changes. Let me know if I've misinterpreted. Note the Missing variable used instead of objRange. I've also removed variables that were not applicable. using Word = Microsoft.Office.Interop.Word; using Alias = Microsoft.Office.Interop.Word; public Test() { var doc = new Alias.Document(); var doc2 = new Alias.Document(); var t = this.CloneModel(ref doc, ref doc2); } private bool CloneModel(ref Alias.Document objTargetDocument, ref Alias.Document objSourceDocument) { var missing = Type.Missing; Word.Shape objShape; objShape = objTargetDocument.Shapes.AddTextbox( Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationUpward, 0, 0, 0, 0, ref missing); <== note t

Categories : C#

Throwing exception in main method
Simple answer: You don't need to declare a method to throw if all the checked exceptions are handled by the code. See also: http://www.javapractices.com/topic/TopicAction.do?Id=129

Categories : Java

Does throwing an exception change its state?
I am not aware of anything. The two key things are when the Throwable is created when getStackTrace() is called it populates the actual array (until then it is stored off heap)

Categories : Java

Why is this throwing a string format exception
Look at this bit of your format string: function () { ... } Those braces are being interpreted as the start/end of placeholders. You need to double them: function () {{ ... }} So your complete declaration would be: private const string GoogleAnalyticsFormat = @"<script type=""text/javascript""> var _gaq = _gaq || []; _gaq.push(['_setAccount', '{0}']); _gaq.push(['_trackPageview']); (function () {{ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); }})(); </script>";

Categories : C#

Throwing an exception if resque is not enabled
AFAIK I dont thing such functionality exist in resque not atleast in v1-x-stable I believe, but Resque has few handy method which can help eventually Resque::Worker.all => Return List of all workers present Resque::Worker.working => Return List of currently running workers Case 1 : Now if your queue is * (GLOBAL QUEUE) then I believe checking the above Resque::Worker.all.empty? or Resque::Worker.length == 0 or Resque::Worker.present? would do the trick for you Case 2 Now if you dont have * (GLOBAL QUEUE) Perhaps then you need to hooks some of your codes to achieve that (lets assume your queue name is progress_bar) Resque::Worker.all.map { |worker| worker worker.to_s.split(':') =~ /(*|progress_bar)/ }.present? NOTE: I'm checking for * GLOBAL QUEUE as well as progr

Categories : Ruby On Rails

one-to-many mapping in grails throwing exception
You need to mock all related domain classes. Change : @TestFor(User) class UserTests { to @TestFor(User) @Mock(Post) class UserTests { If you need, the mock annotation support a list of classes, for example: @Mock([Domain1, Domain2, Domain3])

Categories : Grails

NamedParameterJdbcTemplate object throwing Exception
public class PermissionDeniedDataAccessException extends DataAccessException Exception thrown when the underlying resource denied a permission to access a specific element, such as a specific database table. Do you have permission to access alphabets table ?

Categories : Java

Compiler error when throwing exception
According to cppreference.com std::length_error has the two constructors: explicit length_error( const std::string& what_arg ); explicit length_error( const char* what_arg ); And you are trying to construct with an empty parameters list. You need to pass in a string to the constructor.

Categories : C++

Is it safe in PHP when throwing exception after curl_init
You'll want to close the handle before throwing the exception. if (!$response) { curl_close($ch); throw new Exception('Boom! No response...'); } When you throw an exception, it'll stop executing any more of your code in that section and bubble right up to where you catch it, else you'll get: Fatal error: Uncaught exception On the flip side, if you don't close the handle, it's not really that big of an issue. Just don't make a habit of it ;) However, looking at your code again, your exception doesn't make sense. You will have closed it in this case...

Categories : PHP

java throwing runtime exception
The stack trace should include a "Caused by" at the bottom... or if you're viewing this in a debugger, there should be a "cause" variable or something like that. I recommend just letting it crash and then checking the android log - it'll definitely print the "Caused by" under the stack trace in the log. The problem is that Android is failing to launch your activity. The most common reasons are: 1. You haven't declared the activity in your AndroidManifest.xml 2. Your code in onCreate (or another overriden method) is throwing an exception Check your "Caused by" and you'll find the exact reason.

Categories : Android

XmlPullParser.nextTag throwing an exception
This method will call next() and return event if it is START_TAG or END_TAG otherwise throw an exception. Here is the documentation you need to read so you understand how to parse xml.

Categories : Java

Less bundle is throwing a StackOverflow exception
You could change the bondule and instead load the LESS files load the CSS files generated by the Web Essentials you can configuire the CSS compilation.

Categories : Asp Net Mvc

Throwing exception when inserting data in C#
Database connection objects are not thread-safe and are not meant to be used in multiple threads at the same time. You should not parallelize the code across a single connection, instead you will need a separate connection for each distinct thread, and thus you cannot use Parallel.ForEach. You can see this documented on MSDN: OleDbConnection Class, Thread Safety section (near the bottom): Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. This means that static members of this type are thread-safe, instance-members are not, which means that the type as an object will not be thread-safe.

Categories : C#

How to find out what is throwing an exception using windbg
Since you have the debugger catching the exception and have determined that the Exception is being thrown by the method named 'CameraAlarmActivate', then you could set a breakpoint at the top of the method and step through it until the Exception hits. You can then inspect the variables and troubleshoot accordingly. From the Exception object you can also get more information. // Get stack trace for the exception with source file information var st = new StackTrace(ex, true); // Get the top stack frame var frame = st.GetFrame(0); // Get the line number from the stack frame var line = frame.GetFileLineNumber(); From here: C# get line number which thrown expection In general it isn't very good practice to have empty exception handler's because errors can go unnoticed. I would suggest at

Categories : Debugging

Compressed Delete Web API throwing exception
Since there is no content here, there is no need of creating a CompressedContent here, so you should add an additional check in the message handler. Example: if (response.Content != null && response.RequestMessage.Headers.AcceptEncoding != null) { string encodingType = response.RequestMessage.Headers.AcceptEncoding.First().Value; response.Content = new CompressedContent(response.Content, encodingType); }

Categories : Asp Net

WebBrowser throwing unhandled exception
Application.DoEvents() causes all sorts of problems. You should not be using it. My initial instinct was to remove the While loop altogether, as it does not appear to serve any purpose. But you said you had included it "to wait for the browser to complete its navigation before running the rest of the code." In that case, you should still take it out, but you should replace it with a handler for the WebBrowser.DocumentCompleted event, which is raised when the WebBrowser control finishes loading a document. Place whatever code you want to run in that event handler method. Private Sub YourCurrentMethod() WebBrowser1.Navigate("url") ' (no While loop) End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs) Handles We

Categories : Dotnet

Java Servlet throwing exception
From your description, it sounds like the data within the productive system is not the same as that in QA system. I noticed that your System.out.println("I am in the Chart Generation TRY Block"); is not being shown in the logs. Try changing the .out to .err and also try catching Throwable (http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html). catch ( Throwable t ) It is possible that will catch exceptions that Exception misses (I think), which might provide more information.

Categories : Java

Magick.NET-x64 is throwing a "dll not found" exception when deployed
Oh... I fixed this by installing the following, http://www.microsoft.com/en-us/download/details.aspx?id=30679 Hope that helps!

Categories : Asp Net Mvc

exception handling in C++: Throwing a double when using "throw(int)"
Your compiler isn't standard compliant. According to standard your program should end with calling std::unexpected after letting double exception escape fun1. That said - don't use exception specifications. They are deprecated and useless.

Categories : C++

Updating date in table throwing exception
If you want hundredths of a second you have to use TO_TIMESTAMP function. update ttt_table set UPDATEDDATE = To_Timestamp('03.03.03 14:29:34', 'DD.MM.YY HH24:MI:SS') WHERE NAME='SSSAAWW'; TO_DATE would look as follows: update ttt_table set UPDATEDDATE = To_Date('03.03.03 14:29:34', 'DD.MM.YY HH24:MI:SS') WHERE NAME='SSSAAWW';

Categories : Java

mvc4 PetaPoco like query throwing exception
var context = new PetaPoco.Database(Connection.connectionstring); SqlQuery = @"SELECT MenuId, MenuTitle, OrderNumber, CreatedDate, IsActive from Menu where MenuTitle LIKE @0"; List<MenuPOCO> objMenuPoco = context.Query<MenuPOCO>(SqlQuery, "%" + MenuTitle + "%").ToList(); return objMenuPoco;

Categories : C#

System.arraycopy() throwing out-of-bounds exception
Make your array copy read System.arraycopy(arr, 0, tempArr, 0, size); Why? argument #2 (int) startPos is where it should start copying from the source array, you were starting at the length of the array causing an index out of bounds. Take a look at http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#arraycopy(java.lang.Object%2C%20int%2C%20java.lang.Object%2C%20int%2C%20int) for more details on that method. Edit: First of all I solved your inital problem and you should figure out the rest of this on your own.. Read the arraycopy javadoc (that is very well written by the way). it should be System.arraycopy(arr, head, tempArr, 0, tail-head);

Categories : Java

sonar-runner throwing exception Ubuntu
I would guess that you have an error in your config. # path to source directories (required) sonar.sources=srcDir1,srcDir2 Are srcDir1 and srcDir2 really the folders where you have your source files? It seems you copied the config from some tutorial and forget to insert the correct folder names. Also you can remove the following lines, because I don't think you have any custom sonar parameters named like this. # Additional parameters sonar.my.property=value

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.