You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lothar Krenzien <lk...@web.de> on 2006/03/23 11:34:45 UTC

error calling servlet (in Tomcat)

Hi,

I've developed several servlets (with Tomcat)  in the past without any problems. But now I've a servlet which makes me confusing. When I call the servlet url from a browser I get only error 405 ("HTTP method GET is not supported by this URL"). Because I don't have any idea about the reason I've tried to keep the servlet as simple as possible. But I get always the same error. So what could be wrong ?

-- URL: http://localhost:8080/sunreader/service/TransferData?mod=stream&rtp=dvcp&rnm=DL-NE101-00018.de.ini
-- web.xml

        <!-- sunreader/service/TransferData -->
        <servlet>
          <servlet-name>TransferData</servlet-name>
          <servlet-class>sunreader.service.TransferData</servlet-class>
               ... (some init params) ....
          <load-on-startup>5</load-on-startup>
        </servlet>
        <servlet-mapping>
          <servlet-name>TransferData</servlet-name>
          <url-pattern>/service/TransferData</url-pattern>
        </servlet-mapping>

-- class sunreader.service.TransferData
package sunreader.service;

public class TransferData extends HttpServlet {
 ...
public void doGet ... {

super.doGet(request, response);
ServletOutputStream outStream = null;	
try {
 outStream = response.getOutputStream();			
 outStream.write("Hello World".getBytes());
}
catch (Exception e) {
 log.error ...
 throw ...
}
finally {
if (outStream != null) outStream.close();	
}
}

When I extend this servlet from another working servlet it works fine. But I can't figure out the reason for the above error. Also there seems to be no exception.
Thank for any answer.

Lothar
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error calling servlet (in Tomcat)

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Lothar Krenzien wrote:
> Hi,
>
> I've developed several servlets (with Tomcat)  in the past without any
> problems. But now I've a servlet which makes me confusing. When I call the
> servlet url from a browser I get only error 405 ("HTTP method GET is not
> supported by this URL"). Because I don't have any idea about the reason
> I've tried to keep the servlet as simple as possible. But I get always the
> same error. So what could be wrong ?
>
[...]
>
> -- class sunreader.service.TransferData
> package sunreader.service;
>
> public class TransferData extends HttpServlet {
>  ...
> public void doGet ... {

If you had given the complete method signature, that might have been 
informative. So this is just a WAG: you didn't override
HttpServlet#doGet(HttpServletRequest, HttpServletResponse)
but defined a new method doGet with a different signature. Maybe simply by 
reversing the parameters. For example
public void doGet(HttpServletResponse response, HttpServletRequest request)
won't override any method from HttpServlet.

Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: error calling servlet (in Tomcat)

Posted by MW Janssen <ma...@bedrijven.nl>.
i think its the .de.ini 

-----Oorspronkelijk bericht-----
Van: Lothar Krenzien [mailto:lkrenzien@web.de] 
Verzonden: donderdag 23 maart 2006 11:35
Aan: Tomcat Users List
Onderwerp: error calling servlet (in Tomcat)

Hi,

I've developed several servlets (with Tomcat)  in the past without any
problems. But now I've a servlet which makes me confusing. When I call the
servlet url from a browser I get only error 405 ("HTTP method GET is not
supported by this URL"). Because I don't have any idea about the reason I've
tried to keep the servlet as simple as possible. But I get always the same
error. So what could be wrong ?

-- URL:
http://localhost:8080/sunreader/service/TransferData?mod=stream&rtp=dvcp&rnm
=DL-NE101-00018.de.ini
-- web.xml

        <!-- sunreader/service/TransferData -->
        <servlet>
          <servlet-name>TransferData</servlet-name>
          <servlet-class>sunreader.service.TransferData</servlet-class>
               ... (some init params) ....
          <load-on-startup>5</load-on-startup>
        </servlet>
        <servlet-mapping>
          <servlet-name>TransferData</servlet-name>
          <url-pattern>/service/TransferData</url-pattern>
        </servlet-mapping>

-- class sunreader.service.TransferData
package sunreader.service;

public class TransferData extends HttpServlet {  ...
public void doGet ... {

super.doGet(request, response);
ServletOutputStream outStream = null;	
try {
 outStream = response.getOutputStream();			
 outStream.write("Hello World".getBytes()); } catch (Exception e) {
log.error ...
 throw ...
}
finally {
if (outStream != null) outStream.close();	
}
}

When I extend this servlet from another working servlet it works fine. But I
can't figure out the reason for the above error. Also there seems to be no
exception.
Thank for any answer.

Lothar
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.2.6/288 - Release Date: 22-3-2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.2.6/288 - Release Date: 22-3-2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org