Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
After much reading of examples online I created a WAR file with a web.xml containing:
<servlet> <description>This is a servlet host for the
transformer</description> <display-name>Transformer</display-name>
<servlet-name>transformer</servlet-name>
<servlet-class>com.pepsi.transformer.TransformerServlet</servlet-class>
<load-on-startup>1</load-on-startup> </servlet>
And then in my .java file I have:
package com.pepsi.transformer;
public class TransformerServlet extends HttpServlet {
Then I built my ant script to stuff the TransformerServlet.class file into the WEB-INF/classes part of the WAR file. I have inspected it afterwords and found the .class file was there exactly as intended.
So ... then why do I see this error when I try to hit the doGet from the browser?
00000099 annotation W
com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses
SRVE8000W: Skipped class that failed to initialize for annotation
scanning. java.lang.ClassNotFoundException:
com.pepsi.transformer.TransformerServlet at
jav.lang.ClassforNameImpl(Native Method) ...
Did I overspecify the package? Should the classes folder contain un-compiled .java files? Does it need an init method? Does something else on the server need to know about this class file?
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.