- This topic has 9 replies, 4 voices, and was last updated 20 years, 5 months ago by Riyad Kalla.
-
AuthorPosts
-
paulbhartMember(newbie alert)
I am getting the following error message when I try to run
resin through MyEclipse/Eclipse.class javax.servlet.Servlet is not loadable on startup. Resin requires javax.servlet.Servlet to be in the classpath on startup.
I am using the latest Java JDK (Java(TM) 2 SDK, Standard Edition
Version 1.4.2) gotten via a J2EE download.
located in C:\sun\AppServer\jdkI am on Windows XP
CLASSPATH isn’t set inside eclipse or as an environmental variable
I don’t have any other plug-ins installed
JAVA_HOME is set to c:\sun\AppServer\jdk
Resin launches fine by itself (manually)
Thanks in advance.
-paul
Riyad KallaMemberPaul this is strange, have you tried adding the servlet-api.jar (or whatever resin calls it?) to your build path? For example in Tomcat, this jar file is always in <tomcat>/common/lib directory, and I typically need to add this to my build path becuase I usually have servlets in my project.
Scott AndersonParticipantPaul,
We’ll see if we can get you setup. First, you didn’t mention which version of Resin you’re using. I assumed Resin 3 and set up my connector and had no problem starting it up with web applications deployed. So, we’ll need to review your configuration. To get everything to spin up I simply enabled the server, pointed it at the top level Resin installation directory, accepted the default config file, and configured the JDK. So, we’ll need to dig a little to figure out what’s up with your configuration. First, it might help if you read the Resin connector notes here:
http://www.myeclipseide.com/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=27&categories=Resin3&parent_id=14Finally, can you please post the answers to all the questions we ask in the Posting Guidelines thread at the top of this forum. That will help us figure out what’s going on more effectively.
Scott AndersonParticipantPaul,
Ignore my previous post. Resin has changed their packaging model and additional configuration is now required to
launch successfully. Here’s what I did to get Resin 3.0.6 up and running.Do what I said before wrt the config of the home dir, config, JDK.
Then, on the Resin 3 > Paths preference page:
In the ‘Append to classpath’ box, add all jars in the <resin>/lib directory *except* resin.jar
In the ‘Append to library path’ box, add <resin>/binYou should now be able to launch with no problem.
paulbhartMemberOk, that seems to have solved that problem and I am almost ready to
start playing for real.Eclipse version 1.2.1
Resin 3.0.6 ee version
most recent myEclipse loaded fresh to EclipseI am now running into a issue getting my simple helloWorld servlet
up and running.I believe it is again an issue with lib/classes
The web page displays (http://localhost:8080/myTest/hello)
WEB-INF/web.xml:2: `test.HelloWorld’ must implement javax.servlet.Servlet.
All servlets must implement the Servlet interface.When you try to access the servlet. The servlet is directly from the resin
site.All I did was add a web.xml and HelloWorld.java file to the myEclipse project.
web.xml (put into WEB-INF directory)
<web-app>
<servlet servlet-name=”hello-world” servlet-class=”test.HelloWorld”>
<init-param greeting=”Hello, World”/>
</servlet>
<servlet-mapping url-pattern=”/hello” servlet-name=”hello-world”/>
</web-app>HelloWorld.java (put into the src directory under test)
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;public class HelloWorld extends HttpServlet {
private String greeting;public void init()
throws ServletException
{
greeting = getInitParameter(“greeting”);
}public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();out.println(“<title>” + greeting + “</title>”);
out.println(“<h1>” + greeting + “</h1>”);
}public void destroy()
{
// nothing to do
}
}
Scott AndersonParticipantPaul,
I’m not sure what’s up with that web.xml file of yours because it’s certainly not valid according to the DTD.
It should really look like this:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>hello-world</servlet-name> <servlet-class>test.HelloWorld</servlet-class> </servlet> <servlet-mapping> <servlet-name>hello-world</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> </web-app>
Perhaps you could just try creating a new web project with our wizard. Then use our servlet wizard to create
your servlet and be sure to check the box on page two of the wizard so it will configure your web.xml file
for you. That will give you a nice deployable sample wthout writing any code or descriptors for you to test with.
Gary SchiltzMemberI just switched from Tomcat to Resin (ironically, because of how much easier I found it to be to integrate it with Apache HTTP Server), and had the same problem launching resin from within MyEclipse, and Scott’s instructions fixed it. I assume the ME 3.0 final release will do this automatically when one fills in the root directory of the resin installation. In the meantime, perhaps the “Resin3 Connector Notes” (at http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-27.html) should have a link to this thread (it already has the part about the resin bin directory needing to be added).
@support-scott wrote:
Paul,
Ignore my previous post. Resin has changed their packaging model and additional configuration is now required to
launch successfully. Here’s what I did to get Resin 3.0.6 up and running.Do what I said before wrt the config of the home dir, config, JDK.
Then, on the Resin 3 > Paths preference page:
In the ‘Append to classpath’ box, add all jars in the <resin>/lib directory *except* resin.jar
In the ‘Append to library path’ box, add <resin>/binYou should now be able to launch with no problem.
Riyad KallaMemberGreat suggestion, I just added it.
Scott AndersonParticipantI assume the ME 3.0 final release will do this automatically when one fills in the root directory of the resin installation.
There’s an open bug report on it. Should be picked up and fixed by then for sure.
Riyad KallaMemberFixed in 3.8Beta2.
-
AuthorPosts