Skip to content

Commit 517a705

Browse files
committed
Fix: fixing issues when running in a JakartaEE server.
* Adding content in the beans.xml. * Adding empty constructors. Signed-off-by: Emmanuel Hugonnet <[email protected]>
1 parent 8538569 commit 517a705

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

sdk-jakarta/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
<dependency>
4949
<groupId>jakarta.enterprise</groupId>
5050
<artifactId>jakarta.enterprise.cdi-api</artifactId>
51+
<scope>provided</scope>
5152
</dependency>
5253
<dependency>
5354
<groupId>jakarta.inject</groupId>
5455
<artifactId>jakarta.inject-api</artifactId>
56+
<scope>provided</scope>
5557
</dependency>
5658
<dependency>
5759
<groupId>jakarta.json</groupId>

sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2AServerResource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ static void setStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunna
206206
}
207207

208208
@Provider
209-
public class JsonParseExceptionMapper implements ExceptionMapper<JsonParseException> {
209+
public static class JsonParseExceptionMapper implements ExceptionMapper<JsonParseException> {
210+
211+
public JsonParseExceptionMapper() {
212+
}
210213

211214
@Override
212215
public Response toResponse(JsonParseException exception) {
@@ -219,6 +222,9 @@ public Response toResponse(JsonParseException exception) {
219222
@Provider
220223
public static class JsonMappingExceptionMapper implements ExceptionMapper<JsonMappingException> {
221224

225+
public JsonMappingExceptionMapper(){
226+
}
227+
222228
@Override
223229
public Response toResponse(JsonMappingException exception) {
224230
if (exception.getCause() instanceof JsonParseException) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
5+
bean-discovery-mode="all">
6+
</beans>

sdk-server-common/src/main/java/io/a2a/server/requesthandlers/JSONRPCHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public class JSONRPCHandler {
3838
private AgentCard agentCard;
3939
private RequestHandler requestHandler;
4040

41+
public JSONRPCHandler() {
42+
}
43+
4144
@Inject
4245
public JSONRPCHandler(@PublicAgentCard AgentCard agentCard, RequestHandler requestHandler) {
4346
this.agentCard = agentCard;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
5+
bean-discovery-mode="all">
6+
</beans>

0 commit comments

Comments
 (0)