[jboss-user] [JBoss/Spring Integration] - Re: JBoss5/Spring deployment problem

alesj do-not-reply at jboss.com
Fri Oct 10 05:11:04 EDT 2008


"Herman06" wrote : Have I done something wrong in the Jboss 5 deployment?
  | 
No. :-)
I changed how the jndi name is constructed.
See SpringParserDeployer:

  |    /**
  |     * Get default name from meta file.
  |     *
  |     * @param file the virtual file
  |     * @return default name
  |     */
  |    protected String getDefaultName(VirtualFile file)
  |    {
  |       String shortName = file.getName();
  |       int p = shortName.indexOf("-spring.xml");
  |       return shortName.substring(0, p);
  |    }
  | 
  |    /**
  |     * Get default name from unit.
  |     *
  |     * @param unit the deployment unit
  |     * @return default name
  |     */
  |    protected String getDefaultName(VFSDeploymentUnit unit)
  |    {
  |       String shortName = unit.getSimpleName();
  |       int p = shortName.lastIndexOf(".");
  |       return shortName.substring(0, p);
  |    }
  | 
  |    protected SpringMetaData parse(VFSDeploymentUnit unit, VirtualFile file, SpringMetaData metaData) throws Exception
  |    {
  |       String defaultName;
  |       if (isUseLegacyDefaultName())
  |          defaultName = getDefaultName(unit);
  |       else
  |          defaultName = getDefaultName(file);
  | 
  |       return new SpringMetaData(file.toURL(), defaultName);
  |    }
  | 
By default we don't use deployment unit's name, but rather .xml file's.
This way you can now have multiple -spring.xml files in the same deployment.

But if you want the old behavior, turn on the 'useLegacyDefaultName' flag. ;-)

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

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



More information about the jboss-user mailing list