Servlet Hosting Problem (30 Dukes)
I am ready to pay 30 Dukes for solution:
I developed a website using java servlet (jswdk-1.0.0) and Oracle9i
Now I am in hosting process but facing problems as I haven't work on
tomcat. The hosting company installed and configured:
a) Oracle XE
b) Apache with mod_jk
c) tomcat-5.5.20
Hosting company has provided following info for java files:
account_id@domainName:~> cd
account_id@domainName:~> cd jakarta-tomcat/bin account_id@domainName:~/jakarta-tomcat/bin> ./shutdown.sh
Using CATALINA_BASE:/srv/www/vhosts/domainName.com/jakarta-tomcat
Using CATALINA_HOME:/srv/www/vhosts/domainName.com/jakarta-tomcat
Using CATALINA_TMPDIR: /srv/www/vhosts/domainName.com/jakarta-tomcat/temp
Using JRE_HOME:/usr/local/jdk1.6.0
account_id@domainName:~/jakarta-tomcat/bin> ./startup.sh
Using CATALINA_BASE:/srv/www/vhosts/domainName.com/jakarta-tomcat
Using CATALINA_HOME:/srv/www/vhosts/domainName.com/jakarta-tomcat
Using CATALINA_TMPDIR: /srv/www/vhosts/domainName.com/jakarta-tomcat/temp
Using JRE_HOME:/usr/local/jdk1.6.0
I have uploaded my:
html files into httpdocs
my servlet (*.class files merged in kkk.jar files) kkk.jar and uploaded at /ROOT/WEB-INF/kkk.jar
PROBLEMS:
1..... HTTP Status 404 - /servlet/login
--
type Status report
message /servlet/login
description The requested resource (/servlet/login) is not available.
--
Apache Tomcat/5.5.20
2..... I am able to create the DB but need help to import db data from my desktop to ORACLE - XE
[1653 byte] By [
farakha] at [2007-11-27 5:46:33]

# 1
my servlet (*.class files merged in kkk.jar files) kkk.jar and uploaded at /ROOT/WEB-INF/kkk.jarJar files should be placed in the lib folder.
# 2
Visit this URL for importing your db data http://www-it.desy.de/systems/services/databases/oracle/impexp/impexp.html.en
# 3
I uploaded *.jar file into /root/web-inf/lib but still unable to access my servlet class files
# 4
Did you check whether your server is running?
# 5
How about the descriptor file? Have u configured it properly? Can u show us a snippet of it.
# 6
> How about the descriptor file? Have u configured it> properly? Can u show us a snippet of it.you mean web.xml in web-inf?
# 7
Yes.Can u show us that
# 8
/ROOT/WEB-INF/web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>
# 9
Your servlet url pattern is missing :). You have to write a servlet-name, servlet-class, url-pattern for your application :)
# 10
I am new with this can you plz write web.xml file for me?thanks
# 11
Lemme show u an example, If ur project hierarchy is this,
Project
|_ _index.jsp
|__WEB-INF
|__classes
|__ com.test.LoginServlet
|__lib
|__third-party.jar
|__web.xml
Then web.xml configuration is,
<web-app ..... >
:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.test.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>servlet/login</url-pattern>
</servlet-mapping>
</web-app>
com.test.MyServlet invocation : http://server-address:port/Project/servlet/login
index.jsp invocation : http://server-address:port/Project/index.jsp
U can refer this example to create descriptor file for ur project.
# 12
Sorry, went wrong with the formatting.Project/index.jspProject/WEB-INF/lib/third-party.jarProject/WEB-INF/classes/com/test/LoginServlet.javaProject/WEB-INF/web.xmlC the change plz
# 13
Sorry, went wrong with the formatting.Project/index.jspProject/WEB-INF/lib/third-party.jarProject/WEB-INF/classes/com/test/LoginServlet.classProject/WEB-INF/web.xmlC the change plzMessage was edited by: Harish_MCA
# 14
ERROR appeared:type Status reportmessage Servlet MyServlet is not availabledescription The requested resource (Servlet MyServlet is not available) is not available.
# 15
Harish how can i send private message to you in this forum. I want to get you the full controls of my dedicated serveryou can contact me on my email: farakhkhan@yahoo.com
# 16
I have done in this way plz check it
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>/login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/servlet/login</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>
# 17
I don't understand the wrapping of classes u created into a jar file. Well , i wud suggest u to unjar into classes directory, Then do the required configuration in web.xml and create a final deployable war file.
well,
<servlet-class>/login</servlet-class> is not proper
servlet-class element point to the java class file not any url pattern
For ex,
<servlet-class>Test</servlet-class> where Test.class should be inside classes directory.
# 18
<servlet-class>/login</servlet-class> is wrong it should be fully qualified name.. like <servlet-class>com.in.Test</servlet-class>
# 19
can you please mail me as I want to give you the password to check my server by yourself because its time consuming job to post message and you rectifyplease see my dedicated server by yourself and then let me have your verdictthanks
# 20
Does your application work on your local system?if yes then you build a war file and place the war file in tomact's webapps folder.
# 21
i have installed on my machine jswdk. I never used tomcat that's why am facing problemsplz mail me as I want to give you the passwords to log to my server and make changes
# 22
> <servlet-class>/login</servlet-class> is wrong it
> should be fully qualified name..
> like
> <servlet-class>com.in.Test</servlet-class>
i changed the <servlet-class>http://domainName:port/</servlet-class>
this is the error
type Status report
message /servlet/login
description The requested resource (/servlet/login) is not available.