I posted this question in 'BI platform>COGNOS 8>SDK', but I think I might have posted it in the wrong forum.
I want to give users the ability to run Cognos reports inside a java web application that I am making. However I am having problems making a connection to my Cognos server. The wierd thing is that if I run one of the examples provided by Cognos directly as a java application, (in Eclipse, right click, run as, Java application) I am able to make a connection with no problems. It is only when I move the exact same code to my web application the problems arise. I have included all of the correct jar files into my build path (from \Cognos\c8\sdk\java\lib), but keep getting the following error:
Servlet.service() for servlet default threw exception
java.lang.NoSuchFieldError: RPC
My code looks like this:
import com.cognos.developer.schemas.bibus._3.*;
import org.apache.axis.client.Stub;
...
String endPoint = "http://localhost/cognos8/cgi-bin/cognos.cgi";
ContentManagerService_ServiceLocator cmServiceLocator = new ContentManagerService_ServiceLocator();
ReportService_ServiceLocator rsServiceLocator = new ReportService_ServiceLocator();
//cmService is set up with a Stub
cmService = new ContentManagerServiceStub(new java.net.URL(endPoint), cmServiceLocator);
It fails on this line: 'cmService = new ContentManagerServiceStub(new java.net.URL(endPoint), cmServiceLocator);'
I thought it might be a problem with one of the jar files (maybe wrong version), but I am using the jar files that came with Cognos. My webapp is a simple struts2 project. I deployed the 'struts2-blank-2.0.11.war' file and modified it by adding the jar files from 'Cognos/c8/sdk/java/lib'
Any ideas?