5 Replies Latest reply on Jul 4, 2007 9:02 PM by jwiegley

    Adding .jar files to the classpath of a webapp

    jwiegley

      Hello, I'm building an .EAR file (using IDEA) that contains several .jar files in it. One of these .jar files contains classes that I need to be visible to Jython running inside a webapp (which is also packaged within the .war). To summarize:

      FOO.EAR:
      BAR.JAR
      BAZ.WAR:
      myclass.class <- uses org.python.core.imp.import
      to load in a myscript.py file.
      myscript.py does "import bar.type"

      At the point when my web application gets to the "import bar.type" command in myscript.py in myclass.class within the .WAR, I get a long exception saying "module bar not found".

      Module bar is inside BAR.JAR, which is being packaged in my .EAR. Apparently, this BAR.JAR is not being added to the classpath of my webapplication -- or it's not being passed down to Jython somehow.

      How do I setup the classpath? Is it already being setup and I need to be looking at migrating it down to Jython?

      I've looked everyone on Google for every combination of terms I can think of. So now I came to you all in frustration; help! :)

      Thank you, John