Search Results

Search found 504 results on 21 pages for 'stacktrace'.

Page 15/21 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Deserializing JSON in WCF throws xml errors in .Net 4.0

    - by Syg
    Hi there. I'm going slidely mad over here, maybe someone else can figure out what's going on here. I have a WCF service exposing a function using webinvoke, like so: [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "registertokenpost" )] void RegisterDeviceTokenForYoumiePost(test token); The datacontract for the test class looks like this: [DataContract(Namespace="Zooma.Test", Name="test", IsReference=true)] public class test { string waarde; [DataMember(Name="waarde", Order=0)] public string Waarde { get { return waarde; } set { waarde = value; } } } When sending the following json message to the service, { "test": { "waarde": "bla" } } the trace log gives me errors (below). I have tried this with just a string instead of the datatype (void RegisterDeviceTokenForYoumiePost(string token); ) but i get the same error. All help is appreciated, can't figure it out. It looks like it's creating invalid xml from the json message, but i'm not doing any custom serialization here. The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'RegisterDeviceTokenForYoumiePost'. Unexpected end of file. **Following elements are not closed**: waarde, test, root.</Message><StackTrace> at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)

    Read the article

  • Why compiler go to suspend mode when want to open database?

    - by rima
    Dear friend I try to connect to database with a less line for my connection string... I find out s.th in oracle website but i dont know Why when the compiler arrive to the line of open database do nothing????!it go back to GUI,but it like hanging...please help me to solve it. p.s.Its funny the program didnt get me any exception also! these service is active in my computer: > Oracle ORCL VSS Writer Service Start > OracleDBConsolrorcl > OracleJobSchedulerORCL Start > OracleOraDB11g+home1TNSListener Start > oracleServiceORCL Start try { /** * ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rima-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )*/ string oradb = "Data Source=(DESCRIPTION=" + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rima-PC)(PORT=1521)))" + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));" + "User Id=bird_artus;Password=123456;"; //string oradb = "Data Source=OraDb;User Id=scott;Password=tiger;"; string oradb1 = "Data Source=ORCL;User Id=scott;Password=tiger;"; // C# OracleConnection con = new OracleConnection(); con.ConnectionString = oradb1; String command = "select dname from dept where deptno = 10"; MessageBox.Show(command); OracleDataAdapter oda = new OracleDataAdapter(); oda.SelectCommand = new OracleCommand(); oda.SelectCommand.Connection = con; oda.SelectCommand.CommandText = command; con.Open(); oda.SelectCommand.ExecuteNonQuery(); DataSet ds = new DataSet(); oda.Fill(ds); Console.WriteLine(ds.GetXml()); dataGridView1.DataSource = ds; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()+Environment.NewLine+ ex.StackTrace.ToString()); }

    Read the article

  • Escaping colons in hibernate createSQLQuery

    - by Stratosgear
    I am confused on how I can create an SQL statement containing colons. I am trying to create a view and I am using (notice the double colons): create view MyView as ( SELECT tableA.colA as colA, tableB.colB as colB, round(tableB.colD / 1024)::numeric, 2) as calcValue, FROM tableA, tableB WHERE tableA.colC = 'someValue' ); This is a postgres query and I am forced to use the double colons (::) in order to correctly run the statement. I then pass the above statement through: s.createSQLQuery(myQuery).executeUpdate(); and I get a: Exception in thread "main" org.hibernate.exception.DataException: \ could not execute native bulk manipulation query at org.hibernate.exception.SQLStateConverter.convert(\ SQLStateConverter.java:102) ... more stacktrace... with an output of my above statement changed as (notice the question mark): create view MyView as ( SELECT tableA.colA as colA, tableB.colB as colB, round(tableB.colD / 1024)?, 2) as calcValue, FROM tableA, tableB WHERE tableA.colC = 'someValue' ); Obviously, hibernate confuses my colons with named parameters. Is there a way to escape the colons (a google suggestion that mentions that a single colon is escaped as a double colon does NOT work) or another way of running this statement? Thanks.

    Read the article

  • JSP: How can I still get the code on my error page to run, even if I can't display it?

    - by Josh Hinman
    I've defined an error-page in my web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> In that error page, I have a custom tag that I created. The tag handler for this tag e-mails me the stacktrace of whatever error occurred. For the most part this works great. Where it doesn't work great is if the output has already begun being sent to the client at the time the error occurs. In that case, we get this: SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp] java.lang.IllegalStateException I believe this error happens because we can't redirect a request to the error page after output has already started. The work-around I've used is to increase the buffer size on particularly large JSP pages. But I'm trying to write a generic error handler that I can apply to existing applications, and I'm not sure it's feasible to go through hundreds of JSP pages making sure their buffers are big enough. Is there a way to still allow my stack trace e-mail code to execute in this case, even if I can't actually display the error page to the client?

    Read the article

  • HttpUnhandledException ASP.NET

    - by jweber
    Hi I have a ASP.NET website. If I make a request for a page it works most of the times, but sometimes I get an HttpUnhandledException. I have tried to log the errors, but from the errors messages I'm not able to solve the problem. StackTrace: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4e215a3c\72ef69da\App_Web_ylvnbciw.6.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Data: System.Collections.ListDictionaryInternal BaseException: System.InvalidOperationException: The connection was not closed. The connection's current state is open. at DbCategory.getParentCategories() at _Default.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) TargetSite: Boolean HandleError(System.Exception) I have idea that it's something about my session og get variables, but i'm not sure about that. Does anybody have an idea about what it could be?

    Read the article

  • Celery tasks not works with gevent

    - by Novarg
    When i use celery + gevent for tasks that uses subprocess module i'm getting following stacktrace: Traceback (most recent call last): File "/home/venv/admin/lib/python2.7/site-packages/celery/task/trace.py", line 228, in trace_task R = retval = fun(*args, **kwargs) File "/home/venv/admin/lib/python2.7/site-packages/celery/task/trace.py", line 415, in __protected_call__ return self.run(*args, **kwargs) File "/home/webapp/admin/webadmin/apps/loggingquarantine/tasks.py", line 107, in release_mail_task res = call_external_script(popen_obj.communicate) File "/home/webapp/admin/webadmin/apps/core/helpers.py", line 42, in call_external_script return func_to_call(*args, **kwargs) File "/usr/lib64/python2.7/subprocess.py", line 740, in communicate return self._communicate(input) File "/usr/lib64/python2.7/subprocess.py", line 1257, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/usr/lib64/python2.7/subprocess.py", line 1287, in _communicate_with_poll poller = select.poll() AttributeError: 'module' object has no attribute 'poll' My manage.py looks following (doing monkeypatch there): #!/usr/bin/env python from gevent import monkey import sys import os if __name__ == "__main__": if not 'celery' in sys.argv: monkey.patch_all() os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webadmin.settings") from django.core.management import execute_from_command_line sys.path.append(".") execute_from_command_line(sys.argv) Is there a reason why celery tasks act like it wasn't patched properly? p.s. strange thing that my local setup on Macos works fine while i getting such exceptions under Centos (all package versions are the same, init and config scripts too)

    Read the article

  • Adding exclusive filter for <static initializer> in findbugs

    - by MilanAleksic
    Hi all, I want my findbugs report not show the following error: DM_NUMBER_CTOR: Method invokes inefficient Number constructor; use static valueOf instead The problem is that this happens in groovy-generated code files, so I can't control the source code - that is why I want to exclude it and add it to my exclude filter. I do not want to add explicitly class (since I make API that many tools will use, I want my filter to be generic). I would not like to completely remove this bug from the report by type, I would really like to only exclude this bug from appearing if it happenned in "static initializer" methods. Any idea? I tried the filter below but no luck, maybe somebody has better idea? <Match> <Method name="~.*static initializer.*" /> <Bug pattern="DM_NUMBER_CTOR" /> </Match> Here is the "stacktrace" of FindBugs in that case: In class net.milanaleksic.cuc.tools.sound.SoundPlayerTool In method net.milanaleksic.cuc.tools.sound.SoundPlayerTool.() Called method new Long(long) Should call Long.valueOf(long) instead In SoundPlayerTool.groovy

    Read the article

  • When to call Dispose in Entity Framework?

    - by Abdel Olakara
    Hi All, In my application I am making use of Spring.Net for IoC. The service objects are called from the ASP.Net files to perform CRUD operations using these service object. For example, I have CustomerService to do all CRUD operations on Customer table. I use entity framework and the entities are injected .. my question is where do I call the dispose method? As far as I understood from the API documentations, unless I call Dispose() there is no guaranty it will be garbage collected! So where and how do I do it? Example Service Class: public class CustomerService { public ecommEntities entities = {get; set;} public bool AddCustomer(Customer customer) { try { entities.AddToCustomer(customer); entities.SaveChanges(); return true; } catch (Exception e) { log.Error("Error occured during creation of new customer: " + e.Message + e.StackTrace); return false; } } public bool UpdateCustomer(Customer customer) { entities.SaveChanges(); return true; } public bool DeleteCustomer(Customer customer) . . . And I just create an object of CustomerService at the ASP partial class and call the necessary methods. Thanks in advance for the best practice and ideas.. Regards, Abdel Raoof

    Read the article

  • How can I tell whether a webpart that has been deployed to a site is a native webpart that ships wit

    - by program247365
    I have a SharePoint 2007 MOSS instance, and I'm on a fact-finding mission. There have been multiple developers, developing multiple webparts and deploying them (using VS2005/2008 SharePoint Extensions). I thought maybe I could look at the fields in the "Web Part Gallery" list in my site, and look by "Modified by", but it looks like a developer's name is on some of the out-of-the-box webparts somehow, and on ones I know are custom developed, they say "System Account" - so looking at that field in this list is a no go. I thought then maybe I could look at the "Group" to which each webpart was assigned but it looks like they were arbitrarily assigned to many different groups inconsistently - so using that piece of information is a no go. Here is my code I have for just looping through and getting the names of all the webparts. Is there any property I can access on the list items of webparts that would tell me whether it's a custom developed webpart? Any way to distinguish the custom webparts from the out-of-the-box ones? Is there another way to do this? #region Misc Site Collection Methods public static List<string> GetAllWebParts(string connectedSPInstanceUrl) { List<string> lstWebParts = new List<string>(); try { using (SPSite site = new SPSite(connectedSPInstanceUrl)) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["Web Part Gallery"]; foreach (SPListItem item in list.Items) { lstWebParts.Add(item.Name); } } } } catch (Exception ex) { lstWebParts.Add("Error"); lstWebParts.Add("Message: " + ex.Message); lstWebParts.Add("Inner Exception: " + ex.InnerException.ToString()); lstWebParts.Add("Stack Trace: " + ex.StackTrace); } return lstWebParts; } #endregion

    Read the article

  • Operation is not valid due to the current state of the object?

    - by Bill
    I am programming in C#; the code was working about a week ago, however it throws an exception and I don't understand at all what could be wrong with it. Var root = new CalculationNode(); -> Throw exception. In the call stack thats the only thing listed, I've been told that it could be that I need a clean build, but I am open to any ideas or suggestions. Thanks, -Bill Update: Exception's Detail System.InvalidOperationException was unhandled by user code Message=Operation is not valid due to the current state of the object. Source=Calculator.Logic StackTrace: at ~.Calculator.Logic.MyBaseExpressionParser.Parse(String expression) in ~\Source\Calculator.Logic\MyBaseExpressionParser.cs:line 44 at ~.Calculator.Logic.Tests.MyBaseCalculatorServiceTests.BasicMathDivision() in ~\Projects\Tests\Calculator.Logic.Tests\MyBaseCalculatorServiceTests.cs:line 60 InnerException: CalculationNode's code: public sealed calss CalculationNode { public CalculationNode() { this.Left = null; this.Right = null; this.Element = new CalculationElement(); } public CalculationNode Left {get;set;} public CalculationNode Right {get;set;} public CalculationElement Element {get; set;} } CalculationElement's code: public sealed class CalculationElement { public CalculationElement() { Value = string.Empty; IsOperator = false; } public string Value {get; set} public bool IsOperator {get; set} }

    Read the article

  • c# calling process "cannot find the file specified"

    - by laura
    I'm a c# newbie so bear with me. I'm trying to call "pslist" from PsTools from a c# app, but I keep getting "The system cannot find the file specified". I thought I read somewhere on google that the exe should be in c:\windows\system32, so I tried that, still nothing. Even trying the full path to c:\windows\system32\PsList.exe is not working. I can open other things like notepad or regedit. Any ideas? C:\WINDOWS\system32dir C:\WINDOWS\SYSTEM32\PsList.exe Volume in drive C has no label. Volume Serial Number is ECC0-70AA Directory of C:\WINDOWS\SYSTEM32 04/27/2010 11:04 AM 231,288 PsList.exe 1 File(s) 231,288 bytes 0 Dir(s) 8,425,492,480 bytes free try { // Start the child process. Process p = new Process(); // Redirect the output stream of the child process. p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; //This works //p.StartInfo.FileName = @"C:\WINDOWS\regedit.EXE"; //This doesn't p.StartInfo.FileName = @"C:\WINDOWS\system32\PsList.exe"; p.Start(); // Do not wait for the child process to exit before // reading to the end of its redirected stream. p.WaitForExit(); // Read the output stream first and then wait. s1 = p.StandardOutput.ReadToEnd(); p.WaitForExit(); } catch (Exception ex) { Console.WriteLine("Exception Occurred :{0},{1}", ex.Message, ex.StackTrace.ToString()); Console.ReadLine(); }

    Read the article

  • Why is a NullReferenceException thrown when a ToolStrip button is clicked twice with code in the `Click` event handler?

    - by Patrick
    I created a clean WindowsFormsApplication solution, added a ToolStrip to the main form, and placed one button on it. I've added also an OpenFileDialog, so that the Click event of the ToolStripButton looks like the following: private void toolStripButton1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); } I didn't change any other properties or events. The funny thing is that when I double-click the ToolStripButton (the second click must be quite fast, before the dialog opens), then cancel both dialogs (or choose a file, it doesn't really matter) and then click in the client area of main form, a NullReferenceException crashes the application (error details attached at the end of the post). Please note that the Click event is implemented while DoubleClick is not. What's even more strange that when the OpenFileDialog is replaced by any user-implemented form, the ToolStripButton blocks from being clicked twice. I'm using VS2008 with .NET3.5. I didn't change many options in VS (only fontsize, workspace folder and line numbering). Does anyone know how to solve this? It is 100% replicable on my machine, is it on others too? One solution that I can think of is disabling the button before calling OpenFileDialog.ShowDialog() and then enabling the button back (but it's not nice). Any other ideas? And now the promised error details: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() w C:\Users\Marchewek\Desktop\Workspaces\VisualStudio\WindowsFormsApplication1\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • how to save sitecore webpage in html file on local disk or server

    - by Sam
    WebRequest mywebReq ; WebResponse mywebResp ; StreamReader sr ; string strHTML ; StreamWriter sw; mywebReq = WebRequest.Create("http://domain/sitecore/content/test/page10.aspx"); mywebResp = mywebReq.GetResponse(); sr = new StreamReader(mywebResp.GetResponseStream()); strHTML = sr.ReadToEnd(); sw = File.CreateText(Server.MapPath("hello.html")); sw.WriteLine(strHTML); sw.Close(); Hi , I want to save sitecore .aspx page into html file on local disk , but i am getting exception. But if i use any other webpage example(google.com) it works fine. The exception : System.Net.WebException was caught HResult=-2146233079 Message=The remote server returned an error: (404) Not Found. Source=System StackTrace: at System.Net.WebClient.DownloadFile(Uri address, String fileName) at System.Net.WebClient.DownloadFile(String address, String fileName) at BlueDiamond.addmodule.btnSubmit(Object sender, EventArgs e) in c:\inetpub\wwwroot\STGLocal\Website\addmodule.aspx.cs:line 97 InnerException: Any help. Thanks in advance

    Read the article

  • Why am I having this InstantiationException in Java when accessing final local variables?

    - by Oscar Reyes
    I was playing with some code to make a "closure like" construct ( not working btw ) Everything looked fine but when I tried to access a final local variable in the code, the exception InstantiationException is thrown. If I remove the access to the local variable either by removing it altogether or by making it class attribute instead, no exception happens. The doc says: InstantiationException Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated. The instantiation can fail for a variety of reasons including but not limited to: - the class object represents an abstract class, an interface, an array class, a primitive type, or void - the class has no nullary constructor What other reason could have caused this problem? Here's the code. comment/uncomment the class attribute / local variable to see the effect (lines:5 and 10 ). import javax.swing.*; import java.awt.event.*; import java.awt.*; class InstantiationExceptionDemo { //static JTextField field = new JTextField();// works if uncommented public static void main( String [] args ) { JFrame frame = new JFrame(); JButton button = new JButton("Click"); final JTextField field = new JTextField();// fails if uncommented button.addActionListener( new _(){{ System.out.println("click " + field.getText()); }}); frame.add( field ); frame.add( button, BorderLayout.SOUTH ); frame.pack();frame.setVisible( true ); } } class _ implements ActionListener { public void actionPerformed( ActionEvent e ){ try { this.getClass().newInstance(); } catch( InstantiationException ie ){ throw new RuntimeException( ie ); } catch( IllegalAccessException ie ){ throw new RuntimeException( ie ); } } } Is this a bug in Java? edit Oh, I forgot, the stacktrace ( when thrown ) is: Caused by: java.lang.InstantiationException: InstantiationExceptionDemo$1 at java.lang.Class.newInstance0(Class.java:340) at java.lang.Class.newInstance(Class.java:308) at _.actionPerformed(InstantiationExceptionDemo.java:25)

    Read the article

  • Strange FileNotFoundException occuring on production server in console application

    - by thmsn
    Hi I have an application that works fine in my dev enviroment, but throws weird errors in the production enviroment, I checked the version of .net on my dev machine aswell as the production server , they both run 3.5.30729.01. The exception I get is a System.IO.FileNotFoundException. StackTrace: at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName) at System.Configuration.ClientConfigPaths.SetNamesAndVersion(String applicationFilename, Assembly exeAssembly, Boolean isHttp) at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig) at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig) at System.Configuration.ClientConfigurationHost.get_ConfigPaths() at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) at System.DirectoryServices.SearchResultCollection.ResultsEnumerator..ctor(SearchResultCollection results, String parentUserName, String parentPassword, AuthenticationTypes parentAuthenticationType) at System.DirectoryServices.SearchResultCollection.GetEnumerator() at System.DirectoryServices.DirectorySearcher.FindOne() Yesterday the error just went away, and today the error is occuring again. I tried using reflector and it appears to have something to do with config files or user config files. any ideas?

    Read the article

  • C# Web Service gets stuck waiting for lock, does not return

    - by blue
    We have a C#(2.0) application which talks to our server(in java) via web services. Lately we have started seeing following behavior in (ONLY)one of our lab machines(XP): Once in a while(every few days), one of the webservice request will just get stuck, will not return or timeout. Following is the stacktrace where it seem to be stuck. Have no clue what is going on here. Any pointer would be of great help. ESP EIP 05eceeec 7c90eb94 [GCFrame: 05eceeec] 05ecefbc 7c90eb94 [HelperMethodFrame_1OBJ: 05ecefbc] System.Threading.Monitor.Enter(System.Object) 05ecf014 7a5b0034 System.Net.ConnectionGroup.Disassociate(System.Net.Connection) 05ecf040 7a5aeaa7 System.Net.Connection.PrepareCloseConnectionSocket(System.Net.ConnectionReturnResult ByRef) 05ecf0a4 7a5ac0e1 System.Net.Connection.ReadStartNextRequest(System.Net.WebRequest, System.Net.ConnectionReturnResult ByRef) 05ecf0e8 7a5b1119 System.Net.ConnectStream.CallDone(System.Net.ConnectionReturnResult) 05ecf0fc 7a5b3b5a System.Net.ConnectStream.ReadChunkedSync(Byte[], Int32, Int32) 05ecf114 7a5b2b90 System.Net.ConnectStream.ReadWithoutValidation(Byte[], Int32, Int32, Boolean) 05ecf160 7a5b29cc System.Net.ConnectStream.Read(Byte[], Int32, Int32) 05ecf1a0 79473cab System.IO.StreamReader.ReadBuffer(Char[], Int32, Int32, Boolean ByRef) 05ecf1c4 79473bd6 System.IO.StreamReader.Read(Char[], Int32, Int32) 05ecf1e8 69c29119 System.Xml.XmlTextReaderImpl.ReadData() 05ecf1f8 69c2ad70 System.Xml.XmlTextReaderImpl.ParseDocumentContent() 05ecf20c 69c292d7 System.Xml.XmlTextReaderImpl.Read() 05ecf21c 69c2929d System.Xml.XmlTextReader.Read() 05ecf220 6991b3e7 System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean) 05ecf268 69919ed1 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(System.String, System.Object[])

    Read the article

  • Java Servlet: getInitParameter not work in Service()

    - by Gabriele
    I've added some parameters in my web.xml config file, as follow: <context-param> <param-name>service1</param-name> <param-value>http://www.example.com/example2.html</param-value> </context-param> <context-param> <param-name>service2</param-name> <param-value>http://www.example.com/example2.html</param-value> </context-param> ... I try to get the parameter in my servlet, in particular in my service method: protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(this.getServletContext().getInitParameter("service1")); ... but at runtime I have a NullPointerException... How can I get the parameter value included in web.xml? This is the stacktrace: GRAVE: Servlet.service() for servlet DispatcherServlet threw exception java.lang.NullPointerException at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:160) at it.servlethope.DispatcherServlet.service(DispatcherServlet.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) DispatcherServlet.java:66 is the line where I try the getInitParameter()

    Read the article

  • Debug not working in Monodroid with a Galaxy Nexus

    - by MaxM
    I'm starting to work with Monodroid testing on a Galaxy Nexus from MonoDevelop for Mac. Running the default Android project without debugging works. But if I try to debug it either says this in the Application Output pane: Error trying to detect already running process Or it outputs the following to logcat: I/ActivityManager( 448): Start proc monotest.monotest for activity monotest.monotest/monotest.Activity1: pid=3075 uid=10068 gids={3003} D/dalvikvm( 3063): GC_CONCURRENT freed 98K, 89% free 478K/4096K, paused 0ms+1ms I/dalvikvm( 3075): Turning on JNI app bug workarounds for target SDK version 8... V/PhoneStatusBar( 524): setLightsOn(true) I/ActivityThread( 3075): Pub monotest.monotest.__mono_init__: mono.MonoRuntimeProvider D/dalvikvm( 3075): Trying to load lib /data/data/monotest.monotest/lib/libmonodroid.so 0x41820850 D/dalvikvm( 3075): Added shared lib /data/data/monotest.monotest/lib/libmonodroid.so 0x41820850 D/OpenGLRenderer( 683): Flushing caches (mode 1) E/mono ( 3075): WARNING: The runtime version supported by this application is unavailable. E/mono ( 3075): Using default runtime: v2.0.50727 D/OpenGLRenderer( 683): Flushing caches (mode 0) I/monodroid-gc( 3075): environment supports jni NewWeakGlobalRef I/mono ( 3075): Stacktrace: I/mono ( 3075): D/AndroidRuntime( 3093): D/AndroidRuntime( 3093): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< D/AndroidRuntime( 3093): CheckJNI is OFF D/AndroidRuntime( 3093): Calling main entry com.android.commands.am.Am D/dalvikvm( 3021): GC_CONCURRENT freed 359K, 3% free 15630K/16071K, paused 2ms+4ms D/Zygote ( 119): Process 3075 terminated by signal (11) I/ActivityManager( 448): Process monotest.monotest (pid 3075) has died. I tried using another device (a Galaxy Tab) and it worked fine. I also tried the suggestion from here and it didn't help.

    Read the article

  • c#3.5 Deserialization error - object reference not set

    - by BBR
    I am trying to deserialize an xml string in c#3.5, the code below does work in c# 4.0. When I try to run in the code in c#3.5 I get an Object reference not set to an instance of an object exception when the code tries in initialize the XmlSerializer. Any help would be appreciated. string xml = "<boolean xmlns=\"http://schemas.microsoft.com/2003/10/serialization/\">false</boolean>"; var xSerializer = new XmlSerializer(typeof(bool), null, null, new XmlRootAttribute("boolean"), "http://schemas.microsoft.com/2003/10/serialization/"); using (var sr = new StringReader(xml)) using (var xr = XmlReader.Create(sr)) { var y = xSerializer.Deserialize(xr); } System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Xml" StackTrace: at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace) .... at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • A generic error occurred in GDI+, JPEG Image to MemoryStream

    - by madcapnmckay
    Hi, This seems to be a bit of an infamous error all over the web. So much so that I have been unable to find an answer to my problem as my scenario doesn't fit. An exception gets thrown when I save the image to the stream. Weirdly this works perfectly with a png but gives the above error with jpg and gif which is rather confusing. Most similar problem out there relate to saving images to files without permissions. Ironically the solution is to use a memory stream as I am doing.... public static byte[] ConvertImageToByteArray(Image imageToConvert) { using (var ms = new MemoryStream()) { ImageFormat format; switch (imageToConvert.MimeType()) { case "image/png": format = ImageFormat.Png; break; case "image/gif": format = ImageFormat.Gif; break; default: format = ImageFormat.Jpeg; break; } imageToConvert.Save(ms, format); return ms.ToArray(); } } More detail to the exception. The reason this causes so many issues is the lack of explanation :( System.Runtime.InteropServices.ExternalException was unhandled by user code Message="A generic error occurred in GDI+." Source="System.Drawing" ErrorCode=-2147467259 StackTrace: at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) at System.Drawing.Image.Save(Stream stream, ImageFormat format) at Caldoo.Infrastructure.PhotoEditor.ConvertImageToByteArray(Image imageToConvert) in C:\Users\Ian\SVN\Caldoo\Caldoo.Coordinator\PhotoEditor.cs:line 139 at Caldoo.Web.Controllers.PictureController.Croppable() in C:\Users\Ian\SVN\Caldoo\Caldoo.Web\Controllers\PictureController.cs:line 132 at lambda_method(ExecutionScope , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) InnerException: OK things I have tried so far. Cloning the image and working on that. Retrieving the encoder for that MIME passing that with jpeg quality setting. Please can anyone help.

    Read the article

  • Remove then Query fails in JPA (deleted entity passed to persist)

    - by nag
    I have two entitys MobeeCustomer and CustomerRegion i want to remove the object from CustomerRegion first Im put join Coloumn in CustomerRegion is null then Remove the Object from the entityManager but Iam getting Exception MobeeCustomer: public class MobeeCustomer implements Serialization{ private Long id; private String custName; private String Address; private String phoneNo; private Set<CustomerRegion> customerRegion = new HashSet<CustomerRegion>(0); @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeCustomer") public Set<CustomerRegion> getCustomerRegion() { return CustomerRegion; } public void setCustomerRegion(Set<CustomerRegion> customerRegion) { CustomerRegion = customerRegion; } } CustomerRegion public class CustomerRegion implements Serializable{ private Long id; private String custName; private String description; private String createdBy; private Date createdOn; private String updatedBy; private Date updatedOn; private MobeeCustomer mobeeCustomer; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "MOBEE_CUSTOMER") public MobeeCustomer getMobeeCustomer() { return mobeeCustomer; } public void setMobeeCustomer(MobeeCustomer mobeeCustomer) { this.mobeeCustomer = mobeeCustomer; } } sample code: for (CustomerRegion region : deletedRegionList) { region.setMobeeCustomer(null); getEntityManager().remove(region); } StackTrace: please suggest me how to remove the CustomerRegion Object I am getting Exception javax.persistence.EntityNotFoundException: deleted entity passed to persist: [com.manam.mobee.persist.entity.CustomerRegion#<null>] 15:46:34,614 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:613) 15:46:34,614 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:299) 15:46:34,614 ERROR [STDERR] at org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92) 15:46:34,614 ERROR [STDERR] at org.jboss.seam.framework.EntityHome.update(EntityHome.java:64)

    Read the article

  • error invoking store procedure with input parameter from ADO.Net

    - by George2
    Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net. Here is my code and related error message. The error message says, @Param1 is not supplied, but actually it is supplied in my code. Any ideas what is wrong? System.Data.SqlClient.SqlException: Procedure or function 'Pr_Foo' expects parameter '@Param1', which was not supplied. class Program { private static SqlCommand _command; private static SqlConnection connection; private static readonly string _storedProcedureName = "Pr_Foo"; private static readonly string connectionString = "server=.;integrated Security=sspi;initial catalog=FooDB"; public static void Prepare() { connection = new SqlConnection(connectionString); connection.Open(); _command = connection.CreateCommand(); _command.CommandText = _storedProcedureName; _command.CommandType = CommandType.StoredProcedure; } public static void Dispose() { connection.Close(); } public static void Run() { try { SqlParameter Param1 = _command.Parameters.Add("@Param1", SqlDbType.Int, 300101); Param1.Direction = ParameterDirection.Input; SqlParameter Param2 = _command.Parameters.Add("@Param2", SqlDbType.Int, 100); portal_SiteInfoID.Direction = ParameterDirection.Input; SqlParameter Param3 = _command.Parameters.Add("@Param3", SqlDbType.Int, 200); portal_RoleInfoID.Direction = ParameterDirection.Input; _command.ExecuteScalar(); } catch (Exception e) { Console.WriteLine(e); } } static void Main(string[] args) { try { Prepare(); Thread t1 = new Thread(Program.Run); t1.Start(); t1.Join(); Dispose(); } catch (Exception ex) { Console.WriteLine(ex.Message + "\t" + ex.StackTrace); } } } thanks in avdance, George

    Read the article

  • are custom classes imported API included in .class files?

    - by kyrogue
    i have a question, i have a custom class which imports java.sql.; and i am creating a jsp page, in the jsp page, i did a page import of the custom class , however when i tried to call my custom class database methods it cant work. only when i did a page import of java.sql. did it work. so are custom classes imported API included in .class files? An error occurred at line: 6 in the jsp file: /resetpw.jsp Statement cannot be resolved to a type 3: 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: An error occurred at line: 7 in the jsp file: /resetpw.jsp ResultSet cannot be resolved to a type 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: 10: Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:319) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs. edited. added what error will come up if i did not do a page import of java.sql.*;

    Read the article

  • Error when passing quotes to webservice by AJAX

    - by Radu
    I'm passing data using .ajax and here are my data and contentType attributes: data: '{ "UserInput" : "' + $('#txtInput').val() + '","Options" : { "Foo1":' + bar1 + ', "Foo2":' + Bar2 + ', "Flags":"' + flags + '", "Immunity":' + immunity + '}}', contentType: 'application/json; charset=utf-8', Server side my code looks like this: <WebMethod()> _ Public Shared Function ParseData(ByVal UserInput As String, ByVal Options As Options) As String The userinput is obvious but the Options structure is like the following: Public Structure Options Dim Foo1 As Boolean Dim Foo2 As Boolean Dim Flags As String Dim Immunity As Integer End Structure Everything works fine when $('#txtInput') contains no double-quotes but if they are present I get an error (for an input of asd"): {"Message":"Invalid object passed in, \u0027:\u0027 or \u0027}\u0027 expected. (22): { \"UserInput\" : \"asd\"\",\"Options\" : { \"Foo1\":false, \"Foo2\":false, \"Flags\":\"\", \"Immunity\":0}}","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"} Any idea how I can avoid this error? Also, when I pass the same input with quotes directly it works fine.

    Read the article

  • What is the best way to handle the Connections to MySql from c#

    - by srk
    I am working on a c# application which connects to MySql server. There are about 20 functions which will connect to database. This application will be deployed in 200 over machines. I am using the below code to connect to my database which is identical for all the functions. The problem is, i can some connections were not closed and still alive when deployed in 200 over machines. Connection String : <add key="Con_Admin" value="server=test-dbserver; database=test_admindb; uid=admin; password=1Password; Use Procedure Bodies=false;" /> Declaration of the connection string Globally in application [Global.cs] : public static MySqlConnection myConn_Instructor = new MySqlConnection(ConfigurationSettings.AppSettings["Con_Admin"]); Function to query database : public static DataSet CheckLogin_Instructor(string UserName, string Password) { DataSet dsValue = new DataSet(); //MySqlConnection myConn = new MySqlConnection(ConfigurationSettings.AppSettings["Con_Admin"]); try { string Query = "SELECT accounts.str_nric AS Nric, accounts.str_password AS `Password`," + " FROM accounts " + " WHERE accounts.str_nric = '" + UserName + "' AND accounts.str_password = '" + Password + "\'"; MySqlCommand cmd = new MySqlCommand(Query, Global.myConn_Instructor); MySqlDataAdapter da = new MySqlDataAdapter(); if (Global.myConn_Instructor.State == ConnectionState.Closed) { Global.myConn_Instructor.Open(); } cmd.ExecuteScalar(); da.SelectCommand = cmd; da.Fill(dsValue); Global.myConn_Instructor.Close(); } catch (Exception ex) { Global.myConn_Instructor.Close(); ExceptionHandler.writeToLogFile(System.Environment.NewLine + "Target : " + ex.TargetSite.ToString() + System.Environment.NewLine + "Message : " + ex.Message.ToString() + System.Environment.NewLine + "Stack : " + ex.StackTrace.ToString()); } return dsValue; }

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21  | Next Page >