September 23, 2010 at 11:30 am
Hello, I'm putting this out here in the HOPE that there are some developers out there somewhere that are using Cognos SDK's with SQL Server. We seem to find that people that do this are few and far between...so here goes:
We have an SDK that is pulling all Cognos users from the database and another SDK that pulls out all the roles/groups associated with those users.
Ultimately, we want the results of these two SDK's in two tables in our SQL Server. Previously, I was executing the SDK from a stored procedure that used xp_cmdshell to kick off the SDK and output it to a text file. Due to some problems with our Cognos enviornment, the SDK stopped working.
We now have a new SDK developer and he has rewritten the SDK to function properly. I installed the SDK code files on our SQL Server and I can execute the SDK perfectly fine from a dos cmd file window in Windows. However, when I try to execute the SDK from SQL Server in my stored procedure I'm getting this error:
java.lang.NoClassDefFoundError: GetUserAccounts
Caused by: java.lang.ClassNotFoundException: GetUserAccounts
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: GetUserAccounts. Program will exit.
Exception in thread "main"
I'm really at a loss as to why this is happening because I have used this method before and it has worked just fine. The only thing different in our enviornment is that we have upgraded to a brand new SQL Server 2005 from 2000 a few months ago. So, my old code was working on SQL 2000.
I have set permissions and made sure that I can execute the xp_cmdshell...we're using it for a variety of other things...
Does anybody have any idea about this? I can't figure out why it works when I use a cmd shell from windows but not from the query window in SQL Server.
September 24, 2010 at 5:56 am
Hi Amy,
We've been working for years with the Cognos SDK, and can provide some insight in this area.
I'm assuming you've packaged the SDK application ("GetUserAccounts") which you're kicking off in a jar file. Just looking at the callstack provided above, it seems to me that this jar file is likely not present in the classpath for the java invocation you're kicking off from xp_cmdshell. Note - you can add things to the classpath of a java invocation by using the -classpath command line option.
If you need further assistance with this, feel free to contact me (lhankins AT motio.com), and I'll be happy to put you in touch with someone from our services team.
http://www.motio.com/services.do
On a related note - it sounds like you guys have already invested in building out custom SDK code which retrieves a list of all users and their group / role membership, but if anyone else stumbles across this post and has a similar need, there is a free tool for Cognos Admins called MotioPI which supports this very feature (there is a short video on the following page which shows this) :
http://www.motio.com/investigator/home.do
Good Luck,
Lance
September 24, 2010 at 7:46 am
Hi there, thanks for the link. I believe we figured out the problem with it and its just because I'm trying to execute the sdk from a remote path and not directly in the directory that the sdk is stored in. I think we'll be able to fix it.
I did take a look at your website there... it looked interesting but can it actually run SDK's? I saw that it was running reports or something from the demo. But I think it would only be useful if it could actually run SDK's.
I also could not find a section where it gave all the product info... just a bunch of posts with patch notes.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply