[jboss-dev-forums] [Design of POJO Server] - Re: Scoping of war/jar file embedded in sar service archives

adrian@jboss.org do-not-reply at jboss.com
Wed Jul 16 09:21:43 EDT 2008


Looks to me like you didn't build the jar in the testsuite, the line in error
is for when it doesn't find the file.

JBossTestServices is trying to create a url for
c:\foo\bar\jboss-head\testsuite\output\lib\whatever.jar
and obviously getting confused. ;-)
It should be creating the url as
file:///c:/foo/bar/jboss-head/testsuite/output/lib/whatever.jar


  | 
  |    /**
  |     * Returns the deployment directory to use. This does it's best to figure out
  |     * where you are looking. If you supply a complete url, it returns it.
  |     * Otherwise, it looks for jbosstest.deploy.dir or if missing output/lib. Then it
  |     * tries to construct a file url or a url.
  |     *
  |     * @param filename                   name of the file/url you want
  |     * @return                           A URL
  |     * @exception MalformedURLException  Description of Exception
  |     */
  |    protected URL getDeployURL(final String filename)
  |       throws MalformedURLException
  |    {
  |       // First see if it is already a complete url.
  |       try
  |       {
  |          return new URL(filename);
  |       }
  |       catch (MalformedURLException e)
  |       {
  |          log.debug(filename + " is not a valid URL, " + e.getMessage());
  |       }
  | 
  |       // OK, lets see if we can figure out what it might be.
  |       String deployDir = System.getProperty("jbosstest.deploy.dir");
  |       if (deployDir == null)
  |       {
  |          deployDir = "output/lib";
  |       }
  |       String url = deployDir + "/" + filename;
  |       log.debug("Testing file: " + url);
  |       // try to canonicalize the strings a bit.
  |       File file = new File(url);
  |       if (file.exists())
  |       {
  |          log.debug(file.getAbsolutePath() + " is a valid file");
  |          return file.toURL();
  |       }
  |       else
  |       {
  |          log.debug("File does not exist, creating url: " + url);
  |          return new URL(url); // HERE !!!!!!!!!!!!!!!!!!!!!!!!
  |       }
  |    }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164747#4164747

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164747



More information about the jboss-dev-forums mailing list