Hi- I get the following error msg on tomcat at this URL: http://localhost:8080/examples/HelloWorld
I am wondering it seems like I am getting the maven project to build in Moonshine IDE. then I put a new web.xml file in the examples directory in the tomcat server unzipped files. Then, I try to copy my class over and run the example, and I get this error msg. listed below. I just want to try to deploy one or two servlets which I know little about, so I can switch to blazeds and use tomcat. It's kind of like a helloworld to tomcat intro. I am hoping to use apache royale with blazeds. Any help is greatly appreciated. THANKS. j. mcnamara Root Cause java.lang.ClassCastException: class HelloWorld cannot be cast to class jakarta.servlet.Servlet import java.io.IOException; import java.io.PrintWriter; import javax.servlet.Servlet; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; /** * This servlet program is used to print "Hello World" on * client browser by implementing servlet interface. * @author w3spoint */ public class HelloWorld implements Servlet { private static final long serialVersionUID = 1L; //no-argument constructor. public HelloWorld() { } ServletConfig config=null; @Override public void init(ServletConfig config) throws ServletException { this.config = config; System.out.println("Do initialization here."); } @Override public void destroy() { System.out.println("Do clean-up process here."); } @Override public ServletConfig getServletConfig() { return config; } @Override public String getServletInfo() { return "w3spoint.com"; } @Override public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<h1>Hello World example using " + "servlet interface.</h1>"); out.close(); }} // the sample code taken from w3schools builds right the web.xml reads from conf/server.xml <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false"> <context docbase="webapps" path="/webapps/examples"/> my pom.xml looks like this: <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <groupId>local</groupId> <artifactId>NewJavaMavenProject</artifactId> <name>NewJavaMavenProject</name> <version>0.1.0-SNAPSHOT</version> <packaging>war</packaging> <properties> <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version> <maven.compiler.target>17</maven.compiler.target> <maven.compiler.source>17</maven.compiler.source> </properties> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.0</version> <scope>provided</scope> </dependency> </dependencies> <profiles> <profile> <id>exclude-central-repo</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>central</id> <url>https://repo.maven.apache.org/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <build> <sourceDirectory>src/main/java</sourceDirectory> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <configuration> <skip>true</skip> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.4.0</version> <configuration> <!--<webXml>C:\Users\myuser\apache-tomcat-10.1.10\webapps\NewJavaMavenProject\target\NewJavaMavenProject-0.1.0-SNAPSHOT</webXml>--> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass/> </manifest> </archive> </configuration> </plugin> </plugins> </build></project> Sent with [Proton Mail](https://proton.me/) secure email.