You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Darryl L. Miles (JIRA)" <ji...@apache.org> on 2012/04/21 16:54:32 UTC

[jira] [Created] (WICKET-4508) Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util

Darryl L. Miles created WICKET-4508:
---------------------------------------

             Summary: Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util
                 Key: WICKET-4508
                 URL: https://issues.apache.org/jira/browse/WICKET-4508
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.5
            Reporter: Darryl L. Miles


Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util


The Maven wicket-util JAR has one or more *.class files in the same package as another JAR.

wicket-core has org/apache/wicket/Application.class (1 file listed of 79)
wicket-util has org/apache/wicket/IClusterable.class (1 file listed of 1)

This is not allowed by standard Java ClassLoading rules.  The ClassLoader has the right to stop searching to remainder of the CLASSPATH once it finds the first CLASSPATH entry to contain one or more file resources inside a package.  That CLASSPATH entry can then be considered authoritative for that package.

The specification allows for a ClassLoader implemented to perform an exhaustive search of all CLASSPATH entries (if it wants) but it is not a requirement.  So in this way you need to specialized ClassLoader in order to see 1 package split across multiple JARs.

It is better for all Java projects to produce redistributes / binary releases that are are compatible as possible with the Java ecosystem.

This issue is also a violation of OSGi packaging principals.  If you happen to care about OSGi.


Possible Solution:

1) Ensure the org/apache/wicket/IClusterable.class file is put into the wicket-core Maven module.


2) Change the package that IClusterable belongs, maybe org/apache/wicket/serialize/IClusterable.class would be a good choice.  But I'd guess this breaks backwards compatibility.


It maybe worth investigating why org/apache/wicket/serialize/ISerializer.class is also in wicket-util as I think this also would be better moved into wicket-core.  However this is not causing any harm that I can see as no other JAR I have checked contains one or more file resources in the package org/apache/wicket/serialize.  There is a package called org/apache/wicket/serialize/java in wicket-core but that does not count for the purpose of this rule.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (WICKET-4508) Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util

Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier closed WICKET-4508.
------------------------------

    Resolution: Duplicate

See WICKET-4438
                
> Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4508
>                 URL: https://issues.apache.org/jira/browse/WICKET-4508
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>            Reporter: Darryl L. Miles
>              Labels: packaging
>
> Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util
> The Maven wicket-util JAR has one or more *.class files in the same package as another JAR.
> wicket-core has org/apache/wicket/Application.class (1 file listed of 79)
> wicket-util has org/apache/wicket/IClusterable.class (1 file listed of 1)
> This is not allowed by standard Java ClassLoading rules.  The ClassLoader has the right to stop searching to remainder of the CLASSPATH once it finds the first CLASSPATH entry to contain one or more file resources inside a package.  That CLASSPATH entry can then be considered authoritative for that package.
> The specification allows for a ClassLoader implemented to perform an exhaustive search of all CLASSPATH entries (if it wants) but it is not a requirement.  So in this way you need to specialized ClassLoader in order to see 1 package split across multiple JARs.
> It is better for all Java projects to produce redistributes / binary releases that are are compatible as possible with the Java ecosystem.
> This issue is also a violation of OSGi packaging principals.  If you happen to care about OSGi.
> Possible Solution:
> 1) Ensure the org/apache/wicket/IClusterable.class file is put into the wicket-core Maven module.
> 2) Change the package that IClusterable belongs, maybe org/apache/wicket/serialize/IClusterable.class would be a good choice.  But I'd guess this breaks backwards compatibility.
> It maybe worth investigating why org/apache/wicket/serialize/ISerializer.class is also in wicket-util as I think this also would be better moved into wicket-core.  However this is not causing any harm that I can see as no other JAR I have checked contains one or more file resources in the package org/apache/wicket/serialize.  There is a package called org/apache/wicket/serialize/java in wicket-core but that does not count for the purpose of this rule.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira