Tomcat 5.5, struts, AJAX - Works on localhost but not on online web-server

Hello,
I'm trying to add some functionality from Ajax to my client's web application. And I'm stuck on this problem for the past 4 days now.
To make a long story short, the application works perfectly on my localhost, but once I deploy it to the online server it pops a Page Not Found message (written in the JavaScript of Ajax engine). Though I have worked with servlets and struts a bit, I still consider myself very new.
Here are some specifications:
- The jar files are in tomcat-5.5/common/lib
- The servlets (compiled correctly) are in webapps/ROOT/WEB-INF/classes/javaClasses
- My web.xml and struts-config.xml are in WEB-INF, both of which I believe are configured correctly:
web.xml
=======
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
     <servlet>
          <servlet-name>action</servlet-name>
          <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
          <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
          </init-param>
     </servlet>
     <servlet-mapping>
          <servlet-name>action</servlet-name>
          <url-pattern>*.do</url-pattern>
     </servlet-mapping>
     <welcome-file-list>
          <welcome-file>/index.jsp</welcome-file>
     </welcome-file-list>
</web-app>
struts-config.xml
==============
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<action-mappings>
<action path="/signup" type="org.apache.struts.actions.ForwardAction" parameter="/signup.jsp" />
<action path="/countries" type="javaClasses.GetCountries" />
</action-mappings>
</struts-config>
I noticed when I type "countries.do" on my localhost, the action is processed perfectly, however on the online server, it displays me the 404 error page.
I thought it wasn't seeing the struts-config.xml so I played around with the directory path struts-config.xml and replaced it with:
<param-value>/home/shaghig/webapps/ROOT/WEB-INF/struts-config.xml</param-value>
but still no luck.
What is it that I am not doing right? Any input or guidance would be very much appreciated.

Have you resolved your problem? I am running into the SAME EXACT issues with my application. The only difference is I'm not deploying to webapps/ROOT/; I'm deploying to my own directory based on my WAR file name (webapps/<web_application_name>/WEB-INF....blah blah). If you figured out your problem (believe me, I wish I could be of some help) I would LOVE to hear what you did/figured out.
-C

Similar Messages

  • Sockets work on localhost but not remotely?

    hi there,
    I have created a simple multithreaded client / server program.
    The Server listens on port 2222 for clients. When a client connects - the client sends its ip address to the server and then disconects. More than 1 client can connect at the same time to the server and the server also listens continuasly. I have 2 problems with the program...
    a) the programs work on localhost but not on remote machines? (Well not over my LAN anyway).
    b) I am getting 2 lots of 'datain' when the server recieves an ip address from the client when the client should only send it once.
    The code is below - any help would be greatly appreciated.
    //TCPServer.java
    import java.io.*;
    import java.net.*;
    class TCPServer {
         public static void main (String args[]) throws IOException {
              ServerSocket serverSocket = null;
              boolean listening = true;
              try {
                   serverSocket = new ServerSocket(2222);
              } catch (IOException e) {
                   System.err.println("Could not listen on port: 2222");
                   System.exit(-1);
              System.out.println("Server Started...\n");
              while (listening)
              new TCPServerThread(serverSocket.accept()).start();
              serverSocket.close();
    //TCPServerThread.java
    import java.net.*;
    import java.io.*;
    public class TCPServerThread extends Thread {
        public Socket socket;
        public TCPServerThread(Socket socket) {
         super("TCPServerThread");
         this.socket = socket;
        public void run() {
                   try {
                   BufferedReader datain = new BufferedReader (new InputStreamReader
                        (socket.getInputStream()));
                        System.out.println("ip address recieved");
                        System.out.println (datain.readLine () + "\n");
                   } catch (IOException e) {
                        System.err.println("Cannot read in ip address\n");
                        e.printStackTrace(); // show the error
                        System.exit(-1);
         } //TCPClient.java
    import java.io.*;
    import java.net.*;
    class TCPClient {
         public static void main (String args[]) throws Exception
              String hostname;
              int portNumber;
              String portString;
              BufferedReader inFromUser =
                   new BufferedReader (new InputStreamReader(System.in));
                   System.out.println("What host would you like to connect to?");
                   hostname = inFromUser.readLine();
                   System.out.println("What port would you like to connect to?");
                   portString = inFromUser.readLine();
                   portNumber = Integer.parseInt(portString);
                   System.out.println("Connecting to port " + portNumber + " of " + hostname + "....\n");
                        Socket clientSocket = new Socket(hostname, portNumber);
                        Socket sock = new Socket (InetAddress.getLocalHost(), portNumber);
                        BufferedWriter dataout;
                        java.net.InetAddress i = java.net.InetAddress.getLocalHost();
                        System.out.println("Sending ip address...\n" + i.getHostAddress());
                             dataout = new BufferedWriter (new OutputStreamWriter (sock.getOutputStream()));
                                  dataout.write (i.getHostAddress());
                                  dataout.flush();
                                  sock.close();
                                       clientSocket.close();
                             }Oh, yeah - check out my site below, I am trying to write an audio streaming client / server in Java if anyone is interested in getting involved or just being nosey....
    http://www.projectg.dsl.pipex.com

    In your client you are creating two sockets (why?). One connected to localhost, the other connected to the host specified using readLine.
    If your client runs on the same machine you have started your server, you have two connects to your server instead of one.
    The ip adresse is sent using the socket connected to localhost. That is why it does not work on remote machines.
    Hope this helps.
    J&ouml;rg

  • Works in Tomcat but not in iPlanet Web server

    I have a servlet which first generates a form which has one input field, when user fills in the text field and submits the form it is posted to same servlet. The posted data is processed and redirected to another servlet. Everything works fine on Tomcat3.2 but fails to work on iPlanet web server and throws HTTP Error 500.
    Can someone help me with this? What might be the problem?

    Don't know whey it worked in Tomcat and not in iPlanet, but the reason is because I missed '/' in getRequestDispatcher() methoc
    public RequestDispatcher getRequestDispatcher(java.lang.String path)
    The pathname must begin with a "/" and is interpreted as relative to the current context root.

  • Director movie work in IE but not in other web browsers

    Hello,
    please can someone help me? I have web page which use DCR file. If I open it in Internet Explorer, it show me preloader which preload movie and than lunch. This work good. But if I open same page in every other browsers, I will see just adobe preloader which not preload. I can wait even hours but nothing happens.
    Does anyone meet this problem before? I use pluging which work in all browsers. I even try this from other computers. Same problem.
    Thank you.
    Age

    OK, here is html code:
    <HTML>
    <HEAD>
    <TITLE>Title</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </HEAD>
    <BODY bgColor="#000000">
    <center>
    <TABLE border=0 width=100% height=100%>
    <TR><TD align=center>
    <OBJECT classid="clsid:233C1507-6A77-46A4-9443-F871F945D258"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=11,5,0,593"
    ID=RGB WIDTH=1000 HEIGHT=650 VIEWASTEXT>
    <param name=src value="Movie.dcr">
    <PARAM NAME=swStretchStyle VALUE=none>
    <param name=swRemote value="swSaveEnabled='true' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ">
    <param name=PlayerVersion value=11>
    <PARAM NAME=bgColor VALUE=#000000>
    <EMBED SRC="Movie.dcr" bgColor=#000000  WIDTH=1000 HEIGHT=650 swRemote="swSaveEnabled='true' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' " swStretchStyle=none
    TYPE="application/x-director" PlayerVersion=11 PLUGINSPAGE="http://www.macromedia.com/shockwave/download/"></EMBED>
    </OBJECT>
    </TD>
    </TR>
    </TABLE>
    </CENTER>
    </BODY>
    </HTML>
    Edit: Thank you! Problem was in HTML code. I found it when I paste it to this forum so again - thank you for your help.

  • AMF work in Localhost, but not work in Remote server

    I am using zend's amf to connect the flex with backend.
    I have this service-config:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="zend-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="zend">
                    <channels>
                        <channel ref="zend-endpoint"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="zend-endpoint" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.domain.com.br/flex" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    When I run my app in localweb this work nice, but when I upload my app to the host, this erro show:
    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://www.domain.com.br/flex'"]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.x\frameworks\pro jects\rpc\src\mx\rpc\AbstractInvoker.as:290]
        at mx.rpc::Responder/fault()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\Responder.a s:58]
        at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AsyncReq uest.as:103]
        at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.x\frameworks\projects\rpc\src \mx\messaging\ChannelSet.as:1446]
        at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.x\frameworks\projects\rpc\s rc\mx\messaging\ChannelSet.as:1056]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.messaging::Channel/connectFailed()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\mes saging\Channel.as:1069]
        at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3.x\frameworks\project s\rpc\src\mx\messaging\channels\PollingChannel.as:388]
        at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.x\frameworks\projects\rp c\src\mx\messaging\channels\AMFChannel.as:411]
    Please, somebody can help-me, please?

    RESOLVED!
    The problem was on the server: http resquest return 301... I turn off the "mod_security" on the server and all works perfect now!

  • Transmitting with JMStudio works on LAN but not over the web!

    I've been reading all kinds of posts related to this problem.. it was asked many times but noone has given the answer.
    The transmitter has to put the receivers ip and some port.
    The receiver has to open rtp session with the transmitter's ip and the same port.
    On a LAN it works, but over the internet it doesn't (the receiver keeps "waiting for data").
    The two computers I used for trying that, are on no LAN's.. they are assigned a unique ip by the isp (two simple broadband or dial-up connections with single computers).
    Why doesn't it work?
    (The ip's I used are (for example) the ones that appear in whatsmyipaddress.com and i'm behind no proxy)

    I've been reading all kinds of posts related to this problem.. it was asked many times but noone has given the answer.
    The transmitter has to put the receivers ip and some port.
    The receiver has to open rtp session with the transmitter's ip and the same port.
    On a LAN it works, but over the internet it doesn't (the receiver keeps "waiting for data").
    The two computers I used for trying that, are on no LAN's.. they are assigned a unique ip by the isp (two simple broadband or dial-up connections with single computers).
    Why doesn't it work?
    (The ip's I used are (for example) the ones that appear in whatsmyipaddress.com and i'm behind no proxy)

  • Rollover works in iWeb, but not in any web browser

    I created pretty rollover links in iWeb '08 and when I mouse over them within iWeb, they light up like they're supposed to.
    However, when I open the pages in any web browser (Mac or PC, Safari or Firefox), the links do not light up.
    Any suggestions? I have already installed the latest update to iWeb.

    Nevermind. I fixed it.

  • Disp+work.exe Running but not connected to Message server

    Dear All,
    I install SAP NetWeaver 7.0 ABAP Trial Version on my PC (Win XP SP2, Proc 2.4 GHZ, RAM 1 GB) installation success, but when I start the application server through mmc the dispatcher failed to start.
    I've tried to restart my machine, the problem still there.....
    Please help me to fix this problem...
    Thanks.
    Endi

    I got the same error, anyone can help ???

  • .jsp works in ROOT but not separate web

    I am very new to JSP but I am running the Java runtime on a Unix
              REDHAT machine and I am using Apache Tomcat. I have the $TOMCAT_HOME
              defined and the usual helloworld.jsp will run at
              $TOMCAT_HOME/webapps/ROOT but not at my web which is
              $TOMCAT_HOME/webapps/ralph. All I did was copy from one to the other.
              What else do I need to do to make this work?
              Thanks.
              Ralph Tillery
              

    Interesting.
    - Does the page look identical in each browser
    though?Yes, the pages look identical in every other way.
    - When you click a box to expand the tree does it load
    a new page or is it handled through some client side
    scripting like Javascript?No new page is loaded, a Javascript handles the "+" boxes.
    - What versions of Netscape have you found it didn't
    work?I've tried it out on v4.75 as well as v6.2, no success with either.
    Someone else mentioned to me that it sounds like a Javascript problem. I've worked with Javascript for a couple of years now, but I've never seen these "+" boxes used before, so I'm in new territory as far as those are concerned. Thanks!
    -Shadow

  • Tiger Server: Default MySQL works for phpMyAdmin but not command line ? ? ?

    Greetings all,
    I followed the excellent instructions at
    http://discussions.apple.com/thread.jspa?threadID=132783&tstart=0
    on upgrading PHP to version 5 and getting (the preinstalled) MySQL setup with phpMyAdmin
    I can connect through the phpMyAdmin, create new dbs, etc. Problem is that now I CAN'T connect from the command line. (I originally set my new root password from the command line and that's the last time I could connect from there!
    Now I get the dreaded ERROR 2002 when I attempt:
    /usr/bin/mysql -h localhost -u root -p
    If I use the IP address or hostname instead of "localhost" (after -h) I get a ERROR 2003. Dropping the -h and hostname from the line above still gets me a ERROR 2002.
    My phpMyAdmin config is a connect type "TCP" not socket, which might be one reason it works and the command line doesn't, but I still don't know where I've gone wrong.
    My /var/mysql/* is all owned by mysql and group www.
    I'm finding lots of people asking about the ERROR 2002, but not finding any solutions (particularly for Tiger Server). I'd prefer to use the preinstalled MySQL to installing a new installation (the thread referenced above says upgrading or removing the MySQL installation is too hard to do) and there has GOT to be a reasonable explanation for why it works with phpMyAdmin, but not the command line.
    Thanks in advance for any replies!
    Many   Mac OS X (10.4.3)  

    You know what? I think when I started mysql_safe, I did it with sudo. Maybe that is my problem?
    If so, what user do I want to start it as? I've seen one suggestion of doing this:
    ./bin/mysqld_safe --user=mysql &

  • Custom F4 help in a BSP application working in Mozilla but not in IE

    Hi,
    I have created a custom F4 help in a BSP application.
    It is working in Mozilla but not in IE. I tried enabling javascript as well but still it is not working.
    Can someone please suggest a possible solution for this?

    Hi,
    See simmilar discussion in thread /thread/1883519 [original link is broken]
    I think this may be helpful for you.
    Thanks,
    Chandra

  • Why does the counter work in MAX, but not Labview?

    Please help, I have been away from Labview for over 3 months, and I am quite rusty....
    Last year, I successfully configured NI9401 to measure period (seconds) by counting the rising edges of my sensor signal.  Since then, I have aquired a new PC, and loaded all my software into it, including the Labview VI's that successfully worked on the old computer.
    I can see the digital signal using MAX and the test panel for the NI9401, so, I know my wiring and my TTL signal is OK, but, when I try to run the attached VI, nothing happens except the error below..  How do I tell this VI to look for the signal on MOD3/CTR0 and channel 14?
    Thanks. I am sure it is a small adjustment...this worked fine a few months ago...not sure what is wrong now.
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    continuously measure period buffered_singlechannel_forum_feb_23_2012.vi ‏20 KB

    OK, now.  Resolved the issue. The vi is fine, but, some shaky wires were identified...worked in MAX but not in the vi.  Now that the connections have been tightened up, it works for both.  Sorry for the inconvenience.
    Dave

  • Works on emulators but not on mobile devices

    Hello,
    My project works on emulators but not on mobile devices (no image and on Samsung it says "unsupported file").
    Please help, I don't know what to do. My configurations: MIDP 2.1, CLDC 1.1.
    Thanks in advance.
    Edited by: Vitali.pom on Oct 27, 2011 12:01 PM

    Edit: I succeeded to solve it accidentally. I did the following: Sign the jar in Netbeans, clean and build, the jar didn't work, I wiped out the .ks from the jar and clean and build again. Now it worked.
    Edited by: Vitali.pom on Oct 30, 2011 1:28 AM

  • Wifi works at home but not when away from home

    My Wifi works at home but not when away from home, what is wrong?  I thought with a phone plan I didn't need to have a wifi connection.

    You either need WiFi or Cellular (or both). If you have neither, you can't connect to the internet.
    Most people use WiFi at home and Cellular while away from home, or connect to public WiFi networks where there are some.

  • Can't FaceTime anymore?  iPad states wifi connected and iPhone 4 states not connected?  I have wireless in my home? Not sure what happened.  Password works for iPad but not on phone?

    iPhone won't connect to wifi.  iPad is connected.  Password working on iPad but not on phone.  Can't upload software update of IOS 7.1 because phone not connecting to wifi?

    Connect iPhone to computer and open iTunes.  You will be prompted to update to iOS 7.0.  Keep your phone connected until the update is finished.

Maybe you are looking for

  • Elliptic curve coprocessor in JCOP

    I have some JCOP41/72K cards with support to ECC. I suppose the cards come with a coprocessor that performs the elliptic curve operations in binary fields, like reduction modulo irreducible polynomial and escalar multiplication of a point. I've alrea

  • Is there a Illustrator plug in (CS4) for cleaning up/smoothing out paths fast?

    I want to clean up some vector's paths quickly, removing nodes and making the paths smoother. Does anyone know of a plug in for cs4 or CS6 that I can purchase or download that will help clean up my vectors faster without manually doing it myself?

  • Want to change latency type on my line

    Last year I had a new line laid into my home after 3 years of problems with the old one. Earlier this year I opted for the upto 20 Meg speed, my line is outputting around 18.6 which is fine however recently i've been experiencing disruption to my lin

  • SQL to do a like compare against two concatenated columns...

    I'm trying to do a like search against two columns that house a first and last name, but people might touch like 'John Doe' Can I do a like search against concatenated columns? Kinda what I want to do ... select * FROM worker_view WHERE (LOWER(E.USUA

  • Different Posting Key for VF01

    Hi, Can we assign a different posting key for Invoices/CMs posted via VF01?  If yes how? can we assign posting key per document type?