From: Diez B. R. <de...@we...> - 2006-10-22 09:04:50
|
> I tried to add my jython files to my AS(Jboss), so I can execute them=20 > using PythonInterpeter like this: >=20 > =20 >=20 > 1.PythonInterpreter interp =3D *new* PythonInterpreter(); >=20 > 2.interp.exec("import sys"); >=20 > 3.interp.exec("sys.path.append('C:\\Program Files\\jboss-4.0.4.GA')");=20 > // show where the jython file is >=20 > 4.interp.exec("import files"); // import it >=20 > 5.interp.exec("files.write_to_file('/temp/aaa.txt' ,2,1)"); //=20 > activate it >=20 > =20 >=20 > =20 >=20 > The problem is that I have to specify all the time where the jython fil= e=20 > located (like I did in line =96 3) >=20 > =20 >=20 > Do you know a better way? >=20 > 1. maybe I can add it to the EAR some how. > 2. maybe I can dictate using environmental variable where it is and > so on=85.. use ClassLoader.getResourceAsStream. It can locate files deployed in a=20 jar/ear. Diez |