-
1. Re: jboss-cli-client.jar and jython
alessandro.fioretti_gmx.com Jan 15, 2014 5:28 AM (in response to alessandro.fioretti_gmx.com)Solved!
The problem was how I was loading jython.
Using java -jar jython.2.5.3.jar -Djava.class.path="./jboss-cli-client.jar:." the jboss-cli-client.jar is not loaded into CLASSPATH so the Java ClassLoader does not find all classes needed for execution.
To properly load Java jars into jython we must run it as follows:
java -cp "/home/jboss/jython.2.5.3.jar:/home/jboss/jboss-cli-client.jar:.:${CLASSPATH}" org.python.util.jython
In this way I'm able to connect to JBoss:
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_45
Type "help", "copyright", "credits" or "license" for more information.
>>> from java.util import Date
>>> from org.jboss.as.cli.scriptsupport import CLI
>>> cli = CLI.newInstance()
>>> cli.connect("localhost.localdomain", 9999, "user", "pwd")
WARN: can't find jboss-cli.xml. Using default configuration values.
>>>
I hope it's help.
Alessandro.
-
2. Re: jboss-cli-client.jar and jython
gnik9 Jul 20, 2016 3:33 PM (in response to alessandro.fioretti_gmx.com)I was facing the same issue.. cool.. works now.
Thanks Alessandro.