-
Notifications
You must be signed in to change notification settings - Fork 88
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
java.lang.IllegalArgumentException: URI is not absolute #1169
Comments
hi @naveensabavath, thanks for reporting this issue. Unfortunately, it does not seem there is any option now in EM to block it from following location links :( |
hi @arcuri82 I initially reported an issue where EvoMaster was generating MongoDB documents with special characters ([^] ~) in the _id field. When calling the GET /users/{id} API, the URL contained characters like %50 for special characters , causing URI encoding issues and breaking the request. Root Cause: EvoMaster was inserting random characters in _id values. I modified my code to restrict the id field to only allow: Now, EvoMaster generates IDs without special characters, and the GET API works correctly. and Thank you for Responding |
@naveensabavath thanks for the reply. so, it would seems an invalid handling of special characters. good to hear you found a workaround until this problem is fixed |
Issue: IllegalStateException: only support Map with String key in EvoMaster hi @arcuri82 , I am encountering the following error while integrating EvoMaster with my Spring Boot application: Caused by: java.lang.IllegalStateException: only support Map with String key When I asked ChatGPT, it suggested that the issue might be due to using Enums as keys in a Map, and recommended changing them to Strings. I tried implementing custom serialization and deserialization using JsonSerializer and JsonDeserializer to convert Enums to Strings, but the issue still persists. Could you please provide guidance on how to properly handle this in EvoMaster?
|
Hi, this is a bug in EvoMaster, unfortunately. Can you create a new issue for it? (as this already deals with special characters in requests). until bug is fixed, a workaround is to disable Mongo support, eg, |
@naveensabavath thanks, but too early to close this issue. i ll close it when ll fix the issue with handling of special characters |
Command am using : fletcher@fletcher:~/Desktop/godster/demoevo$ java -jar target/evomaster.jar --maxTime 20s --outputFolder "src/test/java"
EvoMaster version: 3.4.0
Loading configuration file from: /home/fletcher/Desktop/godster/demoevo/em.yaml
Initializing...
There are 5 usable RESTful API endpoints defined in the schema configuration
Starting to generate test cases
Consumed search budget: 9.855%
Covered targets: 114; time per test: 76.2ms (2.2 actions); since last improvement: 0s
[ERROR] EvoMaster process terminated abruptly. This is likely a bug in EvoMaster. Please copy&paste the following stacktrace, and create a new issue on https://github.com/EMResearch/EvoMaster/issues
*### java.lang.RuntimeException: Internal bug with EvoMaster when making a HTTP call toward /users/_PM_U8_XU%5C%5E
at org.evomaster.core.problem.rest.service.AbstractRestFitness.handleRestCall(AbstractRestFitness.kt:617)*
at
org.evomaster.core.problem.rest.service.ResourceRestFitness.computeFitnessForEachEnterpriseActionGroup(ResourceRestFitness.kt:174)
at org.evomaster.core.problem.rest.service.ResourceRestFitness.computeFitnessForEachResource(ResourceRestFitness.kt:230)
at org.evomaster.core.problem.rest.service.ResourceRestFitness.doCalculateCoverage(ResourceRestFitness.kt:84)
at org.evomaster.core.problem.rest.service.ResourceRestFitness.doCalculateCoverage(ResourceRestFitness.kt:28)
at org.evomaster.core.search.service.FitnessFunction.calculateIndividualCoverageWithStats(FitnessFunction.kt:149)
at org.evomaster.core.search.service.FitnessFunction.calculateCoverage(FitnessFunction.kt:66)
at org.evomaster.core.search.service.mutator.Mutator.mutateAndSave(Mutator.kt:174)
at org.evomaster.core.search.algorithms.MioAlgorithm.searchOnce(MioAlgorithm.kt:48)
at org.evomaster.core.search.service.SearchAlgorithm.search(SearchAlgorithm.kt:77)
at org.evomaster.core.Main$Companion.run(Main.kt:609)
at org.evomaster.core.Main$Companion.initAndRun(Main.kt:204)
at org.evomaster.core.Main$Companion.main(Main.kt:114)
at org.evomaster.core.Main.main(Main.kt)
Caused by: javax.ws.rs.ProcessingException: URI is not absolute
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:309)
at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:630)
at org.glassfish.jersey.client.JerseyInvocation.call(JerseyInvocation.java:665)
at org.glassfish.jersey.client.JerseyInvocation.lambda$runInScope$3(JerseyInvocation.java:659)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
at org.glassfish.jersey.client.JerseyInvocation.runInScope(JerseyInvocation.java:659)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:629)
at org.evomaster.core.problem.rest.service.AbstractRestFitness.handleRestCall(AbstractRestFitness.kt:538)
... 13 common frames omitted
Caused by: java.lang.IllegalArgumentException: URI is not absolute
at java.base/java.net.URL.of(URL.java:862)
at java.base/java.net.URI.toURL(URI.java:1172)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:318)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:265)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:297)
... 23 common frames omitted
below is my SUTCONTROLLER class ::::::
package demo.demoevo;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.evomaster.client.java.controller.EmbeddedSutController;
import org.evomaster.client.java.controller.InstrumentedSutStarter;
import org.evomaster.client.java.controller.api.dto.SutInfoDto;
import org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto;
import org.evomaster.client.java.controller.problem.ProblemInfo;
import org.evomaster.client.java.controller.problem.RestProblem;
import org.evomaster.client.java.sql.DbSpecification;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.testcontainers.containers.GenericContainer;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class EmbeddedEvoMasterController extends EmbeddedSutController {
// @OverRide
// public ProblemInfo getProblemInfo() {
// System.out.println("SUTPORT:::: " + getSutPort());
// return new RestProblem(
// "http://localhost:" + getSutPort() + "/v3/api-docs", // URL to your OpenAPI documentation
// null
// );
// }
}
The text was updated successfully, but these errors were encountered: