Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError: com/sas/services/connection/ZeroConfigWorkspaceServer #61

Closed
underwoodpeter opened this issue Sep 20, 2017 · 14 comments

Comments

@underwoodpeter
Copy link

Hi I am trying to connect from Windows Client to a Grid running on a Linux server. I read somewhere that the zeroConfig is a for conencting to a windows sas server? but I am going to linux server
I am not sure what in my configuration is having saspy think this is going to a windows SAS?

"Zero-configuration workspace server connections enable you to create a local workspace server without specifying any connection attributes. This feature is specific to Windows environments. "

Here is the command line debug with message.
C:\ProgramData\Anaconda3\Lib\site-packages>java -classpath "C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\log4j.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.security.sspi.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.core.jar" pyiom.saspy2j -host localhost -stdinport 57576 -stdoutport 57577 -stderrport 57578 -appname 'SASApp - Workspace Server' -iomhost server.test.com -iomport 8593 -user myid
Exception in thread "main" java.lang.NoClassDefFoundError: com/sas/services/connection/ZeroConfigWorkspaceServer
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

SAS_config_names=['uscm_prod','uscm_nonprod']
SAS_config_options = {'lock_down': True}
SAS_output_options = {'output' : 'html5'}

build out a local classpath variable to use below for Windows clients

cpW = "C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\log4j.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.security.sspi.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.core.jar"

uscm_prod = {'java' : 'java',
'iomhost' : 'serverprod.test.com',
'iomport' : 8593,
'encoding' : 'latin1',
'classpath' : cpW
}

uscm_nonprod = {'java' : 'java',
'iomhost' : 'server.test.com',
'iomport' : 8593,
'encoding' : 'latin1',
'appserver' : 'SASApp - Workspace Server',
'classpath' : cpW
}

@tomweber-sas
Copy link
Contributor

@underwoodpeter, you're right about zero config being for a local windows session. You're configuration looks right for a remote IOM connection (regardless of if the remote server is windows or linux). saspy shouldn't be trying to use the zero config connection, Can you tell me what version of saspy you have? And where did you get the sas jars from? I've seen an issue before where the jars someone used were not from a Base SAS install; maybe they found these jars in a solutions directory and those jars didn't have everything in them. I don't know if this is the case, as I'm not sure whether java would throw an exception about a class not found, only due to it being referenced in the code but not executed. That's my guess at the moment, because saspy wouldn't be trying to make that connection, from what I see, so it would only be that the reference to that class couldn't be resolved, even though it wasn't trying to actually call it. I don't know java enough to know if it would do that or not.
Can you run the following command to see if it's missing from the jar you have?

jar -tf C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar

Thanks,
Tom

@underwoodpeter
Copy link
Author

Hi Tom,
Thanks for the insight- those jar's were from 9.4m2- and zero config was not in the jar listing- when I ran that command- I checked jar files from 9.4m4 and zero config is in that version.
I am copying them over and will be testing shortly.
Peter

@tomweber-sas
Copy link
Contributor

Ah, good deal. I expect that should work for you. I'll have to check and see if that was an oversight in M2 or maybe this zero config feature didn't come out till after that? I'll see what I can find.

@tomweber-sas
Copy link
Contributor

Hmm, I see in our doc it says 9.3 or later, so 94m2 should certainly have had it. Be sure to add the spiauth.dll to your system path (and you might have to reboot windows 50:50 chance). I'll see if I can track down why the m2 jars aren't right.

@underwoodpeter
Copy link
Author

I do not want to connect to a local sas- but to a unix sas grid. so I should not need the spiauth.dl

I am getting closer-
The OS Error was:
The system cannot find the file specified

SAS Connection failed. No connection established. Double check you settings in sascfg.py file.

