[jboss-jira] [JBoss JIRA] Commented: (JBAS-7614) Implementing PrefixDeploymentSorter feature in JBoss5.

Daniel Straub (JIRA) jira-events at lists.jboss.org
Sat Apr 17 15:06:49 EDT 2010


    [ https://jira.jboss.org/jira/browse/JBAS-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526314#action_12526314 ] 

Daniel Straub commented on JBAS-7614:
-------------------------------------

I added the LegacyPrefixDeploymentContextComparator to a jboss-5.1.0 instance and modifed bootstrap/deployers.xml.
It's works for simple jar, but throws an NPE by an deployment of  ear with many jars.

Caused by: java.lang.NullPointerException
	at org.jboss.system.deployers.LegacyDeploymentContextComparator.getContextOrder(LegacyDeploymentContextComparator.java:103)
	at org.jboss.system.deployers.LegacyDeploymentContextComparator.compare(LegacyDeploymentContextComparator.java:85)
	at org.jboss.system.deployers.LegacyDeploymentContextComparator.compare(LegacyDeploymentContextComparator.java:37)
	at java.util.TreeMap.put(TreeMap.java:530)
	at java.util.TreeSet.add(TreeSet.java:238)
	at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.addChild(AbstractDeploymentContext.java:677)
	at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:138)

I found the reason in org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.applyComparator.
A instance of the LegacyDeploymentContextComparator is created whose "create"-method isn't called.
         if (o == null)
            o = clazz.newInstance();
         Comparator comparator = Comparator.class.cast(o);
         context.setComparator(comparator);

As workaround, I added also the LegacyDeploymentContextComparator in bootstrap/deployers.xml like this :

  <!-- use legacy ordering -->
   <bean name="topContextComparator">
     <constructor factoryClass="org.jboss.system.deployers.LegacyPrefixDeploymentContextComparator" factoryMethod="getInstance"/>
   </bean>

   <bean name="otherContextComparator">
     <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
   </bean>

so we have the singelton instance whose "create"-Method was called during the lifecycle.


> Implementing PrefixDeploymentSorter feature in JBoss5.
> ------------------------------------------------------
>
>                 Key: JBAS-7614
>                 URL: https://jira.jboss.org/jira/browse/JBAS-7614
>             Project: JBoss Application Server
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Deployers
>    Affects Versions: JBossAS-5.0.1.GA, JBossAS-5.1.0.GA
>            Reporter: Vicky Kak
>            Assignee: Mike Clark
>             Fix For: JBossAS-6.0.0.M2
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list