Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not know how to anonymize type 'UK_POST_CODE'. #168

Open
szhorvath opened this issue Jun 26, 2022 · 3 comments
Open

Do not know how to anonymize type 'UK_POST_CODE'. #168

szhorvath opened this issue Jun 26, 2022 · 3 comments

Comments

@szhorvath
Copy link

Hi,

When I try to use the UK postcode anonymizer I get this error:

Exception in thread "main" java.lang.RuntimeException: java.lang.UnsupportedOperationException: Do not know how to anonymize type 'UK_POST_CODE'.

Any idea what I am doing wrong?

Many thanks

@realrolfje
Copy link
Owner

Hi, UK_POST_CODE seems to be the correct term to use. Can you share (part of) your configuration file so I can see what might be wrong? Thanks!

@szhorvath
Copy link
Author

Hi @realrolfje,

Here is the part. Everything works fine with DUTCH_ZIP_CODE but not with the UK one.

<?xml version="1.0" encoding="UTF-8"?>
<configuration jdbcurl="jdbc:mysql://mariadb:3306/testdb" userid="root" password="secret">
    <table name="agents">
        <column name="first_name" type="ELVEN_NAME" />
        <column name="last_name" type="ELVEN_NAME" />
        <column name="mobile" type="RANDOMDIGITS" />
        <column name="company" type="ROMAN_NAME" />
        <column name="telephone" type="RANDOMDIGITS" />
        <column name="address_1" type="STRING" />
        <column name="address_2" type="STRING" />
        <column name="postcode" type="UK_POST_CODE" />
    </table>
</configuration>

Thanks

@realrolfje
Copy link
Owner

realrolfje commented Jun 29, 2022

Hi Sandor, I just reproduced your situation and concluded that it is a bug in Anonimatron. The UK Postal Code Anonymizer is not registered in class AnonymizerService.

An easy workaround for now is to manually include it in your configuration, like so:

<?xml version="1.0" encoding="UTF-8"?>
<configuration jdbcurl="jdbc:mysql://mariadb:3306/testdb" userid="root" password="secret">

    <anonymizerclass>com.rolfje.anonimatron.anonymizer.UkPostCodeAnonymizer</anonymizerclass>

    <table name="agents">
        <column name="first_name" type="ELVEN_NAME" />
        <column name="last_name" type="ELVEN_NAME" />
        <column name="mobile" type="RANDOMDIGITS" />
        <column name="company" type="ROMAN_NAME" />
        <column name="telephone" type="RANDOMDIGITS" />
        <column name="address_1" type="STRING" />
        <column name="address_2" type="STRING" />
        <column name="postcode" type="UK_POST_CODE" />
    </table>
</configuration>

I hope this helps, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants