Search Results

Search found 13112 results on 525 pages for 'exception duck'.

Page 79/525 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • document.evalute function giving exception

    - by R_Dhorawat
    i have a code like res = doc.evalute(xpathExpr,doc,function(prefix) { return namespaces[prefix] || null;}, XPathResult.ANY_TYPE,null ); here doc is DOM document node when i run for loop like this for(i in doc)alert(i); it gives evalute method but when i tried to use this method on dom node it giving me error like xpathResult not defined... i'm working in android browser thanks in advance....

    Read the article

  • Left outer join in LINQ is showing exception

    - by stackuser3
    The folloqing is the excpetion I am getting The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type. below is my LINQ Statement where QuestionId is the primary key in my table var questionViewsData = from questionViews in objDc.SC_QuestionsViews join questions in objDc.SC_Questions on questionViews.QuestionId equals questions.QuestionId into qs from questions in qs.DefaultIfEmpty() where questionViews.CreatedDate.Date == new DateTime(2010, 4,27) select new { Selected =(questions == null ?-1:questions.QuestionId), QuestioinTitle = questions.Title, VotesCount = questions.VotesCount }; Let me know how to resolve this

    Read the article

  • Why I get UnsupportedOperationException when trying to remove from the List?

    - by Pentium10
    I have this code: public static String SelectRandomFromTemplate(String template,int count) { String[] split = template.split("|"); List<String> list=Arrays.asList(split); Random r = new Random(); while (list.size()>count) { list.remove(r.nextInt(list.size())); } return StringUtils.join(list, ", "); } I get this: 06-03 15:05:29.614: ERROR/AndroidRuntime(7737): java.lang.UnsupportedOperationException 06-03 15:05:29.614: ERROR/AndroidRuntime(7737): at java.util.AbstractList.remove(AbstractList.java:645) How would be this the correct way? Java.15

    Read the article

  • how to delete in Mysql

    - by Ian Moss
    i want to delete a element in mysql. the problem is that my connection not succesfully open and they give me error unable to connect even same connectionstring work elsewhere in current project. well when my code open the connection they work fine. but a small function try to delete a row in Mysql. i am confused what is goes wrong because :- same connectionstring work elsewhere in project i trying but a function only have a project [unable to connect] the [unable to connect] problem come when my code trying to delete the rows in mysql. i use sqlyog to open the connection and they work fine as other code work and their is no problem i got when i run the command on sqlyog. conclusion:- why connection not open if they work elsewhere in the project and in also in sqlyog. any reason for unable to connect. because connection can not open offcourse command never run so what is reason upon the connection unable to connect. well any suggestion , thing you feel and trick you have to solve this issue i have. thanks

    Read the article

  • CAn unused exception variable when catching all exceptions

    - by b0x0rz
    what is a best practice in cases such as this one: try { // do something } catch (SpecificException ex) { Response.Redirect("~/InformUserAboutAn/InternalException/"); } the warning i get is that ex is never used. however all i need here is to inform the user, so i don't have a need for it. do i just do: try { // do something } catch { Response.Redirect("~/InformUserAboutAn/InternalException/"); } somehow i don't like that, seems strange!!? any tips? best practices? what would be the way to handle this. thnx

    Read the article

  • Redirect on catching an exception in a method in the model

    - by Arkid
    I am using Authlogic-connect to connect various service providers. There is a method in user.rb def complete_oauth_transaction token = token_class.new(oauth_token_and_secret) old_token = token_class.find_by_key_or_token(token.key, token.token) token = old_token if old_token if has_token?(oauth_provider) self.errors.add(:tokens, "you have already created an account using your #{token_class.service_name} account, so it") else self.access_tokens << token end end When a service provider is already added it gives the error as stated in the has_token? method and the page breaks. I need to redirect the app to the same page and flash the error. How do i do this? I have overridden the method in my own user.rb so that I can change the code.

    Read the article

  • No Hibernate Session bound to thread exception

    - by Benchik
    I have Hibernate 3.6.0.Final and Spring 3.0.0.RELEASE I get "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here" If I add the thread specification back in, I get "saveOrUpdate is not valid without active transaction" Any ideas? The spring-config.xml: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="org.hsqldb.jdbcDriver"/> <property name="url" value="jdbc:hsqldb:mem:jsf2demo"/> <property name="username" value="sa"/> <property name="password" value=""/> </bean> <bean id="sampleSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="sampleDataSource"/> <property name="annotatedClasses"> <list> <value>com.maxheapsize.jsf2demo.Book</value> </list> </property> <property name="hibernateProperties"> <props> <!-- prop key="hibernate.connection.pool_size">0</prop--> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <!-- prop key="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop> <prop key="hibernate.current_session_context_class">thread</prop--> <prop key="hibernate.hbm2ddl.auto">create</prop> </props> </property> </bean> <bean id="sampleDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>org.hsqldb.jdbcDriver</value> </property> <property name="url"> <value> jdbc:hsqldb:file:/spring/db/springdb;SHUTDOWN=true </value> </property> <property name="username" value="sa"/> <property name="password" value=""/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sampleSessionFactory"/> </bean> <bean id="daoTxTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="transactionManager"/> <property name="transactionAttributes"> <props> <prop key="create*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> <prop key="get*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> </props> </property> </bean> <bean name="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> <property name="sessionFactory" ref="sampleSessionFactory"/> <property name="singleSession" value="true"/> </bean> <bean id="nameDao" parent="daoTxTemplate"> <property name="target"> <bean class="com.maxheapsize.dao.NameDao"> <property name="sessionFactory" ref="sampleSessionFactory"/> </bean> </property> </bean> and the DAO: public class NameDao { private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public SessionFactory getSessionFactory() { return sessionFactory; } @Transactional @SuppressWarnings("unchecked") public List<Name> getAll() { Session session = this.sessionFactory.getCurrentSession(); List<Name> names = (List<Name>)session.createQuery("from Name").list(); return names; } //@Transactional(propagation= Propagation.REQUIRED, readOnly=false) @Transactional public void save(Name name){ Session session = this.sessionFactory.getCurrentSession(); session.saveOrUpdate(name); session.flush(); } }

    Read the article

  • FileNotFound exception

    - by Pratik
    I am trying to read a file in a servlet. I am using eclipse IDE. I get a FileNotFoundException if I provide relative file name. List<String> ls=new ArrayList<String>(); Scanner input = new Scanner(new File("Input.txt")); while(input.hasNextLine()) { ls.add(input.nextLine()); } The same code works if I put the absolute path like this: Scanner input = new Scanner(new File("F:/Spring and other stuff/AjaxDemo/src/com/pdd/ajax/Input.txt")); The Java file and text file are there in the same folder. Does it searches text file in some other folder ?

    Read the article

  • A Null Reference Exception

    - by Alex
    "Object reference not set to an instance of an object." using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace XNAdev { class Sprite { //The size of the Sprite public Rectangle Size; //Used to size the Sprite up or down from the original image public float Scale = 1.0f; //The current position of the Sprite public Vector2 Position = new Vector2(115, 0); //The texture object used when drawing the sprite private Texture2D mSpriteTexture; //Load the texture for the sprite using the Content Pipeline public void LoadContent(ContentManager theContentManager, string theAssetName) { mSpriteTexture = theContentManager.Load<Texture2D>(theAssetName); Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale)); } //Draw the sprite to the screen public void Draw(SpriteBatch theSpriteBatch) { theSpriteBatch.Draw(mSpriteTexture, Position, new Rectangle(0, 0, mSpriteTexture.Width, mSpriteTexture.Height), Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0); } } } I am very new at this C# so any help would be great. I have no idea what my error is.

    Read the article

  • Get name mangling when I try to use exceptions [CodeBlocks, C++]

    - by Beetroot
    I am trying to use exceptions for the first time but even though it is quite a simple example I just cannot get it to compile, I have looked at several examples and tried coding it in many, many different ways but I am still not even sure exactly where the problem is because I get namemangling when I introduce the catch/try/throw anyway here is my code hopefully it is something really stupid :) #include "Surface.h" #include "SDL_Image.h" using namespace std; SDL_Surface* surface::Load(string fileName){ SDL_Surface* loadedSurface = IMG_Load(fileName.c_str()); if(loadedSurface == 0) throw 0; //Convert surface to same format as display loadedSurface = SDL_DisplayFormatAlpha(loadedSurface); return loadedSurface; } #include "GameState.h" #include "Surface.h" #include<iostream> using namespace std; GameState::GameState(string fileName){ try{ stateWallpaper_ = surface::Load(fileName); } catch(int& e){ cerr << "Could not load " << fileName << endl; } } Thanks in advance for any help! EDIT: Sorry I forgot to post the error message: It is In function `ZN14GameStateIntroC1Ev':| -undefined reference to `__gxx_personality_sj0'| -undefined reference to `_Unwind_SjLj_Register'| -undefined reference to `_Unwind_SjLj_Unregister'| In function `ZN14GameStateIntroC1Ev':| undefined reference to `_Unwind_SjLj_Resume'| In function `ZN14GameStateIntroC2Ev':| -undefined reference to `__gxx_personality_sj0'| -undefined reference to `_Unwind_SjLj_Register'| -undefined reference to `_Unwind_SjLj_Unregister'| obj\Release\GameStateIntro.o||In function `ZN14GameStateIntroC2Ev':| C:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\ext\new_allocator.h|69|undefined reference to `_Unwind_SjLj_Resume'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `redirect_output':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|219|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|220|undefined reference to `SDL_strlcat'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|243|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|244|undefined reference to `SDL_strlcat'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `console_main':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|296|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|301|undefined reference to `SDL_GetError'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|312|undefined reference to `SDL_SetModuleHandle'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `WinMain@16':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|354|undefined reference to `SDL_getenv'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|386|undefined reference to `SDL_strlcpy'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `cleanup':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|158|undefined reference to `SDL_Quit'| **

    Read the article

  • C# DateTime.ParseExact throwing format exception

    - by Rob
    I'm developing an .NET4 webapplication using MVC3. Let's say i'm getting the following DateTime as string from an XML-feed. The xml feed is being read by my application and i'm looping through all it's descendants. The DateTime i'm receiving is begin returned in the following format (as string); var myDateTime = "Sun Dec 19 11:45:45 +0000 2010" I'm using the piece of code below to try and parse the DateTime string i mentioned above to a valid DateTime format (preferably dutch) var CorrectDateTime = DateTime.ParseExact(myDateTime , "dd MMM yyyy HH:mm:ss", CultureInfo.InvariantCulture); When trying to execute this code i'm facing an formatexception. Somebody has got any ideas?

    Read the article

  • DateTime.ParseExact string format exception.

    - by Rob Ferno
    I am trying to convert a string into datetime with the following C# code, DateTime dTo = DateTime.ParseExact(dateTo, "mm/dd/yyyy", CultureInfo.InvariantCulture); eachtime I pass dateTo as 1/1/2010 it fails, instead it needs the string to be 01/01/2010. What string format should I use to support both 01/01/2010 and 1/1/2010?

    Read the article

  • NUll exception in filling a querystring by mocing framework

    - by user564101
    There is a simple controller that a querystring is read in constructor of it. public class ProductController : Controller { parivate string productName; public ProductController() { productName = Request.QueryString["productname"]; } public ActionResult Index() { ViewData["Message"] = productName; return View(); } } Also I have a function in unit test that create an instance of this Controller and I fill the querystring by a Mock object like below. [TestClass] public class ProductControllerTest { [TestMethod] public void test() { // Arrange var querystring = new System.Collections.Specialized.NameValueCollection { { "productname", "sampleproduct"} }; var mock = new Mock<ControllerContext>(); mock.SetupGet(p => p.HttpContext.Request.QueryString).Returns(querystring); var controller = new ProductController(); controller.ControllerContext = mock.Object; // Act var result = controller.Index() as ViewResult; // Assert Assert.AreEqual("Index", result.ViewName); } } Unfortunately Request.QueryString["productname"] is null in constructor of ProductController when I run test unit. Is ther any way to fill a querystrin by a mocking and get it in constructor of a control?

    Read the article

  • SWIG: Throwing exceptions from Python to C++

    - by wheaties
    We've got an interface we've defined in C++ (abstract class, all functions pure virtual) which will be extended in Python. To overcome the cross-language polymorphism issues we're planning on using SWIG directors. I've read how to catch exceptions thrown from C++ code in our Python code here, here, here, and even on SO. It's fairly straight forward and I'm not expecting issues with handling our library's own exceptions. What I'd like to know and can't seem to find in the documentation is how to have our Python implementation of the extended C++ interface throw those C++ exceptions in a way that makes them visible to the C++ code. We could make small functions within the *.i files such that each function throws our exceptions: void throw_myException(){ throw MyException; } but I'm wondering how it will interact with the Python code. Anyone have any experience with throwing C++ exceptions from Python code?

    Read the article

  • ListView exception for Images + Text

    - by drozzy
    I am trying to create a simple Icon+Text ListView but it does not work. I am using 2.1 Android SDK. My main class is very small slightly modified from the tutorial: public class Stuffs extends ListActivity { static final String[] COUNTRIES = new String[] {"A", "B","C"}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.title, COUNTRIES)); } } and my list_item.xml file is this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation = "horizontal"> <ImageView android:id = "@+id/icon" android:src="@drawable/icon" /> <TextView android:id = "@+id/title" android:padding="10dp" android:textSize="16sp" > </TextView> </LinearLayout> I have also created a "drawable" directory in my res directory and copied a "icon.png" into it. But any time I try to run this the application hangs up unexpected in my android emulator. Am I missing something?

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >