You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Roland Huss (JIRA)" <ji...@apache.org> on 2010/02/17 20:28:30 UTC

[jira] Created: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
----------------------------------------------------------------------------------

                 Key: ARIES-178
                 URL: https://issues.apache.org/jira/browse/ARIES-178
             Project: Aries
          Issue Type: Bug
          Components: JMX
    Affects Versions: Incubation
            Reporter: Roland Huss


Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)

Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
        at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
        at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
        at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
        at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
        at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
        ...

The original reason for this is that Felix returns multiple identical ExportedPackage when calling

ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)

(in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.

Please find attachted a patch to add equals() and hashCode() to PackageData.

My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

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

Adam Wojtuniak resolved ARIES-178.
----------------------------------

    Resolution: Fixed

Fixed

> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>            Assignee: Adam Wojtuniak
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

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

Adam Wojtuniak reassigned ARIES-178:
------------------------------------

    Assignee: Adam Wojtuniak

> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>            Assignee: Adam Wojtuniak
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

Posted by "Roland Huss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834964#action_12834964 ] 

Roland Huss commented on ARIES-178:
-----------------------------------

BTW, the reason that org.springframework.ws.soap.addressing.server is contained twice is connected to
the fragment spring-ws-core-tiger-1.5.9.jar (also installed) which overwrites certain packages in spring-ws-core.1.5.9.jar:

[osgi] : ls *ws.core*
  Id   State       Lev Name
---------------------------------------------------------------------------------------
  41   Active        5 Spring WS Core (1.5.9)
 277   Installed     1 Spring WS Core - Java 5 (1.5.9)
[osgi] : ls 277
Name:          277 Spring WS Core - Java 5
               org.springframework.bundle.ws.core-tiger [Installed]
Location:      file:///Users/roland/.m2/repository/org/springframework/ws/spring-ws-core-tiger/1.5.9/spring-ws-core-tiger-1.5.9.jar

Imports:       javax.xml.namespace 
               javax.xml.transform 
               javax.xml.transform.dom 
               javax.xml.xpath  * 
               org.apache.commons.logging 
               org.springframework.aop.support [2.0,4.0)
               org.springframework.beans [2.0,4.0)
               org.springframework.beans.factory [2.0,4.0)
               org.springframework.beans.factory.config [2.0,4.0)
               org.springframework.context [2.0,4.0)
               org.springframework.core.annotation [2.0,4.0)
               org.springframework.oxm [1.5.9,1.5.9]
               org.springframework.stereotype [2.0,4.0)
               org.springframework.util [2.0,4.0)
               org.springframework.ws [1.5.9,1.5.9]
               org.springframework.ws.context [1.5.9,1.5.9]
               org.springframework.ws.server [1.5.9,1.5.9]
               org.springframework.ws.server.endpoint [1.5.9,1.5.9]
               org.springframework.ws.server.endpoint.adapter [1.5.9,1.5.9]
               org.springframework.ws.server.endpoint.annotation [1.5.9,1.5.9]
               org.springframework.ws.server.endpoint.mapping [1.5.9,1.5.9]
               org.springframework.ws.server.endpoint.support [1.5.9,1.5.9]
               org.springframework.ws.soap [1.5.9,1.5.9]
               org.springframework.ws.soap.addressing.core [1.5.9,1.5.9]
               org.springframework.ws.soap.addressing.server [1.5.9,1.5.9]
               org.springframework.ws.soap.addressing.server.annotation [1.5.9,1.5.9]
               org.springframework.ws.soap.server [1.5.9,1.5.9]
               org.springframework.ws.soap.server.endpoint [1.5.9,1.5.9]
               org.springframework.ws.soap.server.endpoint.annotation [1.5.9,1.5.9]
               org.springframework.ws.soap.server.endpoint.mapping [1.5.9,1.5.9]
               org.springframework.xml.namespace [1.5.9,1.5.9]
               org.w3c.dom 
[osgi] : 

> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835326#action_12835326 ] 

Alasdair Nottingham commented on ARIES-178:
-------------------------------------------

The OSGi spec allows you to export the same package multiple times. 

I believe ARIES-146 is a dupe of this and it was found on equinox, so this isn't felix specific if they really are dupes.

> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

Posted by "Adam Wojtuniak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834995#action_12834995 ] 

Adam Wojtuniak commented on ARIES-178:
--------------------------------------

Hi Roland

All the values in CompositeData need to be uinque so it's no harm to override equals and hashcode in PackageData.
Iam going to apply your patch in a couple minutes. I checked docs of PackageAdmin but there is nothing mentioned about
uniqeness of ExportedPackages. So probably there is no bug in Felix but you can check that on Felix mailing list.

Thanks for the patch.
Regards,
Adam 


> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ARIES-178) PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3

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

Roland Huss updated ARIES-178:
------------------------------

    Attachment: patch.txt

> PackageMBean.listPackages() raises an exception for certain bundles in Felix 2.0.3
> ----------------------------------------------------------------------------------
>
>                 Key: ARIES-178
>                 URL: https://issues.apache.org/jira/browse/ARIES-178
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: Incubation
>            Reporter: Roland Huss
>         Attachments: patch.txt
>
>
> Using PackageStateMBean.listPackages() gives the following exception on Felix 2.0.3 for certain bundles (here: spring-ws-core-1.5.9.jar)
> Caused by: javax.management.openmbean.KeyAlreadyExistsException: Argument value's index, calculated according to this TabularData instance's tabularType, already refers to a value in this table.
>         at javax.management.openmbean.TabularDataSupport.checkValueAndIndex(TabularDataSupport.java:871)
>         at javax.management.openmbean.TabularDataSupport.internalPut(TabularDataSupport.java:331)
>         at javax.management.openmbean.TabularDataSupport.put(TabularDataSupport.java:323)
>         at org.apache.aries.jmx.codec.PackageData.tableFrom(PackageData.java:142)
>         at org.apache.aries.jmx.framework.PackageState.listPackages(PackageState.java:130)
>         ...
> The original reason for this is that Felix returns multiple identical ExportedPackage when calling
> ExportedPackage[]  PackageAdmin.getExportedPackages(bundle)
> (in this example, org.springframework.ws.soap.addressing.server; version=1.5.9 is given twice)
> I don't know whether this is allowed by the Spec (or is in fact a bug in Felix), but Aries could be smarter here anyway.
> Since each ExportedPackage is wrapped in a PackageData for JMX-Export and then added to a Set<PackageData> all
> what is needed to add appropriate equals() and hashCode() to PackageData to make the set contain only PackageData
> with a unique index (NAME, VERSION, EXPORTING_BUNDLE) for the TabularData to build up for the JMX return value.
> Please find attachted a patch to add equals() and hashCode() to PackageData.
> My question though is, whether this an allowed behaviour of Felix to return same ExportedPackage objects multiple times 
> in getExportedPackages() (so that in case I could rise an issue for Felix as well).  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.