Seguindo o exemplo, não estou conseguindo obter o resultado que lista os emails. Criei o projeto, as classes de AgendamentoService e Agendamento Servlet mas ao tentar requisitar a lista retorna um erro de Not Found. Por favor conseguem me ajudar?
http://127.0.0.1:8080/ScheduleEmailService-0.0.1-SNAPSHOT/emails resultado: Not Fount Onde é configurado a chamada "/emails"?
public class ScheduleEmailServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Inject
private ScheduleEmailService service;
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
service.list().forEach(result -> pw.print("Os emails disponiveis sao: " + result));
}
}
@Stateless
public class ScheduleEmailService {
public List<String> list(){
return List.of("xxxxx@gmail.com");
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ScheduleEmailService</groupId>
<artifactId>ScheduleEmailService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>ScheduleEmailService</name>
<description>Schedule Email with jakarta and EJB</description>
<dependencies>
<!-- https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api -->
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>12</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>