Object reference not set to an instance of an object for ABCpdf8 - abcpdf

Thanks in advance.
I have ran into an issue with ABCpdf. I continuously receive the following exception, when I try to add image URL to pdf. This was working fine some days back but its not working now.
WebSupergoo.ABCpdf8.Internal.PDFException Object reference not set to an instance of an object. Int32 AddUrl(System.String, Boolean, Int32, Boolean) at WebSupergoo.ABCpdf8.Doc.AddUrl(String url, Boolean paged, Int32 width, Boolean disableCache)
at WebSupergoo.ABCpdf8.Doc.AddImageUrl(String url, Boolean paged, Int32 width, Boolean disableCache)
at WebSupergoo.ABCpdf8.Doc.AddImageUrl(String url)
This is working for content without image but content with multiple images does not work.
Any help would be much appreciated.

This error crept up in my case was that there was an exception occurring in code behind. I have rectified the exception and everything was working well.

Object reference not set to an instance of an object
abcpdf
After hours for troubleshooting, modifying IIS and all sorts of things...
It turns out (in our case v.7 abcpdf) the IE 9 is not supported, after downgrading back to IE 8 the print works.

Related

EF using Oracle (ODP.NET) works on one machine, throwing exceptions on another

Everything works fine on my development box (Windows 7 64 bit), I am able to retrieve records and save records.
When I deploy out to a Windows Server 2008 (32 bit) machine, I am able to retrieve data and view it fine. The problem comes when I either:
1) Try to save:
System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.ArgumentException: The specified value is not an instance of type 'Edm.Decimal'
Parameter name: value
at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateConstant(TypeUsage constantType, Object value)
at System.Data.Mapping.Update.Internal.UpdateCompiler.GenerateValueExpression(EdmProperty property, PropagatorResult value)
at System.Data.Mapping.Update.Internal.UpdateCompiler.BuildPredicate(DbExpressionBinding target, PropagatorResult referenceRow, PropagatorResult current, TableChangeProcessor processor, Boolean& rowMustBeTouched)
at System.Data.Mapping.Update.Internal.UpdateCompiler.BuildUpdateCommand(PropagatorResult oldRow, PropagatorResult newRow, TableChangeProcessor processor)
at System.Data.Mapping.Update.Internal.TableChangeProcessor.CompileCommands(ChangeNode changeNode, UpdateCompiler compiler)
--- End of inner exception stack trace ---
at System.Data.Mapping.Update.Internal.TableChangeProcessor.CompileCommands(ChangeNode changeNode, UpdateCompiler compiler)
at System.Data.Mapping.Update.Internal.UpdateTranslator.<ProduceDynamicCommands>d__0.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
at System.Data.Mapping.Update.Internal.UpdateCommandOrderer..ctor(IEnumerable`1 commands, UpdateTranslator translator)
at System.Data.Mapping.Update.Internal.UpdateTranslator.ProduceCommands()
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at Dashboard.Data.Repository.RepositoryBase`2.OnCompleteSave()
2) Or try to retrieve the next number in a sequence:
System.InvalidOperationException: The specified cast from a materialized 'System.Decimal' type to the 'System.Int64' type is not valid.
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Dashboard.Data.DashboardDbContext.ExecuteScalar[TResult](String query, Object[] parameters) in c:\Builds\1\Exploration Archives\Dashboard (MAIN) (talus test)\Sources\Exploration Archives\Dashboard\Main\Dashboard.Data\Dashboard.contrib.cs:line 23
at Dashboard.Data.Repository.RepositoryBase`2.GetNextIdFromSequence()
The part that confuses me the most is the fact that after being deployed to the Windows Server 2008 machine, things partially work (I am able to retrieve data), but it only breaks when I try to retrieve from a sequence or save.
Any ideas what could be causing this?
Found the issue.
For my ID columns, on my .NET objects I was using data type long, with the corresponding oracle data type number. Worked fine on my machine. Based on other research into this issue, I tried changing the oracle data type to number(19). Still no go.
Seems like long support is flaky at best. I had to change my .NET objects' data types to int, and changed the oracle data types to int as well. This worked.
The part that bothers me most is that it obviously saw number and number(19) as a decimal data type, and it had no problem doing a narrowing conversion for me to long. The issue only came up when I tried to save, doing a non-narrowing conversion long to decimal. Go figure.
Adding a comment here for future reference as this issue also effects the Mysql Drivers - EntityFramework v6 and MySql.Data.Entities.6.8.3.0. Unsigned bigint db columns cause this issue.
"id BIGINT(20) UNSIGNED" causes a "The specified value is not an instance of a valid constant type. Parameter name: type" exception. Changing the associated class property ulong does not help. Binding db column "id BIGINT(20)" to...
[Key]
[Column("id")]
public long Id { get; set; }
...works fine.

Why am I getting an 'Invalid property value' err 380, VB6, VSFlexGrid.buildcombolist?

I'm brand new to working with VB6, and I'm trying to debug an err 380. The error occurs during a call to a function from VSFlexgrid used, and I've found very little specific documentation on the function involved: VSFlexgrid.BuildComboList.
I'm developing in a VM running win XP, and the software usually runs on Win7, so I don't think it falls in the compatibility issue I've seen on SO already.
The portion of code where it occurs happens multiple times in the program without fault, but only occurs on a particular action.
Does anyone know what might be causing the error specifically (or in general with these types of functions)? Is it a property of RecordSets that is triggering an error that I probably don't know about (very new to vb6)? I've confirmed that the parameters to BuildComboList aren't empty/null when the error occurs. My suspicions are with the recordset though....
Some Code:
Public Function LoadFlexCombo(grd As VSFlexGrid, conpassedconnection As Connection,
StoredProcedureName As String, FieldList As String, Optional keyfield As String,
Optional LookupName As String, Optional colKey As String, Optional UDFFilterValue As
String)
...
grd.BuildComboList(rs, FieldList, keyfield) 'bails out to error handler here.
...

A null reference or invalid value was found [GDI+ status: InvalidParameter]

I am running an MVC3 app on Mono/linux and everything is working fine with the exception of an image upload utility. Whenever an image upload is attempted i get the Invalid Parameter error from within the method below:
System.Drawing.GDIPlus.CheckStatus(status As Status) (unknown file): N 00339
System.Drawing.Bitmap.SetResolution(xDpi As Single, yDpi As Single)
I've googled this error extensively and have found that the Invalid parameter error can often be misleading, and could fire if for example there was an error with the upload itself, or if the image was not fully read. This runs fine on IIS/Windows, but I've not been able to get it to work in Mono.
Apache2
Mono 2.10.8.1
Am i missing something simple or do i need to find a different way to handle image manipulation for mono?
After doing quite a bit of testing, I was able to determine the root of my error. I was attempting to use the Image.HorizontalResolution and Image.VerticalResolution properties for Bitmap.Resolution . While these properties were set on the initial upload (where the file is read into a stream from the tmp directory), when i posted back with the base64 encoded string of the image itself, it appears these values were lost somehow. Because of this the SetResolution method failed.
For whatever reason i do not have this issue on IIS/Windows, the properties exist in both circumstances.
I encountered a similar issue. A Bitmap loaded from disk, reported bmp.HorizontalResolution==0 and bmp.VerticalResolution==0 when they were both==300. This behaviour does not occur on Windows.
A bit more digging, I found that the following test fails:
[Test]
public void GDI_SetResoltion()
{
var b1 = new Bitmap (100, 100);
Assert.That (b1.HorizontalResolution, Is.Not.EqualTo (0));
Assert.That (b1.VerticalResolution, Is.Not.EqualTo (0));
}
I believe Windows will default resolution to 96 dpi.

Having trouble with Spring.NET caching

I have been reading this post to help me get going on my caching and am running into a problem. When I attempt to do a call to the method below I get the following error:
"Cannot initialize property or field node 'LocalTariffId' because the specified context is null."
I thought the attribute syntax I am using below would use the LocalTariffId property of the result once it returns to cache my data. This error occurs as soon as I attempt to step into the method. It seems to me that it is trying access that property too soon. I must be missing something so any advice you could provide is greatly appreciated!
[CacheResult("AspNetCache", "'LocalTariff.Id=' + LocalTariffId", TimeToLive = "00:10:00")]
public Domain.LocalTariffs.LocalTariff GetDefault(string agencyCode)
I am also getting a weird error after the first error I was hoping somebody could shed some light on. It has to do with log4net at least I think it does. My logging is working so I am not sure what this one is about.
IGCSoftware.HHG.Business.LocalTariffsFacade - Exception thrown in GetDefaultLocalTariff;GetDefaultLocalTariff;9c0bb393-369c-4501-a2ce-9325fe525e38;183341 ms
<log4net.Error>Exception rendering object type [Spring.Core.NullValueInNestedPathException]<stackTrace>System.BadImageFormatException: The parameters and the signature of the method don't match.
at System.Reflection.RuntimeParameterInfo.GetParameters(IRuntimeMethodInfo methodHandle, MemberInfo member, Signature sig, ParameterInfo& returnParameter, Boolean fetchReturnParameter)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Exception.GetStackTrace(Boolean needFileInfo)
at System.Exception.ToString(Boolean needFileLineInfo)
at System.Exception.ToString()
at log4net.ObjectRenderer.DefaultRenderer.RenderObject(RendererMap rendererMap, Object obj, TextWriter writer)
at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)</stackTrace></log4net.Error>
You can't use the returned object to generate the key of the CacheResult attribute.
You have to use parameters of the method to generate the key (here '#agencyCode').

Ajax-Enabled WCF Only Intermittently Returns to Callback Function

I have an ajax-enabled WCF service that returns a set of JSON objects back to the browser. The service has a simple function that calls a business layer dll. This then returns the objects to the calling method.
Below is the service implementation (minus the Imports statements):
<ServiceContract(Namespace:="")> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
<ServiceBehavior(IncludeExceptionDetailInFaults:=True, MaxItemsInObjectGraph:=5000)> _
Public Class NoteService
<OperationContract()> _
Public Function GetAllInsuredNotes(ByVal insuredID As Integer) As List(Of NoteExport)
Dim allNotes As New List(Of NoteExport)
Using nr As New NoteRepository()
allNotes = nr.GetInsuredNotesForExport(insuredID)
If allNotes Is Nothing Then
Throw New InvalidOperationException("The operation to retrieve notes caused an error.")
End If
End Using
Return allNotes.ToList()
End Function
The Javascript to call my service is as follows:
function exportToExcel(sender, eventArgs) {
var insuredID = $('input[id*=hdnInsuredID]').val();
NoteService.GetAllInsuredNotes(insuredID, OnNoteGetSuccess, OnNoteGetFailure, null);
}
function OnNoteGetSuccess(result) {
var insuredID = $('input[id*=hdnInsuredID]').val();
OutputExcel(insuredID, result);
return true;
}
function OnNoteGetFailure(result) {
alert('There was an error retrieving notes for export. Please contact the help desk for assistance.');
return false;
}
Basically my problem is this. Everything seems to work fine from the server side function standpoint. Every time I call the function client side, the server side code executes and the result is generated. However, the success callback function only gets called periodically. I can invoke the function several times and only have the callback executed once. The problem seems to grow worse the larger the result set returned.
I could understand if it was related to the MaxObjectsInGraph setting, but the problem isn't that the result never comes back if I have a large amount of data. It will come back sometimes every forth or fifth try, sometimes 2 tries in a row, sometimes 1 in ten tries. It seems very random.
I have spent at least 2 days racking my brain on this one and can't seem to discover the solution. Does anyone have any insight on this?
Ok, I figured out what was happening and thought I'd post it here in case anyone else experiences this kind of issue. Using fiddler was the tool that put me on the right track.
Basically, the link button I was using to make the call to the javascript function was calling a full page postback, not just calling the javascript function. So if the request was small enough, the response to the web service call came quickly and the web page ran the callback function with the new JSON data it received. As the data sets got larger, sometimes the response would come back in time for the page to process the results. However, sometimes the response wouldn't come back until the full page postback was complete and the reference to the callback function was lost. So it would get back the JSON data but wouldn't know what to do with it.
So I had the javascript function called by the link button always return false to cancel the post back and the problem was solved.
I only had one other issue to deal with and that was setting the MaxObjectsInGraph setting for the service to a high enough value to account for the JSON size coming back. The only thing I still find odd is that if this setting was not high enough, I would get a challenge response box asking for a login name for the first couple of attempts, then the service would just come back with an unknown status code.
In any case, I hope this post proves helpful to someone else.
I don't think we can help you figure it out either unless we have the JavaScript definition for
NoteService.GetAllInsuredNotes(insuredId, CallBack1, CallBack2, WhatIsThisParam)

Resources