Attempted to run program java with the following parameters:['java', '-classpath', 'C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\log4j.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.security.sspi.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '56724', '-stdoutport', '56725', '-stderrport', '56726', '-iomhost', 'lx-pmsgrdn-s01k;lx-pmsgrdn-s02k', '-iomport', '8593', '-user', 'user1', '']

If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong:
java -classpath "C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\log4j.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.security.sspi.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 56724 -stdoutport 56725 -stderrport 56726 -iomhost lx-pmsgrdn-s01k;lx-pmsgrdn-s02k -iomport 8593 -user user1

No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.

When I run that command it runs and does not error- and I have cntrl-c to exit?

C:\Users\n0003528>java -classpath "C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.svc.connection.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\log4j.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.security.sspi.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 56724 -stdoutport 56725 -stderrport 56726 -iomhost lx-pmsgrdn-s01k;lx-pmsgrdn-s02k -iomport 8593 -user user1

C:\Users\n0003528>

@underwoodpeter
Copy link
Author

saspy was looking for java-- I added the path to my widows machine .. now I am talking to the object spawner.. nice! __ it looks like some server issue- but I am at least I am connecting.

Please enter the password for IOM user user1: ········
The application could not log on to the server "lx-pmsgrdn-s01k:8593". The load balancing object spawner timed out.
The application could not log on to the server "lx-pmsgrdn-s02k:8593". The load balancing object spawner timed out.

SAS process has terminated unexpectedly. RC from wait was: 4294967290
SAS Connection failed. No connection established. Double check you settings in sascfg.py file

@tomweber-sas
Copy link
Contributor

Oh, of course, you don't need the spiauth.dll. To many things going on here at once.
That OS error means it couldn't find the 'java' command. I'm not sure it really ran for you, as it should have gotten an exception trying to connect back to the (not actually running) saspy process on the sockets.

Can you double check where you have java installed and try specifying the fully qualified path to java.exe in the 'java' key in your config definition.

@tomweber-sas
Copy link
Contributor

Hmm, ok, that's closer. So, here's the next thing. The 'iomhost' needs to be the (one of the) machines running an object spawner. The 'iomport' has to be the port number for the workspace server you're trying to connect to. The timeout error isn't really pointing me to the problem. Usually if the host isn't running an object spawner or the port is not for the workspace server, we get a different error. There is a 'timeout' key you can add to your config definition, and bump it up to see if that's really the issue. Do you have any reason to believe you would really be timed out trying to connect?
I see I don't have the 'timeout' documented??? But, it's

'timeout' : 60

that'll make the timeout 60 seconds; just specify how many seconds.

@tomweber-sas
Copy link
Contributor

the error seems to imply the host is that of the object spawner (load balancing). So I'm thinking the port number, 8593, isn't for the workspace server. It's maybe a valid port for something else, which isn't really right, but that's why it times out instead of failing? 8591 is the default port for the workspace server. You should be able to see what's defined in OMR via SMC.

@underwoodpeter
Copy link
Author

I am up and running.. we are running a Lev3 install so the port ends in a '3' vs '1' for Lev1

I ended up having to pass appserver to a workspace server I have access to- the 1st in the search list I did not have access too- we also added a grid option set to look for a saspy connection and push them to a specific queue.
thank you for all your help.

@tomweber-sas
Copy link
Contributor

Cool!, Ok, that makes sense, though I would still think the connection should have failed as opposed to timed out. But???? Hey, out of curiosity, how did you do last part (directing to a specific queue)? I expect someone else out there will want to do that too. How do you tell it's saspy making the connection? Is it the grid (or is that IOM) appname (I'm curious because I only just added setting that!) like in this log record:

2017-09-01T11:06:29,178 INFO  [00001305] 70:sastpw@CARYNT - New client connection (70) accepted from server port 8591 for IWA user sastpw@CARYNT. Encryption level is Credentials using encryption algorithm SASPROPRIETARY.  Peer IP address and port are [::ffff:10.23.16.149]:51603 for APPNAME=SASPy.

I'm not familiar w/ how you configure grid. That APPNAME=SASPy at the end is something I only just added. It's an IOM attribute, but I imagine it could be what you (whatever part of the grid config code that routes these) somehow has access to, to key off of?

Thanks!
Tom

@underwoodpeter
Copy link
Author

Yes we are using that APPNAME=SASPy (thanks for adding it) in the grid Options Set Mappings the Grid Server properties. I added screen shots to the SAS track 7612232824 I had opened as well.

@tomweber-sas
Copy link
Contributor

Awesome! BTW, checkout the 'authkey' config definition key in the IOM config section:
https://sassoftware.github.io/saspy/install.html#iom
You can store your IOM credentials in an authinfo file so you don't need to specify (or be prompted) for them. Also, in the push I did to add the IOM APPNAME=SASPy, there's an enhancement to support IWA, if that's something you have set up or want to use too.

@tomweber-sas
Copy link
Contributor

just doing some housekeeping. This was all resolved, so closing this issue. If you need anything else, let us know!

Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants