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.
AnanSmritia at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Visit this URL for importing your db data http://www-it.desy.de/systems/services/databases/oracle/impexp/impexp.html.en
AnanSmritia at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I uploaded *.jar file into /root/web-inf/lib but still unable to access my servlet class files
farakha at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Did you check whether your server is running?
AnanSmritia at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
How about the descriptor file? Have u configured it properly? Can u show us a snippet of it.
Harish_MCAa at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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?
farakha at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Yes.Can u show us that
Harish_MCAa at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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>

farakha at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
Your servlet url pattern is missing :). You have to write a servlet-name, servlet-class, url-pattern for your application :)
AnanSmritia at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
I am new with this can you plz write web.xml file for me?thanks
farakha at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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.

Harish_MCAa at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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
Harish_MCAa at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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
Harish_MCAa at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 14
ERROR appeared:type Status reportmessage Servlet MyServlet is not availabledescription The requested resource (Servlet MyServlet is not available) is not available.
farakha at 2007-7-12 15:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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
farakha at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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>

farakha at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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.

Harish_MCAa at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 18
<servlet-class>/login</servlet-class> is wrong it should be fully qualified name.. like <servlet-class>com.in.Test</servlet-class>
saravanan.chennaia at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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
farakha at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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.
saravanan.chennaia at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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
farakha at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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.

farakha at 2007-7-21 21:34:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...