cancel
Showing results for 
Search instead for 
Did you mean: 

CR2008 using salesforce.com driver: .NET app hangs or crashes on exit

bill_wingate
Explorer
0 Kudos

I have a report that uses the salesforce.com driver. Everything works fine when printing or exporting from CR2008.

I have a .NET application that uses the CR2008 runtime to export the report. The export works correctly, but the application hangs when it finishes the export and exits. This is a console mode application, and it hangs after my main function returns.

I have not been able to get anything useful when running the application through the debugger (VS.NET 2008): I generally get a VC++ runtime error for the hosting process (vshost.exe), or, if I turn on unmanaged code debugging it hangs just like it does outside the debugger.

The problem isn't specific to a particular export format or even to exporting--the same thing happened when I printed instead. It also doesn't seem to be related to the report date: if I don't set login credentials before I try to export, I get a login failure so the data is never read, but the hang still occurs at exit.

The application works fine with other reports that do not use the salesforce driver.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

This is a new one. Never worked with the salesforce driver...

First, apply SP 2 for CR 2008;

https://smpdl.sap-ag.de/~sapidp/012002523100009038092009E/cr2008win_sp2.exe

Second, I want to give you a bit of a heads up as to the issues you will need to overcome if you want to be deploying this app to computers with no Crystal Reports installed. The driver (crdb_sforce.dll) has a dependency on the Java framework. As such, none of the CR runtime files (msm, or msi) contain the dll and it is up to the developer to ensure the runtime environment is created correctly. For more details see [this|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13732] [original link is broken] [original link is broken] [original link is broken]; blog. The blog discusses crdb_xml.dll for the same applies to the salesforce driver.

If SP2 above does not resolve the issue and the Java environment is not a show stopper for you, please provide the code used for the database login.

Ludek

bill_wingate
Explorer
0 Kudos

Thanks for the deployment tips.

On the machine where I am developing the application I have Crystal Reports 2008 installed (no service packs). I'm not building against SP2 because there are no merge modules (that I can find) to distribute the SP2 runtime.

However, I tested on a machine that does have SP2 installed, and the same problem occurs.

I have reproduced the problem using this code in a VB.NET console application

:


Imports CrystalDecisions.CrystalReports
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions
Module Module1

    Sub Main()
        ExportReport("c:\temp\salesforce.rpt", "c:\temp\salesforce.pdf")
        Console.WriteLine("Finished. Exiting main")
        'application will hang or crash when Main returns

    End Sub

    Private Sub ExportReport(ByVal reportName As String, ByVal exportName As String)
        Dim report As ReportDocument

        report = New ReportDocument
        report.Load(reportName, OpenReportMethod.OpenReportByDefault)

        Dim rExportOptions As New ExportOptions
        Dim diskOptions As New DiskFileDestinationOptions
        rExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
        diskOptions.DiskFileName = exportName

        rExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
        rExportOptions.ExportDestinationOptions = diskOptions
        Console.WriteLine("Exporting")
        Try
            report.Export(rExportOptions)
            Console.WriteLine("Export finished")
        Catch ex As Exception
            Console.WriteLine("Export failed: " & ex.Message)
        End Try

    End Sub

End Module

I am not setting any credentials, so I get a logon exception as expected, which is handled inside the ExportReport method. Execution continues until my code returns from Main, at which point it hangs or crashes.

former_member183750
Active Contributor
0 Kudos

I am not setting any credentials, so I get a logon exception as expected, which is handled inside the ExportReport method. Execution continues until my code returns from Main, at which point it hangs or crashes.

Not sure I understand. Can you give me more details on how this database logon is handled in the ExportMethod?

BTW., runtime for SP 2:

msm

https://smpdl.sap-ag.de/~sapidp/012002523100009159092009E/cr2008sp2_mm.zip

msi

https://smpdl.sap-ag.de/~sapidp/012002523100009159002009E/cr2008sp2_redistinstall.zip

clickonce

