Call to Table.SetDataSource() causes FileLoadException in Windows service

I'm porting code toVS2010/Crystal Reports VS2010 that has worked flawlessly 24/7 for the past 2 years.  Original code used VS2008/CR VS2008.
I generate reports from a background Windows service using Crystal Reports.  I have a set of report generation CR components that work in a variety of contexts - WinForms apps, console apps and the Windows service.
When I ported to VS 2010, all of my apps worked fine, except for the Windows service.  In the service, the first call to Table.SetDataSource() causes the service to crash.  I've used detailed logging in the service to pinpoint the source of the error.  I log before and after the call to SetDataSource(), but only the before message is logged.
VS2010 version - 10/0/30318.1 RTMRel
CR VS2010 runtime version - 13.0.2000.0
I see the following in the 'Application' event log after this happens:
=======================
EventType clr20r3, P1 usastudiosservice.exe, P2 1.0.4065.17651, P3 4d5d3537, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 2463, P8 0, P9 system.io.fileloadexception, P10 NIL.
=======================
Application: UsaStudiosService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
Stack:
   at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
   at System.Reflection.Assembly.LoadFrom(System.String)
   at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr)
======================
I'm catching all exceptions in my report generator component, but, for some reason, this exception isn't caught.  I think it's because it's occurring in the CLR and the CLR is aborting the process.
I've been monitoring the service in ProcMon. I see a final set of  references to the CrystalDecisions.ReportAppServer.DataSetConversion assembly that succeed, 3 attempts to access the assemby's PDB file that fail, and then DW20.EXE (C:\Program Files\Common Files\Microsoft Shared\DW\DW20.EXE) is loaded to process process the error.  (Could the missing PDB file be the problem?)
The ProcMon trace looks entirely different when I run the report gen components from the WinForms and console apps.
I don't think this is a permissions issue.  I've been able to log in as the user that the service logs in as and have been able to run both WinForms and console versions of the report generator without problems.
Any help would be greatly appreciated. I absolutely have to convert this app!
-David

Sorry about that,
They changed the info... Do this:
In the mean time here's how to work around it and get logging working:
Create a Registry file with this in it and save it: ( Replace the double quote with an open square bracket )
W i n d o w s R e g i s t r y E d i t o r V e r s i o n 5 . 0 0
" H K E Y _ L O C A L _ M A C H I N E \ S O F T W A R E \ S A P B u s i n e s s O b j e c t s \ S u i t e X I 4 . 0 ]
" H K E Y _ L O C A L _ M A C H I N E \ S O F T W A R E \ S A P B u s i n e s s O b j e c t s \ S u i t e X I 4 . 0 \ C r y s t a l R e p o r t s ]
" C o m m o n F i l e s " = " C : \ \ P r o g r a m F i l e s \ \ S A P B u s i n e s s O b j e c t s \ \ C r y s t a l R e p o r t s f o r . N E T F r a m e w o r k 4 . 0 \ \ C o m m o n \ \ "
And then:
1. Copy the crlogger.dll from the CR win32_x86 directory to a folder which its path length is short than 130 characters.
2. Add the following registry key to registry:
"HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports]
3. Add a string value u201CCommonFilesu201D under the above added registry key with the value as the pathu2019s fullname which folder we drop the crlogger.dll in step #1 (requires to include the ending backslash character u201C\u201D in the path name).
For example, copy the crlogger.dll form the default CR win32_x86u2019s folder:
C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\
into:
C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\
Then import the .reg file you created from above.
Thanks again
Don

