[jboss-dev-forums] [Design of POJO Server] - Re: JBAS-6061 or weird nested jar

adrian@jboss.org do-not-reply at jboss.com
Tue Oct 14 11:16:43 EDT 2008


"alesj" wrote : "adrian at jboss.org" wrote : 
  |   | It's only referenced by the VFS because the JarStructure is adding it as a
  |   | subdeployment. 
  | No, that's not the case here. ;-)
  | 
  | If you look at the actual JIRA issue,
  | you'll see that Luc has added it to server/some-as-config/lib
  | - as that's how/why conf/jboss-service.xml is able to see it in its classpath - 
  | meaning it's referenced via this piece of xml (from jboss-service.xml):
  | 
  |   | <server>
  |   | 
  |   |    <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
  |   |      can be restricted to specific jars by specifying them in the archives
  |   |      attribute.
  |   |     -->
  |   |    <classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
  |   | 
  | Being added to conf/jboss-service.xml as part of its classpath in SARDeployer::processXMLClasspath.
  | 
  | Hence the actual jar is checked/read in some CL impl details,
  | no way to add some flag and ignore it if it's broken.

Well in that case, a more generic solution would be to write a deployer
that runs in PostParse. 

It would then check that all the VFS files in getClassPath()
are valid and remove those that aren't. This would of course be an
optional deployer (not configured by default) for backwards compatiblity purposes.

Looking at the old MainDeployer, it ignored everything:


  |    private void makeLocalCopy(DeploymentInfo sdi)
  |    {
  |       try
  |       {
  |          if (sdi.url.getProtocol().equals("file") && (!copyFiles || sdi.isDirectory))
  |          {
  |             // If local copies have been disabled, do nothing
  |             sdi.localUrl = sdi.url;
  |             return;
  |          }
  |          // Are we already in the localCopyDir?
  |          else if (inLocalCopyDir(sdi.url))
  |          {
  |             sdi.localUrl = sdi.url;
  |             return;
  |          }
  |          else
  |          {
  |             String shortName = sdi.shortName;
  |             File localFile = File.createTempFile("tmp", shortName, tempDir);
  |             sdi.localUrl = localFile.toURL();
  |             copy(sdi.url, localFile);
  |          }
  |       }
  |       catch (Exception e)
  |       {
  | 
  | // HERE ignore problem and log an error
  | 
  |          log.error("Could not make local copy for " + sdi.url, e);
  |       }
  |    }
  | 

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

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



More information about the jboss-dev-forums mailing list