Quantcast

Cannot access my Servlet

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cannot access my Servlet

hschenk
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

Forrest Xia


On Wed, Dec 28, 2011 at 10:00 PM, Hendrik Schenk <[hidden email]> wrote:
Hi,

i am new at geronimo. I tested a few application-server with the same war-file (servlet). But now i have a problem with geronimo.

I deployed my servlet-war-file, but i do not know the exact url. i added in the web.xml the "web-app id" and click ohne link in the admin console of geronimo, but i get an 404-error.

My class looks like this:


 
 
@WebServlet("/FoobarServlet") 
Is the annotation defintion correct?

I saw usage like this:
@WebServlet(name = "Foobar", urlPatterns = { "/FoobarServlet" }) 
public class FoobarServlet extends HttpServlet { 
[...] 
} 

my web.xml looks like this:

 
 
<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
	id="FoobarServletTest" version="3.0"> 
	<display-name>FoobarServlet</display-name> 
	<welcome-file-list> 
		<welcome-file>index.html</welcome-file> 
		<welcome-file>index.htm</welcome-file> 
		<welcome-file>index.jsp</welcome-file> 
		<welcome-file>default.html</welcome-file> 
		<welcome-file>default.htm</welcome-file> 
		<welcome-file>default.jsp</welcome-file> 
	</welcome-file-list> 
</web-app> 



but i cannot reach the servlet under http://localhost:8080/FoobarServletTest/FoobarServlet


if i deploy a jsp file, i can reach it under the webapp-id. every app-server (tomcat, jboss, glassfish) works fine with my war.-archive, only geronimo does not work :(

please help me.

best regards

hschenk
If still problem with G 3.0-beta-1, please share your simple app here. thanks!



--
Thanks!

Regards, Forrest

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

Ivan Xu
The annotation is correct, for the context root for the target web application, you may find it on the admin console, or configure it in the geronimo-web.xml.
I did not remember that value of id could be used to specify the context root in the servlet spec.

2011/12/28 Forrest Xia <[hidden email]>


On Wed, Dec 28, 2011 at 10:00 PM, Hendrik Schenk <[hidden email]> wrote:
Hi,

i am new at geronimo. I tested a few application-server with the same war-file (servlet). But now i have a problem with geronimo.

I deployed my servlet-war-file, but i do not know the exact url. i added in the web.xml the "web-app id" and click ohne link in the admin console of geronimo, but i get an 404-error.

My class looks like this:


 
 
@WebServlet("/FoobarServlet") 
Is the annotation defintion correct?

I saw usage like this:
@WebServlet(name = "Foobar", urlPatterns = { "/FoobarServlet" }) 
public class FoobarServlet extends HttpServlet { 
[...] 
} 

my web.xml looks like this:

 
 
<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
	id="FoobarServletTest" version="3.0"> 
	<display-name>FoobarServlet</display-name> 
	<welcome-file-list> 
		<welcome-file>index.html</welcome-file> 
		<welcome-file>index.htm</welcome-file> 
		<welcome-file>index.jsp</welcome-file> 
		<welcome-file>default.html</welcome-file> 
		<welcome-file>default.htm</welcome-file> 
		<welcome-file>default.jsp</welcome-file> 
	</welcome-file-list> 
</web-app> 



but i cannot reach the servlet under http://localhost:8080/FoobarServletTest/FoobarServlet


if i deploy a jsp file, i can reach it under the webapp-id. every app-server (tomcat, jboss, glassfish) works fine with my war.-archive, only geronimo does not work :(

please help me.

best regards

hschenk
If still problem with G 3.0-beta-1, please share your simple app here. thanks!



--
Thanks!

Regards, Forrest




--
Ivan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

hschenk
In reply to this post by hschenk
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

Ivan Xu
Geronimo 2.2.1 only supports servlet 2.5, if you would like to use WebServlet annotation, you may need to use 3.0-beta-1.

2011/12/28 Hendrik Schenk <[hidden email]>
i am working with eclipse. eclipse generated this annotation.
but i wonder that this servlet works in jboss, glassfish and tomcat. i am using geronimo 2.2.1.

but what should your annotation effect? i will try it, but i do not think that this will work. i think i need the correct url, but cannot find it.

best regard
hschenk





 

----- Original Message -----

From: Forrest Xia

Sent: 12/28/11 03:26 PM

To: [hidden email]

Subject: Re: Cannot access my Servlet




On Wed, Dec 28, 2011 at 10:00 PM, Hendrik Schenk <[hidden email]> wrote:
Hi,

i am new at geronimo. I tested a few application-server with the same war-file (servlet). But now i have a problem with geronimo.

I deployed my servlet-war-file, but i do not know the exact url. i added in the web.xml the "web-app id" and click ohne link in the admin console of geronimo, but i get an 404-error.

My class looks like this:


 
 
 
@WebServlet("/FoobarServlet") 
Is the annotation defintion correct?

I saw usage like this:
 
@WebServlet(name = "Foobar", urlPatterns = { "/FoobarServlet" }) 
 
 
public class FoobarServlet extends HttpServlet { 
[...] 
} 

my web.xml looks like this:

 
 
 
<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
	id="FoobarServletTest" version="3.0"> 
	<display-name>FoobarServlet</display-name> 
	<welcome-file-list> 
		<welcome-file>index.html</welcome-file> 
		<welcome-file>index.htm</welcome-file> 
		<welcome-file>index.jsp</welcome-file> 
		<welcome-file>default.html</welcome-file> 
		<welcome-file>default.htm</welcome-file> 
		<welcome-file>default.jsp</welcome-file> 
	</welcome-file-list> 
</web-app> 



but i cannot reach the servlet under http://localhost:8080/FoobarServletTest/FoobarServlet


if i deploy a jsp file, i can reach it under the webapp-id. every app-server (tomcat, jboss, glassfish) works fine with my war.-archive, only geronimo does not work :(

please help me.

best regards

hschenk
If still problem with G 3.0-beta-1, please share your simple app here. thanks!



--
Thanks!

Regards, Forrest
 

 




--
Ivan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

hschenk
In reply to this post by hschenk
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot access my Servlet

hschenk
In reply to this post by hschenk
CONTENTS DELETED
The author has deleted this message.
Loading...