Similar Messages

  • Windows Service no longer able to print PDF files using Adobe Reader 11.0.07.79

    We have a Windows Service that watches a folder for PDF files to be deposited.  Once awakened, it executes the Adobe Reader in command line mode to print the PDF files to secure check printers. The Windows Service was working fine with 11.0.06.70 but no longer works with 11.0.07.79.
    There are no event viewer errors or errors returned to our Process.Start() call.  The Windows Service is running under the identify of an administrator account and has explicit full access to the printer.  We have also tried the local computer's Administrator account as well as the default Local Service, but none work.
    Using ProcMon to examine the failure, it showed Adobe Reader making many successful registry and file accesses.  Adobe Reader then creates a new process, another instance of itself to read in the PDF file and print to the printer.  However, ProcMon only shows Adobe Reader accessing AcroRd32.exe, syswow.dll (sp) and ntdll.dll and then the thread and process immediately exits with an exit code of 0 (no file or registry accesses).  So, something is causing the instantiated process to fail immediately.
    After more research and trying many things, we disabled "Enable Protected Mode at Startup".  This enabled things to work again.
    We are concerned that disabling this feature might expose security concerns for our customers.
    We are suspecting that some security concerns were tightened with 11.0.07.79 that has inadvertently caused printing from Windows Services to falsely be identified as security violations.  Can you please investigate and provide a resolution?
    Thank you.
    Craig Keating
    Alliance Enterprises, Inc.
    [email protected]

    Hi,
    Can you please give the following details:
    1) Command (given in command line)used to print PDF files?
    2) Is the issue reproducible with other printers as well?
    3) Is directly printing the PDF from that folder using command line i.e without using windows service works fine or not?
    Thanks,
    Shakti K

  • Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added

    Hi there,
    I recently had the following situation, where I changed the source of my CSV file in Power Query.
    Once I had reloaded the file, it would then not load into Power Pivot. So I disabled the loading from Power Query into Power Pivot. I then enabled the loading to the Data Model. Which then successfully loaded the data into Power Pivot.
    But once I went into Power Pivot, had a look, then saved the Excel file. Once saved I closed the Excel file. I then opened the Excel file again and all the sheets that interact with the Power Pivot data work fine.
    But if I go and open Power Pivot I get the following error: Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added.
    This is what I get from the Call Stack
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.SynonymModel.AddSynonymCollection(DataModelingColumn column, SynonymCollection synonyms)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.LinguisticSchemaLoader.DeserializeSynonymModelFromSchema()
       at Microsoft.AnalysisServices.Common.SandboxEditor.LoadLinguisticDesignerState()
       at Microsoft.AnalysisServices.Common.SandboxEditor.set_Sandbox(DataModelingSandbox value)
       at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.RefreshClientWindow(String tableName)
    I would assume that the issue is with the synonyms and for some reason, when I disabled the loading of my data into the Power Pivot Model, it did not remove the associations to the actual table and synonyms.
    If I renamed the table in Power Pivot it all works fine. So that was my work around. Fortunately I did have a copy of the Excel workbook before I made this change. So I could then go and add back in all the relevant data to my table.
    Has anyone had this before and know how to fix it?
    http://www.bidn.com/blogs/guavaq

    Hi there
    I can share the work book, if possible to send me an email address. As the workbook size is about 9Mb.
    Thanks
    Gilbert
    http://www.bidn.com/blogs/guavaq

  • RFC call from a Windows Service

    Hi All,
    I have created a simple windows service which is making an RFC call to R/3 system. This is not working. Whereas the same piece of code written in a windows application projects(exe) works properly. Does anyone had similer issues working with Windows services ? Is it a known issue of RFC calls from windows service ???
    Thanks & Regards
    Ganesh Datta

    Hi Juergen,
    After I put the debug statements I figured out that connection to R/3 system is unsuccessful.
    I am using the SAP .Net Connector 2.0. I wrote a windows service which is manually started. Withing my service I am using Single sign on to connect .This is what was causing the problem. If I disable Single sign on and supply userID and password then connection is successful and also subsequent RFC calls.
    I guess within windows service Single sign on does not work.
    Thanks for your reply
    Best Regards
    Ganesh Datta

  • 1. The procedure called by CUSTOM.pll causes the problem when we use f60gen

    When CUSTOM.pll contains a call to a package that in turn calls a remote package, the CUSTOM.pll compile hangs forever.
    1. The procedure called by CUSTOM.pll causes the problem when we use f60gen. Though same procedure compiles successfully using "alter procedure compile" command.
    2. We have observed the problem happens due to synonym present on the remote database(db link).
    It doesn’t work if you are calling SYNONYM on remote database. It works, for calls to tables or procedures or packages in remote database if that object is OWNED DIRECTLY by the account to which dblink is connecting to.
    select object_name, object_type from user_objects@NH_SCM_ICE.DB.ATT.COM ;
    OBJECT_NAME OBJECT_TYPE
    FA_LOCATIONS SYNONYM
    FND_FLEX_VALUES SYNONYM

    The database link is created under the APPS user in the local database but connects to a different user (SWCS_ICE_SUPCHAIN) in the remote database.
    The user in the remote database does not own any objects. It only has synonyms to objects owned by apps and others.
    Incidentally, the hang also happens when trying to describe the remote package from the application tier (8.0.6.3 sqlplus) but the describe works fine from the DB tier (10gR2 sqlplus).

  • Calling Illustrator from a Windows Service

    Hello,
    A project I'm working on has an internal document conversion process that uses Adobe Illustrator.  The conversion script is in Javascript and uses the Illustrator SDK to go through the document and extract some information. We have a script that initiates this by calling Illustrator and instructing it to run the Javascript file.  This whole process works well.
    To make this easier for people to use, we have a program that runs on a server and watches a special directory.  When a file is dropped into that directory, this program notices, runs the script, and saves the output in another folder.  This process works well, too.
    To ensure that this program stays running and starts immediately when the system boots, we would like to run it as a Windows Service.  This is where we run into trouble.  Our program runs fine as a service, except that when we call Illustrator, it just hangs without executing our script.
    I don't see any output or error messages that would help us diagnose the problem.
    I was wondering if anybody else had tried calling Illustrator from a Windows Service, and maybe had some suggestions for getting it working?
    Thanks!
    -----Scott.

    I'm afraid I don't know anything that might help you on this one. I wouldn't have thought Illustrator was doing anything that unusual that might cause running from a Service grief. The only two suggestions I can think of are ones you may already have tried:
    1) check the event viewer -- there might be something there that doesn't show up in stderr or stdout
    2) Try posting in the Scripting forum; it feels like they might be more likely to have tried something like this than people in here. This is typically for plugin development, thoug I don't blame you at all for posting here -- it certainly would have seemed worth a shot to me Anyways, the AI Scripting forum is in:
    http://forums.adobe.com/community/illustrator/illustrator_scripting
    Hopefully someone there will have tried this and can help you out. Good luck!

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I got a macbook pro 13 inch core i5  late 2011 , it came with osx lion  and i been using facebook videocalls normaly , now i updated to Mountain lion but when i use facebook video calls in (safari ,chrome ) i see the window box but i only see my self  i c

    i got a macbook pro 13 inch core i5  late 2011 , it came with osx lion  and i been using facebook videocalls normaly , now i updated to Mountain lion
    but when i use facebook video calls in (safari ,chrome ) i see the window box but i only see my self  i can hear my friends but cant see em, they also can see me and hear me but i just see me and hear them .
    any ideas ?

    Your wifi problem sounds very much like the problem I had. The wifi would drop out, the icon showed it was still connected. If I turned it off, I couldn't turn it back on. Another user here pointed me to the problem, which was the wifi cable (the flat cable goint from the card to the motherboard). I found it on ebay for $13 and it's been running fine since I replaced it. This is the repair guide for your machine. The part number will be on there if you click the link.
    http://www.ifixit.com/Guide/MacBook+Pro+15-Inch+Unibody+Late+2011+AirPort-Blueto oth+Cable+Replacement/7510

  • "Windows cannot be installed to this disk. The selected disk has an MBR partition table. On EFI systems, windows can only be installed to GPT disks." Error

    Hey Im getting the following error when trying to install windows from a USB. 
    "Windows cannot be installed to this disk. The selected disk has an MBR partition table. On EFI systems, windows can only be installed to GPT disks."
    I installed the windows 8 (64bit) iso using boot camp to a usb.  I was able to do this after changing the info.plist to allow me to place the iso on the usb.  After I make the partition and start the install, I get the above error.  I formatted the partition in the installation but I keep getting this error.  I've repreated the entire process but i keep getting this errror and the disk utility says my partition is a Windows NT File System (NTFS) so im not sure what's going on.  If you can help me that would be greatly appreciated

    I am having the same problem. Windows is trying to install. It identifies the various partitions but says that I cannot install Windows on the Boot Camp partition or any other. I select Drive options (advanced) and Format the Boot Camp drive, but it makes no difference.
    This is the Windows error:
    Windows cannot be installed to this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only be installed to GPT disks.
    Windows cannot be installed to this disk. This computer's hardware may not support booting to this disk. Ensure that the disk's controller is enabled in the computer BIOS menu.
    I am not sure what Csound1 is suggesting with that post above. There are some involved suggestions over here <https://discussions.apple.com/message/23548999#23548999> about using Disk Utility to delete the Boot Camp partition and create new ones - is that the idea?

  • Windows cannot be installed to this disk 0. The selected disk has an MBR partition table. On EFI system, Windows can only be installed on GPT disks

    Hi All,
    I have been trying real hard to install Windows 8 on my Macbook Pro early 2011 model. I followed the instruction given by Bootcamp word to word, all things went very smoothly untill I was asked Windows Setup Instaled to selct the Hard drive. Here's the error:
    "Windows cannot be installed to this disk 0. The selected disk has an MBR partition table. On EFI system, Windows can only be installed on GPT disks...."
    Let me know guys what should I do?
    Thanks,
    Attiqe

    You have started the Windows 8 installer in EFI mode, and you don't have to start in EFI mode on a Mac because your Mac emulates a BIOS and a MBR partition table in order to install Windows in non-EFI mode.
    To start the Windows installer, hold the Option (Alt) key while your computer is starting and have a look at all the boot options you have. You should see two with a DVD above and they must be named "Windows" and "EFI Boot". Choose the option with "Windows" and follow the steps to install Windows. Note that you have to format the "BOOTCAMP" partition from the installer to be able to install Windows.
    If you are trying to install Windows from a USB drive, note that your computer isn't compatible to do it

  • JDBC Adapter Call a Table-Valued Function

    Hello to all,
    we're using the JDBC adapter to access a MS SQL-Server 2008.
    I have to call a "Table-Valued Function" via JDBC.
    Has anybody done this?
    I've tried to call it like a stored procedure with the following:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <fLGBuchungenSAP>
              <Tablename action="execute">
                   <table>dbo.fLGBuchungenSAP</table>
              </Tablename>
         </fLGBuchungenSAP>
    </ns1:LGBuchungSAP_REQ>
    but I get following error:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP' (structure 'fLGBuchungenSAP'): com.microsoft.sqlserver.jdbc.SQLServerException:
    Fehler bei der Anforderung für 'fLGBuchungenSAP' (Prozedur), weil 'fLGBuchungenSAP' ein Tabellenwertfunktion-Objekt ist.
    Calling with a select-statement also fails:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <STATEMENT_NAME>
              <Tablename action="SELECT">
                   <table>dbo.fLGBuchungenSAP(&apos;20101101 00:00:00&apos;, &apos;20110101 00:00:00&apos;)</table>
              </Tablename>
         </STATEMENT_NAME>
    </ns1:LGBuchungSAP_REQ>
    with error:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Eingangs-Message -->
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP('20101101 00:00:00', '20110101 00:00:00')' (structure 'STATEMENT_NAME'): java.lang.IndexOutOfBoundsException: Index: 4, Size: 4</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Please advice
    Regards
    Christian

    Hello to all,
    I solved the problem.
    You have to call it this way:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyzde/pi/mav/kantine">
         <STATEMENT>
              <LGBuchungSAP action="SQL_DML">
                   <access>select * from dbo.fLGBuchungenSAP(&apos;$DatumVon$&apos;, &apos;$DatumBis$&apos;)</access>
                   <key>
                        <DatumVon>20101101 00:00:00</DatumVon>
                        <DatumBis>20110101 00:00:00</DatumBis>
                   </key>
              </LGBuchungSAP>
         </STATEMENT>
    </ns1:LGBuchungSAP_REQ>
    But I get the next error: "A result set was generated for the update task"
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LGBuchungSAP' (structure 'STATEMENT'): com.microsoft.sqlserver.jdbc.SQLServerException: Es wurde ein Resultset für den Aktualisierungsvorgang generiert.</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>

  • Call RFC from DELPHI Windows Services Program

    Hi all,
    Are there any way to call RFC from DELPHI Windows Services Program?
    Best regards.
    Munur EBCIOGLU

    Hi again Bhagat,
    1. Yes, it's included on 7.4 ABAP Stack (SAP NetWeaver 7.4 SP8 - Optimized for SAP HANA, Cloud and Mobile - Service Release 2 available now!). In a recent customer, SAP licences GW by user but there are other license model like session licensing: https://store.sap.com/sap/cp/ui/resources/store/html/SolutionDetails.html?pid=0000009470&catID=&pcntry=US&sap-language=EN&_cp_id=id-1385059687642-0
    2. You could install as an AddOn on your 7.3 system, there are many options depending on your desired infrastructure: SAP Gateway deployment options in a nutshell For example our customer have deployed Central Hub Gateway in a standalone stack ABAP to act as an standalone oData bridge between ABAP/nonAbap systems.
    3. You could deploy SAPUI5 apps in 7.x, Java Web Servers or HTTP Web Servers. You must consider your SSO scenario:
    - SSO Logon Tickets. You will need to configurate SSO Logon Tickets between SAP NW Portal & SAP NW Gateway & your backend (ECC, etc). In order to pass SAP session cookie you will need setup SAP Web Dispacther and access portal & gateway throught SAP WD with the same domain.
    - SAML2 Tickets. This scenario lets you provide portal & gateway on different domains enabling SSO. You could configure SAP NW Portal as an Identity Provider and other systems must trust SAP Portal as IdP.
    Cheers

  • Calling SSIS package from C# Windows Service Fails

    Hi All.
    I've got an SSIS package that reads from an Excel file and populates a database. The Excel file location gets passed in to the package as a variable. Also the Protection Level of the package is set to EncryptSensitiveWithPassword.
    This all works fine when I run the package from Visual Studio or using DTEXEC. When I try to run it from a C# Windows Service though I get the following exception:
    SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Office Access Database Engine"  Hresult: 0x80004005  Description: "The Microsoft Office Access database engine cannot open or write to the file ''. It is already opened exclusively
    by another user, or you need permission to view and write its data.".
    SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Input Excel Connection" failed with error code 0xC0202009.  There may be error messages posted before this
    with more information on why the AcquireConnection method call failed.
    Dedupe Worksheet failed validation and returned error code 0xC020801C.
    One or more component failed validation.
    There were errors during task validation.
    The windows service runs with LocalSystem account and the following code is used to call the SSIS Package:
                    Application app = new Application();
                    Package package = null;
                    app.PackagePassword = "*******";
                    //Load the SSIS Package which will be executed
                    package = app.LoadPackage(@"C:\Projects\DataDedupeMatch\DataDedupeMatch\DataDedupe.dtsx", null);
                    //Pass the varibles into SSIS Package
                    package.Variables["User::FilePath"].Value = e.FullPath.Replace(@"\\", @"\");
                    Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
    I would really appreciate if someone could help me out with this.
    Thanks in advance,
    Deon

    Instead of hosting the SSIS runtime in your service, you should use a separate host process for your SSIS package.  You're using the Office drivers, which aren't designed or supported for running in long-lived unattended processes like a Windows Service. 
    You can use your own SSIS hosting code, or just use dtexec.exe to host your package.  In either case you would start the child process with
    Process.Start. 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Call a program via windows service

    Hi! I have write a windows service,and it works. I want to call a .exe file,and my .exe file is signature. The program can not work when I call it through my service. How can I solve my problem? Thanks!

    Hi Hassan,
    Thank you for sharing the code with us! 
    As I understand it, your code handles the situation of an user that is already logged on to an interactive window station (those of you, who need to create a UI-process of a user not yet logged on, could use
    CreateProcessWithLogon, or
    LogonUser to get the token). Because calling CreateProcessAsUser() requires advanced privileges (such as "Replace a process token level", or "Act as part of the operating system", privileges usually not held by a user unless specified so by the security
    policy), the code also implies a service running in the local system account (or equivalent).
    To make it easier to read, I'll post here the C#-version of your code:
    using System;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    namespace WindowsServiceLaunchingExe
    class NativeMethods
    [StructLayout(LayoutKind.Sequential)]
    public struct PROCESS_INFORMATION {
    public IntPtr hProcess;
    public IntPtr hThread;
    public System.UInt32 dwProcessId;
    public System.UInt32 dwThreadId;
    [StructLayout(LayoutKind.Sequential)]
    public struct SECURITY_ATTRIBUTES {
    public System.UInt32 nLength;
    public IntPtr lpSecurityDescriptor;
    public bool bInheritHandle;
    [StructLayout(LayoutKind.Sequential)]
    public struct STARTUPINFO {
    public System.UInt32 cb;
    public string lpReserved;
    public string lpDesktop;
    public string lpTitle;
    public System.UInt32 dwX;
    public System.UInt32 dwY;
    public System.UInt32 dwXSize;
    public System.UInt32 dwYSize;
    public System.UInt32 dwXCountChars;
    public System.UInt32 dwYCountChars;
    public System.UInt32 dwFillAttribute;
    public System.UInt32 dwFlags;
    public short wShowWindow;
    public short cbReserved2;
    public IntPtr lpReserved2;
    public IntPtr hStdInput;
    public IntPtr hStdOutput;
    public IntPtr hStdError;
    [StructLayout(LayoutKind.Sequential)]
    public struct PROFILEINFO {
    public int dwSize;
    public int dwFlags;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpUserName;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpProfilePath;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpDefaultPath;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpServerName;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpPolicyPath;
    public IntPtr hProfile;
    internal enum SECURITY_IMPERSONATION_LEVEL {
    SecurityAnonymous = 0,
    SecurityIdentification = 1,
    SecurityImpersonation = 2,
    SecurityDelegation = 3
    internal enum TOKEN_TYPE {
    TokenPrimary = 1,
    TokenImpersonation = 2
    [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    private static extern bool CreateProcessAsUser(IntPtr hToken, string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, ref PROCESS_INFORMATION lpProcessInformation);
    [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    public static extern bool DuplicateTokenEx(IntPtr hExistingToken, uint dwDesiredAccess, ref SECURITY_ATTRIBUTES lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, ref IntPtr phNewToken);
    [DllImport("advapi32.dll", SetLastError = true)]
    private static extern bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, ref IntPtr TokenHandle);
    [DllImport("userenv.dll", SetLastError = true)]
    private static extern bool CreateEnvironmentBlock(ref IntPtr lpEnvironment, IntPtr hToken, bool bInherit);
    [DllImport("userenv.dll", SetLastError = true)]
    private static extern bool DestroyEnvironmentBlock(IntPtr lpEnvironment);
    private const short SW_SHOW = 1;
    private const short SW_SHOWMAXIMIZED = 7;
    private const int TOKEN_QUERY = 8;
    private const int TOKEN_DUPLICATE = 2;
    private const int TOKEN_ASSIGN_PRIMARY = 1;
    private const int GENERIC_ALL_ACCESS = 268435456;
    private const int STARTF_USESHOWWINDOW = 1;
    private const int STARTF_FORCEONFEEDBACK = 64;
    private const int CREATE_UNICODE_ENVIRONMENT = 0x00000400;
    private const string gs_EXPLORER = "explorer";
    public static void LaunchProcess(string Ps_CmdLine)
    IntPtr li_Token = default(IntPtr);
    IntPtr li_EnvBlock = default(IntPtr);
    Process[] lObj_Processes = Process.GetProcessesByName(gs_EXPLORER);
    // Get explorer.exe id
    // If process not found
    if (lObj_Processes.Length == 0)
    // Exit routine
    return;
    // Get primary token for the user currently logged in
    li_Token = GetPrimaryToken(lObj_Processes[0].Id);
    // If token is nothing
    if (li_Token.Equals(IntPtr.Zero))
    // Exit routine
    return;
    // Get environment block
    li_EnvBlock = GetEnvironmentBlock(li_Token);
    // Launch the process using the environment block and primary token
    LaunchProcessAsUser(Ps_CmdLine, li_Token, li_EnvBlock);
    // If no valid enviroment block found
    if (li_EnvBlock.Equals(IntPtr.Zero))
    // Exit routine
    return;
    // Destroy environment block. Free environment variables created by the
    // CreateEnvironmentBlock function.
    DestroyEnvironmentBlock(li_EnvBlock);
    private static IntPtr GetPrimaryToken(int Pi_ProcessId) {
    IntPtr li_Token = IntPtr.Zero;
    IntPtr li_PrimaryToken = IntPtr.Zero;
    bool lb_ReturnValue = false;
    Process lObj_Process = Process.GetProcessById(Pi_ProcessId);
    SECURITY_ATTRIBUTES lObj_SecurityAttributes = default(SECURITY_ATTRIBUTES);
    // Get process by id
    // Open a handle to the access token associated with a process. The access token
    // is a runtime object that represents a user account.
    lb_ReturnValue = OpenProcessToken(lObj_Process.Handle, TOKEN_DUPLICATE, ref li_Token);
    // If successfull in opening handle to token associated with process
    if (lb_ReturnValue) {
    // Create security attributes to pass to the DuplicateTokenEx function
    lObj_SecurityAttributes = new SECURITY_ATTRIBUTES();
    lObj_SecurityAttributes.nLength = Convert.ToUInt32(Marshal.SizeOf(lObj_SecurityAttributes));
    // Create a new access token that duplicates an existing token. This function
    // can create either a primary token or an impersonation token.
    lb_ReturnValue = DuplicateTokenEx(li_Token, Convert.ToUInt32(TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_QUERY), ref lObj_SecurityAttributes, SECURITY_IMPERSONATION_LEVEL.SecurityIdentification, TOKEN_TYPE.TokenPrimary, ref li_PrimaryToken);
    // If un-successful in duplication of the token
    if (!lb_ReturnValue) {
    // Throw exception
    throw new Exception(string.Format("DuplicateTokenEx Error: {0}", Marshal.GetLastWin32Error()));
    else {
    // If un-successful in opening handle for token then throw exception
    throw new Exception(string.Format("OpenProcessToken Error: {0}", Marshal.GetLastWin32Error()));
    // Return primary token
    return li_PrimaryToken;
    private static IntPtr GetEnvironmentBlock(IntPtr Pi_Token) {
    IntPtr li_EnvBlock = IntPtr.Zero;
    bool lb_ReturnValue = CreateEnvironmentBlock(ref li_EnvBlock, Pi_Token, false);
    // Retrieve the environment variables for the specified user.
    // This block can then be passed to the CreateProcessAsUser function.
    // If not successful in creation of environment block then
    if (!lb_ReturnValue) {
    // Throw exception
    throw new Exception(string.Format("CreateEnvironmentBlock Error: {0}", Marshal.GetLastWin32Error()));
    // Return the retrieved environment block
    return li_EnvBlock;
    private static void LaunchProcessAsUser(string Ps_CmdLine, IntPtr Pi_Token, IntPtr Pi_EnvBlock) {
    bool lb_Result = false;
    PROCESS_INFORMATION lObj_ProcessInformation = default(PROCESS_INFORMATION);
    SECURITY_ATTRIBUTES lObj_ProcessAttributes = default(SECURITY_ATTRIBUTES);
    SECURITY_ATTRIBUTES lObj_ThreadAttributes = default(SECURITY_ATTRIBUTES);
    STARTUPINFO lObj_StartupInfo = default(STARTUPINFO);
    // Information about the newly created process and its primary thread.
    lObj_ProcessInformation = new PROCESS_INFORMATION();
    // Create security attributes to pass to the CreateProcessAsUser function
    lObj_ProcessAttributes = new SECURITY_ATTRIBUTES();
    lObj_ProcessAttributes.nLength = Convert.ToUInt32(Marshal.SizeOf(lObj_ProcessAttributes));
    lObj_ThreadAttributes = new SECURITY_ATTRIBUTES();
    lObj_ThreadAttributes.nLength = Convert.ToUInt32(Marshal.SizeOf(lObj_ThreadAttributes));
    // To specify the window station, desktop, standard handles, and appearance of the
    // main window for the new process.
    lObj_StartupInfo = new STARTUPINFO();
    lObj_StartupInfo.cb = Convert.ToUInt32(Marshal.SizeOf(lObj_StartupInfo));
    lObj_StartupInfo.lpDesktop = null;
    lObj_StartupInfo.dwFlags = Convert.ToUInt32(STARTF_USESHOWWINDOW | STARTF_FORCEONFEEDBACK);
    lObj_StartupInfo.wShowWindow = SW_SHOW;
    // Creates a new process and its primary thread. The new process runs in the
    // security context of the user represented by the specified token.
    lb_Result = CreateProcessAsUser(Pi_Token, null, Ps_CmdLine, ref lObj_ProcessAttributes, ref lObj_ThreadAttributes, true, CREATE_UNICODE_ENVIRONMENT, Pi_EnvBlock, null, ref lObj_StartupInfo, ref lObj_ProcessInformation);
    // If create process return false then
    if (!lb_Result) {
    // Throw exception
    throw new Exception(string.Format("CreateProcessAsUser Error: {0}", Marshal.GetLastWin32Error()));
    To use the code, create a new windows service project, and add code like the following one:
    using System;
    using System.Diagnostics;
    using System.ServiceProcess;
    using System.Timers;
    namespace WindowsServiceLaunchingExe
    public partial class ExeLauncherSvc : ServiceBase
    public ExeLauncherSvc() {
    InitializeComponent();
    Timer timer;
    protected override void OnStart(string[] args) {
    timer = new Timer(5000);
    timer.Elapsed += (sender, e) => {
    try {
    timer.Stop();
    EventLog.WriteEntry("WindowsServiceLaunchingExe", "Launching process...");
    NativeMethods.LaunchProcess(@"C:\Windows\notepad.exe");
    } catch (Exception ex) {
    EventLog.WriteEntry("WindowsServiceLaunchingExe", ex.Message);
    timer.Start();
    protected override void OnStop() {
    Because NativeMethods.LaunchProcess() throws exceptions on errors, be sure to enclose calling code in a try/catch-block.
    I also would recommend reading this:
    Stephen Martin - The Perils and Pitfalls of Launching a Process Under New Credentials
    http://asprosys.blogspot.com/2009/03/perils-and-pitfalls-of-launching.html
    Stephen Martin - Launch Process From Service (code download)
    http://www.asprosys.com/Downloads/LaunchProcessFromService.zip
    Marcel

  • Exception while calling native profiler (root cause: no message available [

    Hi,
    We are setting up MAM30 using the new technology (NWMADMIN). During sync. I get the error message "Exception while calling native profiler (root cause: no message available [java.lang.reflect.Invocat...". Can anyone help me on this?
    Thanks
    Kind regards
    Jacob

    Hi Jacob,
    I once faced this problem(no in MAM though)
    I will try to guess the solution to your problem,
    1) My first guess would be that, the header file in MAM30 using the 'javah' tool, did not pass the fully qualified name of the class as the argument. The 'javah' tool will not complain and will produce an incorrect header file.
    2) The Native method names wouldnt have got a match for the java method names, might be missing the package name. here you need to import the missing ones.
    3) Or you would be calling static native methods using objects, it should be accessed in a static way. you can call them directly.
    Hope this helps.
    Regards
    Divya.

Maybe you are looking for

  • Functionality of CRM_WFM_SIS_BP in CRM 2007

    Hello All, I have migrated my CRM 4.0 code to CRM 2007. In one of the function modules I am making call to CRM_WFM_SIS_BP_ORGS which belongs to function group CRM_WFM_SIS_BP... Now this Function Group doesn't exist in CRM 2007. So is there any other

  • Release 11i to Release 12 upgrade or Re-Implement. Which is better?

    Hi Customer, One of our customers has implemented Oracle Applications 11i (11.5.9) [Oracle Financials] on Linux (Single Node). They are planning to implement Oracle HRMS and also wants to upgrade to R12 and Oracle Discoverer 10g. They want to know wh

  • Another 16:9 import problem

    I have read a bunch of postings on this problem, but none seem to be working for me, so any advice is much appreciated. I have a older (about 5 years old) Sony Camcorder that does have a FireWire [iLink] port. I have recorded all my tapes in the camc

  • Pre-ordering an album?!? Quick question?

    I plan on pre-ordering an album. But I do know that you get an album for a discount if you purchase singles from it. I've purchased two already. My question is can I pre-order the album at a discount? And if so, how? Thanks.

  • Copying Outlook Contacts to Mac Address Book

    I've searched through the forums and whilst this topic is raised quite a few times it hasn't really been answered. I have got 3500+ contacts on my work PC in Outlook. I have installed Outlook for Mac 2011 on my new imac and I have the full contacts c