https://smpdl.sap-ag.de/~sapidp/012002523100009158992009E/cr2008sp2_clickonce.zip

Ludek

Edited by: Ludek Uher on Oct 26, 2009 10:08 AM

bill_wingate
Explorer
0 Kudos

In my real code I am setting the login information using ApplyLogOnInfo. However, it does not matter whether I set the logins or not--the application will still crash once it has connected to salesforce and tried to retrieve the data. So I left all of that out of my repro code since it does not affect the outcome.

0 Kudos

Hi Bill,

Can you go to Microsofts site and download DebugDiag and set it up to capture the crash on your exe?

Then analyze the dump file and see if it reports what dll the app is crashing in.

Thank you

Don

bill_wingate
Explorer
0 Kudos

It's mostly hanging at exit. I think the times that it crashed in the VS debugger were flukes, or the debugger host process failing.

When I run it outside the debugger there is no crash for DebugDiag to capture, but I used DebugDiag to create a dump after it hung and then ran that through the analyzer. I get this stack trace for thread 0 (the only active thread):


ntdll!KiFastSystemCallRet    
ntdll!NtWaitForSingleObject+c    
kernel32!WaitForSingleObjectEx+ac    
kernel32!WaitForSingleObject+12    
etc_1_0_12_5!Etc1001204::JTCEvent::wait+46    
etc_1_0_12_5!Etc1001204::JTCRecursiveMutex::_JTC_getId+25    
etc_1_0_12_5!Etc1001204::JTCMonitor::validateMutexOwner+61    
etc_1_0_12_5!Etc1001204::JTCMonitor::validateMutexOwner+135    
ebus_3_3_2_6!OBGIOPClient::destroy+10f    
ebus_3_3_2_6!CORBA_ORB::_OB_decClientUsage+8d    
msvcr80!_encoded_null+8    
crdb_sforce!DbConvertValueToString+23abf    
crdb_sforce!DbConvertValueToString+d00a    
crdb_sforce!DbConvertValueToString+23bd1    
crdb_sforce!DbConvertValueToString+3e7be    
crdb_sforce!DbConvertValueToString+28151    
crdb_sforce!DbConvertValueToString+28244    
crdb_sforce!DbConvertValueToString+282c0    
ntdll!LdrShutdownProcess+182    
kernel32!_ExitProcess+43    
kernel32!ExitProcess+14    
mscorwks!SafeExitProcess+157    
mscorwks!DisableRuntime+dc    
mscoree!_CorExeMain+2c    
mscoree!_CorExeMain+2c    
kernel32!BaseProcessStart+23    

former_member183750
Active Contributor
0 Kudos

Bill, working on this with Don, we're wondering if you could do the following;

1) post the whole DebugDiag log. I'll create an FTP container for that.

