Community Tip - You can change your system assigned username to something more personal in your community settings. X
Version: Windchill 13.0
Use Case: I am trying to create a simple hello world servlet. Full details in the Problem Description below
Description:
I am using Windchill PDM link and am trying to create a very basic servlet to return the string "Hello from Windchill!". The plan is to use this as a starting point before writing more complicated ones.
I have used the PTC supplied an Ant build script that automates the creation of an Eclipse project to ensure that all necessary JAR files and environment configurations are correctly set up as I will need this for when I write more complicated servlets that interact with Windchill in the future.
I have the HelloRestServlet class below in Eclipse which i have built into a jar and placed on the server in D:\ptc\Windchill_13.0\Windchill\codebase\WEB-INF\lib\hello-servlet.jar
I have added wt.services.loadService=ext.rest.RegisterHelloServlet to the bottom of file D:\ptc\Windchill_13.0\Windchill\codebase\wt.properties
Restarted Windchill and gone to this url https://<windchi-server>/Windchill/servlet/rest/hello in a browser which gives:
"Windchill Error
Contact your administrator for assistance. Information for their reference follows.
Request Id:
Request URI: /Windchill/servlet/rest/hello
Query String:
Status Code: 404
Message: "
and in the MethodServer log I see: 2025-05-08 10:02:29,821 ERROR [Servlet engine main] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Windchill] - Servlet [HelloRestServlet] in web application [/Windchill] threw load() exception java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet
My HelloRestServlet class is:
package ext.rest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class HelloRestServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
resp.getWriter().write("Hello from Windchill!");
}
}
I am new to all this so any help appreciated.
You would have to see what jar file contains javax.servlet.http.HttpServlet and ensure that its included in Windchill classpath.
is it resolved, I am also facing same problem any solution ?
Please let me know
