I am trying to get started with SDK using some sample JSP’s. I have dsws installed and working (we have several web services functioning properly). So, i know that got deployed ok.
I have copied in the jar files to my WEB-INF/lib directory as instructed in the install docs. The “import” lines from the JSP are working fine, so it is able to read in the classes/jar files fine.
However, in the JSP code, it is trying to create a new connection, and it is failing with this error:
com.businessobjects.dsws.session.Session is abstract; cannot be instantiated
Session boSession = new Session(boConnection);
^
Basically, it seems that the code is trying to create a new Session object, but the definition of that won’t allow it to work. Thus, the rest of my code fails as well.
Here is the section of code that is failing:
// Create the URL for the Session Service and instantiate a new Session
URL sessConnURL = new URL(serviceURL + "/session");
Connection boConnection = new Connection(sessConnURL);
Session boSession = new Session(boConnection);
Any ideas as to why that class is not working? Maybe I have the wrong dsws-session.jar? Is there some place that I can try to download any updated version of that?
The Java consumer JAR files are installed in the following location:
C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\Web Services\en\dsws_consumer\data
Alternatively, you can download the Java consumer JAR files from the online Developer Library.
I did use the files from the dsws_consumer/data directory that I had. But, those are the ones that I am wondering if they are valid. So, I was wanting to try to second option of downloading from the Developers Library, but I can’t seem to find that anywhere.
Thanks for the link. I downloaded and compared, and the files are the exact same I was using. I went ahead and copied them in anyway, just to make sure, and I still get the same error.
I also even un-jar’ed the Session.jar file, and decompiled the class and I don’t see any “abstract” reference in the source code at all. So, I don’t know what is causing this error at all.
I have tried some other jsp SDK samples that do NOT use the Session class, and they seem to work fine. I am able to view and look at information about my CMS servers, etc. But, I was trying to figure out a way to run the enable/disable of CMS servers, and the sample that I found was using this Session connection to do that.
So, an alternative to fixing my Session issue would be to find a way to enable and disable CMS servers using the SDK without actually using that Session class.
The only other thing that I can think of is that another copy of the erroneous jar is hidden somewhere like a common class path of the application server.
Other than that I am as stump as you are.
If you do find the solution, don’t forget to post it.
I am curious to find out what the culprit is.
Ok, I think I maybe resolved the issue. Still looking at it, but it seems promising. I noticed that I had a jar file named dsws-session-ws.jar in my WEB-INF/lib directory as well.
I grabbed a sample JSP page to have it list out my CLASSPATH, and noticed that this jar was being loaded FIRST in my path. When I un-jarred it, and decompiled it, I noticed that this one DID have a definition for the Session object which WAS defined as “abstract”. So, it seems this class was being loaded instead of my full class that I needed to have loaded.
I removed this dsws-session-ws.jar file and it seems to have gotten rid of my error.
So, it looks like we were on the right path with the fact that it was the wrong class… it was just that the object was defined in a different jar file FIRST.