2) if you could create a simple app that demos the issue and add that to the upload with instructions on how to get to the report, etc. (you'll have to zip up the log and the app together as the container will only be good for one file)

3) add a viewer to your app (or the sample in (2) above and see if the report will get to the viewer. if it does, can you export / print from the viewer?

4) have a look at [this|http://forumsa.sdn.sap.com/click.jspa?searchID=33335514&messageID=7129773] forum thread. In particular, see Don's post from Aug 11, 2009 to see if this may apply to your situation.

And a heads up; this issue may require a phone case as it is starting to look like resolution over the forums may not be possible. If needed, phone cases can be created here:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Ludek

former_member183750
Active Contributor
0 Kudos

Bill, can you also please see [this|; thread and see if the steps specified there will help in determining the issue?

Ludek

bill_wingate
Explorer
0 Kudos

Thanks for the help. I have uploaded a ZIP to you. The demo application is the code that I already posted. I am not doing anything in the code other than open the report and export it.

The problem is not with viewing or exporting the report: that part works correctly. I am able to export fine with my code, or by opening the report in a viewer and exporting from there. But the application will hang when it exits. From the DebugDiag log it looks like the driver code may have a deadlock on a mutex.

I do not think that the thread you referenced applies to my situation.

I am not enthusiastic about paying $200 for a phone support case to report a bug, especially without some assurance that there will be a timely fix for the issue as a result. I don't want to pay to report the problem and then wait 6 months to see if it might get fixed in the next update.

0 Kudos

Hi Bill,

If it is a bug you will get a credit back for the case. This way we have a case to escalate against but it's up to you. If you don't it may never get fixed or be very low in priority.

The link Ludek sent you is long but the part I wanted you to try is this:

In your Project:

1. Right click the ProjectName

2. Choose Properties

3. Click Debug Tab

4. On the bottom, there is a check box named u201CEnable unmanaged code debuggingu201D, enable it.

See if that fixes you crash on exit in both Debug and Release modes.

Thanks again

Don

bill_wingate
Explorer
0 Kudos

Enabling unmanaged debugging does not have any effect on the problem.

I will open a support case.

bill_wingate
Explorer
0 Kudos

This is not the right thread for this but I must note that the process for buying and using a support incident requires so much work on my part that I think you should be paying me for my time and not the other way around.

I followed the link and purchased the support case, through a store that treats everything like it's a software license. At the end of the process I got an unlock code plus a PDF that tells me I have to register my purchase but gives me no information about how to actually contact support.

I went through the registration process, got to the end, and still had no information about how to use my support case.

The PDF contains a list of regional phone numbers with no indication of what those numbers are, so I called the North America one and was connected, over a very bad line, to someone in Germany who did not understand what I was asking about and was absolutely no help at all.

I got a registration confirmation e-mail message. At the bottom is a link that says I should click it if I am "unsure how to log a case". When I clicked that link it took me to the main page of the SAP Service Marketplace, which gives no information about how to log a case.

Finally I called the pre-sales customer service number and spoke to someone who told me to go to the Service Marketplace and click the Crystal Reports section. On this page is a link to a FAQ for customers without maintenance agreements. Under there is a section on how to purchase a support case. The last of the 4 steps is to "activate" my single case, which is in addition to the "registration" I have already done. Clicking this link takes me to a page that tells me to send them an e-mail with all sorts of purchase and contact information that I have already provided in various other places. Now I have sent off that e-mail

Are you kidding me? Someone really needs to fix this.

former_member183750
Active Contributor
0 Kudos

Bill, let me apologize for the difficulty you have had with the support system. I understand your frustration and we are working on improvements all the time. The systems were designed by SAP for Enterprise customers and so we are using systems that were never designed for single cases. This is not an excuse, just an explanation. Let me know if you would like someone higher than me to reach out and contact you regarding this directly.

Other than that, I do hope a case was created for you and that you've been able to at least have an initial conversation with technical support.

Ludek

Answers (1)

Answers (1)

bill_wingate
Explorer
0 Kudos

FYI for anyone else who has this problem: it's confirmed as a bug. There was already a known issue for the JDBC and XML drivers doing the same thing (issue ADAPT00831070). Fix is scheduled for SP3 (May, 2010?!)

former_member183750
Active Contributor
0 Kudos

Thank you for the post Bill. I should have done it my self - slipped there. I will update this tread once the fix is released.

Ludek

former_member183750
Active Contributor
0 Kudos

A fix for the issue has been released in FP 2.2:

https://smpdl.sap-ag.de/~sapidp/012002523100015097962009E/cr2008_fp22.exe.

Description:

Crystal Reports .NET applications may display the following error message upon being closed: "This application has requested the

runtime to terminate in an unusual way. Please contact the application's support team for more information".

This problem happens with applications that use a JDBC or XML driver connection.

New Behavior:

This problem is resolved.

Ludek

former_member183750
Active Contributor
0 Kudos

Further investigation showed that the issue was not completely resolved and was thus resubmitted to R&D for further work. I have tested the issue in the recently released SP 2.3 and it appears to be completely resolved.

SP 2.3 is here;

https://smpdl.sap-ag.de/~sapidp/012002523100015892592009E/cr2008v1_sp2fp23.exe

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup