0 Replies Latest reply on Jun 7, 2011 8:01 AM by Praveen Kumar Kota

    Python with JBoss

    Praveen Kumar Kota Newbie

      Hello Everyone,

       

      We have used Java and Python scripts in our application and after deploying and executing the application, noticed the following error related to Python script as it is unable to load the jar files:

       

      ERROR nl.contrado.testmanager.TestmanagerServlet - Exception during execution of Pythonscript c:/dev/OFM-HEAD/tmscripts/stubs/orderintake/main.py
      Traceback (innermost last):
        File "c:/dev/OFM-HEAD/tmscripts/stubs/orderintake/main.py", line 12, in ?
        File "c:/dev/OFM-HEAD/tmscripts/stubs/config.py", line 1, in ?
      ImportError: No module named log4j

              at org.python.core.Py.ImportError(Py.java)
              at org.python.core.imp.import_logic(imp.java)
              at org.python.core.imp.import_name(imp.java)
              at org.python.core.imp.importName(imp.java)
              at org.python.core.ImportFunction.load(__builtin__.java)
              at org.python.core.ImportFunction.__call__(__builtin__.java)
              at org.python.core.PyObject.__call__(PyObject.java)
              at org.python.core.__builtin__.__import__(__builtin__.java)
              at org.python.core.imp.importFromAs(imp.java)
              at org.python.core.imp.importFrom(imp.java)
              at org.python.pycode._pyx7.f$0(c:/dev/OFM-HEAD/tmscripts/stubs/config.py:1)
              at org.python.pycode._pyx7.call_function(c:/dev/OFM-HEAD/tmscripts/stubs/config.py)
              at org.python.core.PyTableCode.call(PyTableCode.java)
              at org.python.core.PyCode.call(PyCode.java)
              at org.python.core.Py.runCode(Py.java)
              at org.python.core.__builtin__.execfile_flags(__builtin__.java)
              at org.python.core.__builtin__.execfile(__builtin__.java)
              at org.python.core.__builtin__.execfile(__builtin__.java)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
              at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
              at org.python.core.PyObject.__call__(PyObject.java)
              at org.python.pycode._pyx6.f$0(c:/dev/OFM-HEAD/tmscripts/stubs/orderintake/main.py:12)
              at org.python.pycode._pyx6.call_function(c:/dev/OFM-HEAD/tmscripts/stubs/orderintake/main.py)
              at org.python.core.PyTableCode.call(PyTableCode.java)
              at org.python.core.PyCode.call(PyCode.java)
              at org.python.core.Py.runCode(Py.java)
              at org.python.core.__builtin__.execfile_flags(__builtin__.java)
              at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
              at nl.contrado.testmanager.TestmanagerServlet.doGet(TestmanagerServlet.java:98)
              at nl.contrado.testmanager.TestmanagerServlet.doPost(TestmanagerServlet.java:37)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:662)

       

      From the above, stack trace, I assume that, JBoss is unable to load the jar files from the specified path from the python script.

       

      Actually, the application was being deployed on oc4j and we havent' made any specific installations related to Python and now as part of migration we were asked to use JBoss by our client. May I know, if JBoss supports Python and if yes, do I need to install the Python and set the classpath and etc.

       

      Could you please provide me with the steps to install and set the path and etc.

       

      Please do the needful.

       

      Thanks and Regards,

      Praveen Kumar K