on ‎2008 Apr 17 7:52 PM
How can I put JRC's JARs in Tomcat's shared\lib -directory instead of my application's lib-directory? Everything works fine if JARs are in Tomcat\webapps\MyApplication\WEB-INF\lib but if I move them to Tomcat\shared\lib I'll get en error message:
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Unexpected error determining relative path---- Error code:-2147217395 Error code name:serverProgrammingError
Since there might be several web applications on the server running JRC I'd prefer having only one set of required JARs in shared/lib.
Request clarification before answering.
For the JRC XI Release 1 and higher, the reportLocation tag value you'd place in CRConfig.xml is relative to the location of CrystalReportEngine.jar file. You'd get that error if the app can't walk up the path from the jar file location to where it expects to find the rpt files.
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I can't place CrystalReportEngine.jar in shared/lib since I have several web-applications with rpt files in their own directories and there can be only one CRConfig.xml with reportlocation tag. Right?
Does this apply to CrystalReportEngine.jar only or all the other JARs too? Would it be possible to put CrystalReportEngine.jar in applications WEB-INF/lib and all other JARs in shared/lib? Any problems with this kind of setup?
I know this thread is old but it came up in a Google search when we were looking for ways to move the crystal jars to tomcat/lib in Tomcat 7. I'll review our very lengthy testing and Googling results in the hope it helps somebody else.
Basically it all boils down to whether or not you have <reportLocation> specified in CRConfig.xml. If you have the crystal jars in your application's WEB-INF/lib folder, you can add a relative path to your reports folder in <reportLocation> and then you only have to specify the report file name when calling ReportClientDocument.open(). If you move the crystal jars to tomcat/lib, we get the same error as the OP, no matter what we tried to put in <reportLocation>.
So, let's assume you have already moved the jars to tomcat/lib. Now you need to look to see if you have <reportLocation> in CRConfig.xml:
If you do, it seems that crystal is looking specifically for "WEB-INF/lib" in the path of where the crystal jar is. If the path doesn't contain that string, which it doesn't because it's now tomcat/lib, it throws that error.
If you don't have it specified, it must assume that you are passing the path and file name to the ReportClientDocument.open() call and it works. At least it does for us. It seems the code doesn't do the check for "WEB-INF/lib" in the jar path if <reportLocation> doesn't exist.
So you have two options:
1. We haven't tested this but theoretically, you could create a WEB-INF/lib folder in Tomcat with the crystal jars. Add that folder to Tomcat as a library folder and add it to your project so your project can use the crystal jars (or just create WEB-INF/lib inside the /lib folder). Then you should be able to add <reportLocation> to CRConfig.xml. This should satisfy the check for "WEB-INF/lib" that crystal does. Again, we haven't tested this.
2. Remove <reportLocation> from CRConfig.xml and specify the relative path and file name when calling ReportClientDocument.open(). According to our tests, the relative path seems to be from the application's WEB-INF/lib folder, even though the crystal jar is in tomcat/lib. So if your report is in a folder called "reports" at the root of the WAR, then your path would be "../../reports" + your report file name.
This raises a couple of questions. Why does SAP want the crystal jar/s in a path that contains "WEB-INF/lib"? It shouldn't really matter where we put them as long as we can access them? Why does this check depend on whether or not <reportLocation> exists in CRConfig.xml? What's so important about <reportLocation>?
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.