Code Monkey home page Code Monkey logo

Comments (8)

tomweber-sas avatar tomweber-sas commented on August 14, 2024 1

@torstendahlen are you up and running? We can close this if so. Unless you have other questions or issues.

Thanks,
Tom

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on August 14, 2024

Hey, this is because 'java' isn't being found. See it in the troubleshooting guide here: https://sassoftware.github.io/saspy/troubleshooting.html#java-problems

So java.exe isnt' in your Path variable, do it's not being found. If you specify the full path to it in yout configuration definition for the java key, that will solve this:

'java' : 'C:\Wherever\java\is\java.exe',

Tom

from sas_kernel.

torstendahlen avatar torstendahlen commented on August 14, 2024

Thanks for your prompt answer Tom!

However, I still cannot get this to work. Using saspy i can create a connection using 'java' as only path:

sas = saspy.SASsession(cfgname='winlocal', results='HTML', java='java')
​
​The SAS Config name specified was not found. Please enter the SAS Config you wish to use. Available Configs are: ['autogen_winlocal'] autogen_winlocal
SAS Connection established. Subprocess id is 9660

However, using the sas_kernel in JN instead of python kernel I get:

proc print data=sashelp.cars;run;
The OS Error was:
The system cannot find the file specified

SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Attempted to run program javaC:\Program Files (x86)\Java\jre1.8.0_25in\java.exe with the following parameters:['javaC:\Program Files (x86)\Java\jre1.8.0_251\x08in\java.exe', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar;H:\anaconda\lib\site-packages\saspy\java\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '50602', '-stdoutport', '50603', '-stderrport', '50604', '-zero', '-lrecl', '1048576', '']

If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong:
javaC:\Program Files (x86)\Java\jre1.8.0_25in\java.exe -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94518__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar;H:\anaconda\lib\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 50602 -stdoutport 50603 -stderrport 50604 -zero -lrecl 1048576

No SAS process attached. SAS process has terminated unexpectedly.
Invalid response from SAS on inital submission. printing the SASLOG as diagnostic

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on August 14, 2024

Hmm, Can I see your config file? It looks like you may need to be using double quotes, since your on windows. The path for java isn't right.

from sas_kernel.

torstendahlen avatar torstendahlen commented on August 14, 2024

Ok, here are my different versions that I have tried. Java is in my path statement, "echo %path%" and I can write 'call cmd.exe java'.

sascfg_personal _java_path.txt
sascfg_personal _standalone_java_path.txt
sascfg_personal_autogen_java.txt
sascfg_personal_original.txt

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on August 14, 2024

Hey, sorry, I said 'double quotes' above, but I was thinking (trying to say) double backslashes. In windows, a slash followed by a handful of other charters are considered escape sequences; If you notice the classpaths in your files all have '\\' between the directories but in the path you specified for java, you have single slashes '\'. You need to double them up, the '\bin' in the the path, in the error posted up above, was turned into a baskspace (0x08) instead of backslash, letter b.

:\Program Files (x86)\Java\jre1.8.0_25in\java.exe with the following parameters:['javaC:\Program Files (x86)\Java\jre1.8.0_251\x08in\java.exe

So, the error is still because it can't find java.exe, as the full path, now isn't correct because of that. I see you use Anaconda. As far as java.exe being in your system path or not, anaconda has its own environments, which don't always equal window's environments. You can see the different by looking at your environment between a windows CMD prompt and an Anaconda Prompt terminal windows. So, depending on how/where/which anaconda environment your python process is running in, your environment (and what python modules are available) can vary.

One other thing, is that as of saspy V3.3.3, you no longer need the classpath in your config file. So, you can get rid of all of that too. The 4 jars that are the IOM Client code are finally in the saspy repo, so you don't need to specify where they are.

If you double up the backslashes (or prefix the string w/ an 'r' - raw string), and get rid of the class path you should be up and running. And, either Java out to work; I see you pointed at 2. Just put in the full path and that should take care of it.

Here's a (minimum) config that ought to work for you. You can use either java, and one shows r'path\path\' and the other 'path\\path\\'

SAS_config_names=["winlocal"]
winlocal = {
	"java"      : "C:\\Program Files (x86)\\Java\\jre1.8.0_251\\bin\\java.exe",
	# "java"      : r"C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java.exe",
	"encoding"  : "windows-1252",
	}
import os
os.environ["PATH"] += ";C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sasext"

Sorry for the confusion,
Tom

from sas_kernel.

torstendahlen avatar torstendahlen commented on August 14, 2024

Thanks ! Sorry, it has benen resolved!

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on August 14, 2024

Oh, great. I'll go ahead and close this then. Just let us know if you need anything else!

Thanks,
Tom

from sas_kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.