jaxrpc
asked on
Unable to get servlets to run - error from TOMCAT4
Hi,
I have some problems running my servlets in tomcat4. Here's the error generated from TOMCAT. Sorry i have not used tomcat or jsp/servlets too frequent and not very familiar with it. Please help me have a look what does the error means.
thanks
2006-12-01 10:56:10 invoker: Cannot allocate servlet instance for path /servlet/DT_2DBServlet
javax.servlet.ServletExcep tion: Servlet.init() for servlet org.apache.catalina.INVOKE R.DT_2DBSe rvlet threw exception
at org.apache.catalina.core.S tandardWra pper.load( StandardWr apper.java :871)
at org.apache.catalina.core.S tandardWra pper.alloc ate(Standa rdWrapper. java:615)
at org.apache.catalina.servle ts.Invoker Servlet.se rveRequest (InvokerSe rvlet.java :396)
at org.apache.catalina.servle ts.Invoker Servlet.do Get(Invoke rServlet.j ava:180)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 740)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 853)
I have some problems running my servlets in tomcat4. Here's the error generated from TOMCAT. Sorry i have not used tomcat or jsp/servlets too frequent and not very familiar with it. Please help me have a look what does the error means.
thanks
2006-12-01 10:56:10 invoker: Cannot allocate servlet instance for path /servlet/DT_2DBServlet
javax.servlet.ServletExcep
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.servle
at org.apache.catalina.servle
at javax.servlet.http.HttpSer
at javax.servlet.http.HttpSer
ASKER
sorry, but where can i find web.xml...can't seems to find it because i am following the installation manual provided by the software maker 4years ago.
No problem.
Now, do you know where Tomcat is installed? Normaly, it would be like C:/tomcat4. Let's call it TOMCAT_HOME.
If you have found it, do you find the folder called "webapps" in <TOMCAT_HOME>/webapps. The web.xml is located in <TOMCAT_HOME>/webapps/<YOU R WEB APP NAME>/WEB-INF/web.xml
Can you find it?
Now, do you know where Tomcat is installed? Normaly, it would be like C:/tomcat4. Let's call it TOMCAT_HOME.
If you have found it, do you find the folder called "webapps" in <TOMCAT_HOME>/webapps. The web.xml is located in <TOMCAT_HOME>/webapps/<YOU
Can you find it?
>>"i am following the installation manual provided by the software maker 4years ago."
So it is an existing system. Are you trying to enhance the existing system?
So it is an existing system. Are you trying to enhance the existing system?
If everything is okay, you may need to enable your /servlet invoker.
http://tomcat.apache.org/faq/misc.html#invoker
http://tomcat.apache.org/faq/misc.html#invoker
ASKER
yup, there's no web.xml in myWebApp/Web-INF
actually i am trying to reinstall an existing system. Anyway how do i go about create a web.xml?
i have DT_2DBServlet.class in the web-inf and HDBIDSServlet.class in the web-inf.
where do i create or insert the servlet tags into the web.xml?
thanks
actually i am trying to reinstall an existing system. Anyway how do i go about create a web.xml?
i have DT_2DBServlet.class in the web-inf and HDBIDSServlet.class in the web-inf.
where do i create or insert the servlet tags into the web.xml?
thanks
Hi,
>>"actually i am trying to reinstall an existing system"
Well, do they provide you with any WAR file?
>>"actually i am trying to reinstall an existing system"
Well, do they provide you with any WAR file?
ASKER
hi,
really appreciate your help and fast reply.
Nope. Just an instruction manaul which instructs me to copy and paste the whole TOMCAT4 folder into C:\ and set a few system variables and stuffs.
really appreciate your help and fast reply.
Nope. Just an instruction manaul which instructs me to copy and paste the whole TOMCAT4 folder into C:\ and set a few system variables and stuffs.
Can you possibly post the instructions here (if no privacy exposed)?
>>"really appreciate your help and fast reply."
:), we are here to help
:), we are here to help
ASKER
Under tomcat i have the following files.
C:\Tomcat4\webapps\ROOT\WE B-INF\clas ses
DT_2.class
DT_2DataAccessor.class
DT_2DBServlet.class
HDBIDSServlet.class
HDBIDSDataAccessor.class
HDBIDSDBServlet.class
HDBIDS.java
HDBIDSDataAccessor.java
HDBIDSDBServlet.java
and another program written in VB6 which will call a java applet which communicates with the servlet.
So far i have got the web server running and i am able to call the java applet but it won't communicate with the servlet which might be the problem you suspected.
anyway the manual is just pure copy & paste TOMCAT4 folder to C:\ and everything will work...according to the manual.
thanks
C:\Tomcat4\webapps\ROOT\WE
DT_2.class
DT_2DataAccessor.class
DT_2DBServlet.class
HDBIDSServlet.class
HDBIDSDataAccessor.class
HDBIDSDBServlet.class
HDBIDS.java
HDBIDSDataAccessor.java
HDBIDSDBServlet.java
and another program written in VB6 which will call a java applet which communicates with the servlet.
So far i have got the web server running and i am able to call the java applet but it won't communicate with the servlet which might be the problem you suspected.
anyway the manual is just pure copy & paste TOMCAT4 folder to C:\ and everything will work...according to the manual.
thanks
Ok,
Is there any web.xml in your C:\Tomcat4\webapps\ROOT\WE B-INF\
Is there any web.xml in your C:\Tomcat4\webapps\ROOT\WE
ASKER
no...there isnt
ok, give me a sec
Assuming that your Tomcat's port is 8080.
What happen if you execute http://localhost:8080. Is there any Tomcat page displayed? Additionally, when you run your Tomcat, is there any error in the Tomcat's console?
What happen if you execute http://localhost:8080. Is there any Tomcat page displayed? Additionally, when you run your Tomcat, is there any error in the Tomcat's console?
ASKER
The root directory for the tomcat appear. There's no error in the catalina when i started it. infact each time i launch the applet...there will be some messages from the program.
ASKER
i have checked the web.xml in the conf folder but i dont see any servlet tags belonging to my servlets.
Do i need a web.xml for the servlets?
Do i need a web.xml for the servlets?
Try to go to your <TOMCAT_HOME>/conf/web.xml and enable the invoker by changing
<!--
<servlet-mapping>
<servlet-name>invoker</ser vlet-name>
<url-pattern>/servlet/*</u rl-pattern >
</servlet-mapping>
-->
into
<servlet-mapping>
<servlet-name>invoker</ser vlet-name>
<url-pattern>/servlet/*</u rl-pattern >
</servlet-mapping>
<!--
<servlet-mapping>
<servlet-name>invoker</ser
<url-pattern>/servlet/*</u
</servlet-mapping>
-->
into
<servlet-mapping>
<servlet-name>invoker</ser
<url-pattern>/servlet/*</u
</servlet-mapping>
>>"Do i need a web.xml for the servlets?"
If you follow the normal and recommended ways to deploy web app in J2EE in Tomcat, YES, each web app will have its own web.xml.
Now, what you used is to deploy the application in the ROOT folder of Tomcat which is actually not recommended (though can run). If you run this in Production environment, you are actually opening the security hole of the Tomcat to your user (although I am not sure how but it is not recommended).
If you follow the normal and recommended ways to deploy web app in J2EE in Tomcat, YES, each web app will have its own web.xml.
Now, what you used is to deploy the application in the ROOT folder of Tomcat which is actually not recommended (though can run). If you run this in Production environment, you are actually opening the security hole of the Tomcat to your user (although I am not sure how but it is not recommended).
ASKER
hi,
it is already
<servlet-mapping>
<servlet-name>invoker</ser vlet-name>
<url-pattern>/servlet/*</u rl-pattern >
</servlet-mapping>
but...still not working... any other ideas?
thanks...
it is already
<servlet-mapping>
<servlet-name>invoker</ser
<url-pattern>/servlet/*</u
</servlet-mapping>
but...still not working... any other ideas?
thanks...
Okay,
Just curious, is there any entry for DT_2DBServlet in your <TOMCAT_HOME>/conf/web.xml such as
<servlet>
<servlet-name>DT_2DBServle t</servlet -name>
Just curious, is there any entry for DT_2DBServlet in your <TOMCAT_HOME>/conf/web.xml
<servlet>
<servlet-name>DT_2DBServle
ASKER
nope..there's not such an entry.
Try to add that then.
Add below codes after your last </servlet> entry.
<servlet>
<servlet-name>DT_2DBServle t</servlet -name>
<servlet-class>YOUHAVETOPR OVIDETHIS. DT_2DBServ let</servl et-class>
</servlet>
Then add
<servlet-mapping>
<servlet-name>DT_2DBServle t</servlet -name>
<url-pattern>/servlet/DT_2 DBServlet< /url-patte rn>
</servlet-mapping>
after your last </servlet-mapping> entry
Add below codes after your last </servlet> entry.
<servlet>
<servlet-name>DT_2DBServle
<servlet-class>YOUHAVETOPR
</servlet>
Then add
<servlet-mapping>
<servlet-name>DT_2DBServle
<url-pattern>/servlet/DT_2
</servlet-mapping>
after your last </servlet-mapping> entry
and restart your Tomcat and try your applet again
ASKER
hi,
now i have another error from the log. unable to find the DT_2DBServlet class
the DT_2DBServlet is physically located in the root/web-inf/classes
so do i write the full path? or just the class name is enough?
thanks alot!!..
now i have another error from the log. unable to find the DT_2DBServlet class
the DT_2DBServlet is physically located in the root/web-inf/classes
so do i write the full path? or just the class name is enough?
thanks alot!!..
Hi,
>>"<servlet>
<servlet-name>DT_2DBServle t</servlet -name>
<servlet-class>YOUHAVETOPR OVIDETHIS. DT_2DBServ let</servl et-class>
</servlet>"
YOUHAVETOPROVIDETHIS is actually the package of your class. You can find this on your DT_2DBServlet.java
DT_2DBServlet.java
-----------------------
package xx.xx.xx;
If that is the case then
<servlet>
<servlet-name>DT_2DBServle t</servlet -name>
<servlet-class>xx.xx.xx.DT _2DBServle t</servlet -class>
</servlet>
>>"<servlet>
<servlet-name>DT_2DBServle
<servlet-class>YOUHAVETOPR
</servlet>"
YOUHAVETOPROVIDETHIS is actually the package of your class. You can find this on your DT_2DBServlet.java
DT_2DBServlet.java
-----------------------
package xx.xx.xx;
If that is the case then
<servlet>
<servlet-name>DT_2DBServle
<servlet-class>xx.xx.xx.DT
</servlet>
ASKER
hi,
really sorry....but i dont know how to read java code. ... still can't figure out which is the package.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import DT_2;
import DT_2DataAccessor;
public class DT_2DBServlet extends HttpServlet implements SingleThreadModel
{
private DT_2DataAccessor myDataAccessor;
private String CR = "\n";
private boolean booShowVideo=false;
String strReqDTName = null;
String strIPAddress = null;
boolean booUseDTName = false;
really sorry....but i dont know how to read java code. ... still can't figure out which is the package.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import DT_2;
import DT_2DataAccessor;
public class DT_2DBServlet extends HttpServlet implements SingleThreadModel
{
private DT_2DataAccessor myDataAccessor;
private String CR = "\n";
private boolean booShowVideo=false;
String strReqDTName = null;
String strIPAddress = null;
boolean booUseDTName = false;
Any other codes before import java.io.*; ?
If not,
<servlet>
<servlet-name>DT_2DBServle t</servlet -name>
<servlet-class>DT_2DBServl et</servle t-class>
</servlet>
should be okay
If not,
<servlet>
<servlet-name>DT_2DBServle
<servlet-class>DT_2DBServl
</servlet>
should be okay
ASKER
no other codes.
yup..this is the error i got
2006-12-01 15:37:54 StandardWrapper[:DT_2DBSer vlet]: Marking servlet DT_2DBServlet as unavailable
2006-12-01 15:37:54 StandardWrapperValve[DT_2D BServlet]: Allocate exception for servlet DT_2DBServlet
javax.servlet.ServletExcep tion: Wrapper cannot find servlet class DT_2DBSerlet or a class it depends on
at org.apache.catalina.core.S tandardWra pper.load( StandardWr apper.java :807)
at org.apache.catalina.core.S tandardWra pper.alloc ate(Standa rdWrapper. java:615)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:214)
yup..this is the error i got
2006-12-01 15:37:54 StandardWrapper[:DT_2DBSer
2006-12-01 15:37:54 StandardWrapperValve[DT_2D
javax.servlet.ServletExcep
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
>>"Wrapper cannot find servlet class DT_2DBSerlet or a class it depends on"
I am afraid that you have to provide all the necessary classes which would be hard if you do not know what are the files involved and only your original coders know it :(.
I am afraid that you have to provide all the necessary classes which would be hard if you do not know what are the files involved and only your original coders know it :(.
Worth to try though. If you know what are the servlets? Try to add all of them to your web.xml
DT_2.class
DT_2DataAccessor.class
DT_2DBServlet.class
HDBIDSServlet.class
HDBIDSDataAccessor.class
HDBIDSDBServlet.class
DT_2.class
DT_2DataAccessor.class
DT_2DBServlet.class
HDBIDSServlet.class
HDBIDSDataAccessor.class
HDBIDSDBServlet.class
ASKER
i found out... i mis-spelled the servletname but after i corrected it... i got back the same error as in the 1st post....
heh...
heh...
Can you post the entire stack trace (error codes)?
Oh yes,
I will be leaving in 30 mins time and will only be back by Monday. Just in case that your problem is not solved at that time, I hope that other experts may pop in during weekend and help you.
One more thing. Is this working previously? If so, what is the URL that you used before to run this?
I will be leaving in 30 mins time and will only be back by Monday. Just in case that your problem is not solved at that time, I hope that other experts may pop in during weekend and help you.
One more thing. Is this working previously? If so, what is the URL that you used before to run this?
ASKER
ok thanks alot!! for your help..
enjoy...your weekends.
enjoy...your weekends.
ASKER
Anyone else has any ideas on what problem i am facing?
thanks
thanks
Hi,
https://www.experts-exchange.com/questions/22079287/Guys-Please-help-this-I-need-to-go-and-can't-help-him-her-further-till-Monday.html
I have asked some pointer question so everyone can help you.
David
https://www.experts-exchange.com/questions/22079287/Guys-Please-help-this-I-need-to-go-and-can't-help-him-her-further-till-Monday.html
I have asked some pointer question so everyone can help you.
David
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry. actually the servlet works another PC. it seems that the problem could be with the last PC that i worked with though i am not sure what it is.. i will split the points evenly to everyone who tried to help. Thanks for the time and effort.
Moderator - Please close this question for me. thanks
Moderator - Please close this question for me. thanks
It means that your Servlet is not available. Have you added the entries in your web.xml? If so, can you post your web.xml?