Hi,
I use the latest Crystal reports plugin for Eclipse (latest version) on tomcat 5.5 using Windows 2003 server.I have reported this before but was not able to resolve the issue and now it is making our application unusable so I come with an open heart for some further advise. It only happens on our live environment (note this live environment also has a application using Crystal XI equivalent) and will be okay for a week, and once this error occurs we have to reboot the server.
I need some guidance on what to try next, as my java knowledge is a work in progress.
The error message:
No Sax Parser is available
com/crystaldecisions/xml/serialization/SourceFile, line 65.
I have read some other threads to do with serialisation but I don't understand enough to assist me with my problem. Below are further details of the error:
com.crystaldecisions.xml.serialization.XMLObjectSerializer.(SourceFile:65) com.crystaldecisions.proxy.remoteagent.ClientSDKOptions.readClientSDKOptions(SourceFile:147) com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.n(SourceFile:1129) com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.j(SourceFile:275) com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.(SourceFile:244) com.businessobjects.samples.CRJavaHelper.openReport(CRJavaHelper.java:788) com.businessobjects.samples.CRJavaHelper.validateReport(CRJavaHelper.java:941)
The openReport, line 788: clientDoc = new ReportClientDocument();
I use: com.crystaldecisions.sdk.occa.report.application.
Should I use com.crystaldecisions.report.sdk, or com.crystaldecisions12.sdk.occa.report.application.
This is my openReport
public static ReportClientDocument openReport (String rptName, HttpSession session, ServletContext serContext, boolean doSubReports) throws ReportSDKException, Exception { //ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(rptName); ReportClientDocument clientDoc = (ReportClientDocument) serContext.getAttribute(rptName); if (clientDoc == null) { // Report can be opened from the relative location specified in the CRConfig.xml, or the report location // tag can be removed to open the reports as Java resources or using an absolute path // (absolute path not recommended for Web applications). clientDoc = new ReportClientDocument(); clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString); clientDoc.open(rptName, OpenReportOptions._openAsReadOnly);
The mechanism I log onto the report is below. This was adviced by Ted as I had problems with the standard helper functions causing a problem with alias tables:
DatabaseController databaseController = clientDoc.getDatabaseController(); ConnectionInfos connectionInfos = (ConnectionInfos)databaseController.getConnectionInfos(null); // Get old connection info IConnectionInfo oldConnectionInfo = connectionInfos.getConnectionInfo(0); // Build new connection Info IConnectionInfo newConnectionInfo = new ConnectionInfo(); newConnectionInfo.setKind(ConnectionInfoKind.SQL); PropertyBag newProperties = new PropertyBag(); newProperties.put("Connection URL", connectString); newProperties.put("Server Type", "JDBC (JNDI)"); newProperties.put("Database DLL", "crdb_jdbc.dll"); newProperties.put("Database Class Name", driverName); newConnectionInfo.setAttributes(newProperties); newConnectionInfo.setUserName(userName); newConnectionInfo.setPassword(password); { databaseController.replaceConnection(oldConnectionInfo, newConnectionInfo, null, DBOptions._useDefault + DBOptions._doNotVerifyDB); databaseController.logon(userName, password); } // SUB REPORTS... if (doSubReports) { SubreportController src = clientDoc.getSubreportController(); IStrings strs = src.getSubreportNames(); Iterator<?> it = strs.iterator(); while (it.hasNext()) { String name = (String)it.next(); ISubreportClientDocument subreport = src.getSubreport(name); DatabaseController sdc = subreport.getDatabaseController(); connectionInfos = sdc.getConnectionInfos(null); IConnectionInfo oldci = connectionInfos.getConnectionInfo(0); IConnectionInfo newci = new ConnectionInfo(); newci.setKind(ConnectionInfoKind.SQL); newci.setAttributes(new PropertyBag(newProperties)); newci.setUserName(userName); newci.setPassword(password); sdc.replaceConnection(oldci, newci, null, DBOptions._useDefault + DBOptions._doNotVerifyDB); sdc.logon(userName, password); } }
Any help seriously appreciated.
Regards
Matthew