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
IllegalAccessException: Can not set static final long field xxx.serialVersionUID to java.lang.Long #453
Comments
@detollenaere ; why are you trying to set serialVersionUID? you typically would not do that. https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html |
@garethahealy : I just migrate the dependencies, so I don' have a complete view on why this structure has been choosen but It's not a problem for me to declare a serialVersionUID into a class and there is no setter for this field. |
@detollenaere ; OK, can you create a github repo with an example class/mapping and unit test please. Makes debugging/fixing the issue so much easier. |
@detollenaere ; just as a quick work-around. Can you exclude the serialVersionUID? |
ok Il wil check that as soon as possible (I have to work on another topic since). Thanks for you quick reply |
@detollenaere ; have added a test for this, but i don't see the issue. I think its the same as you've described. |
@detollenaere ; any update? |
@garethahealy Thanks for the test! I confess that I had not much time to add one myself. I am very busy at the moment but I will check this week! (I'm cloning the git as I write this). Thanks again. |
@garethahealy I just made a few modifications on your testcase to match exactly my case but I did not reproduce the bug.. I think so it's due to a specific configuration on my project. For now, we simply use the last 5.x version as workaround. When I'll get more time I'll try to isolate each parts of the project (it's a big project..) to find the cause. |
@detollenaere ; thanks for the update. |
@detollenaere ; closing case. when you get time, if you hit problem again, please re-open. |
@garethahealy I can use your suggested work-around to exclude the serialVersionUID. Please notice the error message: ".. cannot set ... long to ... Long," maybe you can find something with this hint. Thanks |
It seems for simple mapping like your above test, no such error. my code, the mapping is a bit complex. The error happens in one class which is inside the mapping class. talk to you later. |
Whats your runtime?
Whats the problem?
I tried to migrate dozer version in a project from 5.5.1 to 6.0.0 and I have an error. Here is my case:
packageA:
packageB:
dozer config:
In runtime, I have the following error:
Source parent class: packageA.ExampleA
Source field name: serialVersionUID
Source field type: class java.lang.Long
Source field value: 4925595665648744886
Dest parent class: packageB.ExampleB
Dest field name: serialVersionUID
Dest field type: long: org.dozer.MappingException: java.lang.IllegalAccessException: Can not set static final long field packageB.ExampleB.serialVersionUID to java.lang.Long
Any ideas ? Bug or we need to migrate/correct a configuration ?
The text was updated successfully, but these errors were encountered: