-
Notifications
You must be signed in to change notification settings - Fork 350
IllegalArgumentException: Code should not be empty #1365
Comments
One of the possible reasons is that the AOT engine is trying to write a parameter that it does not handle (which reminds me we should improve error handling). It is impossible for us to say without a small sample that replicate the problem. Can you please share that? |
I encountered this when trying to upgrade my JHipster examples to use Spring Native 0.11.0. You can reproduce with the following steps:
Results in:
My Java version:
|
@mraible thanks for the sample. There are more than one reason why such a generic exception could be raised and I'd like @AndersClausen to share his sample and that yours is in a separate issue potentially. From a quick look at your project, you are using mockito and it isn't supported (never was) see #1343. If you're still having that issue after removing the use of Mockito, please create a separate issue. |
@snicoll Thanks for the tip. Removing Mockito as a dependency and any tests that referenced it solved this issue for me. |
@snicoll Do you know why removing Mockito is necessary for Spring MVC but not WebFlux? Everything builds just fine in my WebFlux app and it has Mockito as a dependency:
|
Having mockito on the classpath is not a problem at all. It's using it in a test that will cause a definition to be created. If you're not using mockito, the post processor will be created with an empty set of definitions. |
@snicoll That's not the behavior I'm seeing. For Spring MVC, I had to exclude Mockito and then delete the tests for
|
Hi, I am facing the same problem Steps
|
@ivangfr Your project is using Mockito which is unsupported for now, see #1343 and #1063 related issues. @AndersClausen Sinec #1343 is now fixed in Spring Native |
@mraible mockito on the classpath shouldn't be an issue. You can put it again with your deleted tests and it shouldn't make any difference.
Using mockito manually in the test perhaps? (rather than |
With |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing this issue due to lack of feedback and related fix via #1343. |
Hi
I'm using spring boot 2.6.2-SNAPSHOT, Java 17 and spring native 0.11.1-SNAPSHOT and I'm getting an error when running
mvn clean install
, which I'm not quite sure how to debug. This is the error I'm seeing:Any ideas or suggestions to how I can debug it further or get past this? Many thanks
The text was updated successfully, but these errors were encountered: