You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Bernd Köcke <be...@1und1.de.INVALID> on 2024/04/24 14:33:08 UTC

ClassCastException in ConfigurationUtils.getHAPolicy

Hello,

I'm using WildFly which uses Artemis as JMS provider. With WF 31 they 
updated to Artemis 2.31.2. In this version the new 
PrimaryOnlyPolicyConfiguration appeared. The getType method of 
LiveOnlyPolicyConfiguration was changed and returns the enum from 
PrimaryOnly. But in class ConfigurationUtils, method getHAPolicy checks 
this enum and casts the given object to PrimaryOnlyPolicyConfiguration. 
But if this is a LiveOnlyPolicyConfiguration, this code throws a 
ClassCastException.

I think this is a kind of bug. If LiveOnlyPolicyConfiguration returns 
the enum from PrimaryOnly, the config utility class should not try to 
cast unconditionally to PrimaryOnlyPolicyConfiguration. This can't work. 
Do you also think this is a bug?

But I may be wrong and WildFly uses an old way to configure Artemis and 
therefore I also posted this in the WildFly Google group.

Regards
Bernd
-- 
Dipl.-Inform. Bernd Köcke

Expert Middleware Technologies
Cloud & Platform Services

1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe | 
Deutschland
Phone: +49 721 91374-4583
E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963

Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal 
Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
Aufsichtsratsvorsitzender: Ralf Hartings

Member of United Internet

Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte 
Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat 
sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte 
den Absender und vernichten Sie diese E-Mail. Anderen als dem 
bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern, 
weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient of this e-mail, you are hereby 
notified that saving, distribution or use of the content of this e-mail 
in any way is prohibited. If you have received this e-mail in error, 
please notify the sender and delete the e-mail.

Re: ClassCastException in ConfigurationUtils.getHAPolicy

Posted by Bernd Köcke <be...@1und1.de.INVALID>.
Hello Justin,

I saw the announcement for Artemis 2.34.0 and the fix for the migration 
from LiveOnly to PrimaryOnly. Thank you very much for your support.

Regards,
Bernd

Am 03.05.24 um 08:34 schrieb Bernd Köcke:
> Hello Justin,
> 
> thanks a lot for the ticket and your work!
> 
> Regards
> Bernd
> 
> Am 03.05.24 um 06:54 schrieb Justin Bertram:
>> I opened ARTEMIS-4759 [1] to deal with this and sent a PR. Thanks for the
>> report!
>>
>>
>> Justin
>>
>> [1] https://issues.apache.org/jira/browse/ARTEMIS-4759
>>
>> On Wed, Apr 24, 2024 at 9:33 AM Bernd Köcke 
>> <be...@1und1.de.invalid>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm using WildFly which uses Artemis as JMS provider. With WF 31 they
>>> updated to Artemis 2.31.2. In this version the new
>>> PrimaryOnlyPolicyConfiguration appeared. The getType method of
>>> LiveOnlyPolicyConfiguration was changed and returns the enum from
>>> PrimaryOnly. But in class ConfigurationUtils, method getHAPolicy checks
>>> this enum and casts the given object to PrimaryOnlyPolicyConfiguration.
>>> But if this is a LiveOnlyPolicyConfiguration, this code throws a
>>> ClassCastException.
>>>
>>> I think this is a kind of bug. If LiveOnlyPolicyConfiguration returns
>>> the enum from PrimaryOnly, the config utility class should not try to
>>> cast unconditionally to PrimaryOnlyPolicyConfiguration. This can't work.
>>> Do you also think this is a bug?
>>>
>>> But I may be wrong and WildFly uses an old way to configure Artemis and
>>> therefore I also posted this in the WildFly Google group.
>>>
>>> Regards
>>> Bernd
>>> -- 
>>> Dipl.-Inform. Bernd Köcke
>>>
>>> Expert Middleware Technologies
>>> Cloud & Platform Services
>>>
>>> 1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe |
>>> Deutschland
>>> Phone: +49 721 91374-4583
>>> E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de
>>>
>>> Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963
>>>
>>> Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal
>>> Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
>>> Aufsichtsratsvorsitzender: Ralf Hartings
>>>
>>> Member of United Internet
>>>
>>> Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte
>>> Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat
>>> sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte
>>> den Absender und vernichten Sie diese E-Mail. Anderen als dem
>>> bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern,
>>> weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu 
>>> verwenden.
>>>
>>> This e-mail may contain confidential and/or privileged information. If
>>> you are not the intended recipient of this e-mail, you are hereby
>>> notified that saving, distribution or use of the content of this e-mail
>>> in any way is prohibited. If you have received this e-mail in error,
>>> please notify the sender and delete the e-mail.
>>>
>>>
>>
> 

-- 
Dipl.-Inform. Bernd Köcke

Expert Middleware Technologies
Cloud & Platform Services

1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe | 
Deutschland
Phone: +49 721 91374-4583
E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963

Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal 
Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
Aufsichtsratsvorsitzender: Ralf Hartings

Member of United Internet

Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte 
Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat 
sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte 
den Absender und vernichten Sie diese E-Mail. Anderen als dem 
bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern, 
weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient of this e-mail, you are hereby 
notified that saving, distribution or use of the content of this e-mail 
in any way is prohibited. If you have received this e-mail in error, 
please notify the sender and delete the e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@activemq.apache.org
For additional commands, e-mail: users-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: ClassCastException in ConfigurationUtils.getHAPolicy

Posted by Bernd Köcke <be...@1und1.de.INVALID>.
Hello Justin,

thanks a lot for the ticket and your work!

Regards
Bernd

Am 03.05.24 um 06:54 schrieb Justin Bertram:
> I opened ARTEMIS-4759 [1] to deal with this and sent a PR. Thanks for the
> report!
> 
> 
> Justin
> 
> [1] https://issues.apache.org/jira/browse/ARTEMIS-4759
> 
> On Wed, Apr 24, 2024 at 9:33 AM Bernd Köcke <be...@1und1.de.invalid>
> wrote:
> 
>> Hello,
>>
>> I'm using WildFly which uses Artemis as JMS provider. With WF 31 they
>> updated to Artemis 2.31.2. In this version the new
>> PrimaryOnlyPolicyConfiguration appeared. The getType method of
>> LiveOnlyPolicyConfiguration was changed and returns the enum from
>> PrimaryOnly. But in class ConfigurationUtils, method getHAPolicy checks
>> this enum and casts the given object to PrimaryOnlyPolicyConfiguration.
>> But if this is a LiveOnlyPolicyConfiguration, this code throws a
>> ClassCastException.
>>
>> I think this is a kind of bug. If LiveOnlyPolicyConfiguration returns
>> the enum from PrimaryOnly, the config utility class should not try to
>> cast unconditionally to PrimaryOnlyPolicyConfiguration. This can't work.
>> Do you also think this is a bug?
>>
>> But I may be wrong and WildFly uses an old way to configure Artemis and
>> therefore I also posted this in the WildFly Google group.
>>
>> Regards
>> Bernd
>> --
>> Dipl.-Inform. Bernd Köcke
>>
>> Expert Middleware Technologies
>> Cloud & Platform Services
>>
>> 1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe |
>> Deutschland
>> Phone: +49 721 91374-4583
>> E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de
>>
>> Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963
>>
>> Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal
>> Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
>> Aufsichtsratsvorsitzender: Ralf Hartings
>>
>> Member of United Internet
>>
>> Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte
>> Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat
>> sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte
>> den Absender und vernichten Sie diese E-Mail. Anderen als dem
>> bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern,
>> weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.
>>
>> This e-mail may contain confidential and/or privileged information. If
>> you are not the intended recipient of this e-mail, you are hereby
>> notified that saving, distribution or use of the content of this e-mail
>> in any way is prohibited. If you have received this e-mail in error,
>> please notify the sender and delete the e-mail.
>>
>>
> 

-- 
Dipl.-Inform. Bernd Köcke

Expert Middleware Technologies
Cloud & Platform Services

1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe | 
Deutschland
Phone: +49 721 91374-4583
E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963

Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal 
Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
Aufsichtsratsvorsitzender: Ralf Hartings

Member of United Internet

Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte 
Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat 
sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte 
den Absender und vernichten Sie diese E-Mail. Anderen als dem 
bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern, 
weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient of this e-mail, you are hereby 
notified that saving, distribution or use of the content of this e-mail 
in any way is prohibited. If you have received this e-mail in error, 
please notify the sender and delete the e-mail.

Re: ClassCastException in ConfigurationUtils.getHAPolicy

Posted by Justin Bertram <jb...@apache.org>.
I opened ARTEMIS-4759 [1] to deal with this and sent a PR. Thanks for the
report!


Justin

[1] https://issues.apache.org/jira/browse/ARTEMIS-4759

On Wed, Apr 24, 2024 at 9:33 AM Bernd Köcke <be...@1und1.de.invalid>
wrote:

> Hello,
>
> I'm using WildFly which uses Artemis as JMS provider. With WF 31 they
> updated to Artemis 2.31.2. In this version the new
> PrimaryOnlyPolicyConfiguration appeared. The getType method of
> LiveOnlyPolicyConfiguration was changed and returns the enum from
> PrimaryOnly. But in class ConfigurationUtils, method getHAPolicy checks
> this enum and casts the given object to PrimaryOnlyPolicyConfiguration.
> But if this is a LiveOnlyPolicyConfiguration, this code throws a
> ClassCastException.
>
> I think this is a kind of bug. If LiveOnlyPolicyConfiguration returns
> the enum from PrimaryOnly, the config utility class should not try to
> cast unconditionally to PrimaryOnlyPolicyConfiguration. This can't work.
> Do you also think this is a bug?
>
> But I may be wrong and WildFly uses an old way to configure Artemis and
> therefore I also posted this in the WildFly Google group.
>
> Regards
> Bernd
> --
> Dipl.-Inform. Bernd Köcke
>
> Expert Middleware Technologies
> Cloud & Platform Services
>
> 1&1 Telecommunication SE | Hinterm Hauptbahnhof 3 | 76137 Karlsruhe |
> Deutschland
> Phone: +49 721 91374-4583
> E-Mail: bernd.koecke@1und1.de | Web: www.1und1.de
>
> Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 23963
>
> Vorstand: Christian Bockelt, Cretièn Brandsma, Sascha D'Avis, Dr. Pascal
> Grieder, Thomas Henkel, Markus Huhn, Michael Martin, Alessandro Nava
> Aufsichtsratsvorsitzender: Ralf Hartings
>
> Member of United Internet
>
> Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte
> Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat
> sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte
> den Absender und vernichten Sie diese E-Mail. Anderen als dem
> bestimmungsgemäßen Adressaten ist untersagt, diese E-Mail zu speichern,
> weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.
>
> This e-mail may contain confidential and/or privileged information. If
> you are not the intended recipient of this e-mail, you are hereby
> notified that saving, distribution or use of the content of this e-mail
> in any way is prohibited. If you have received this e-mail in error,
> please notify the sender and delete the e-mail.
>
>