views:

45

answers:

3

Hey , I am new to servlet and jboss, I just deploy my servlet on jboss 4.2 .jboss console shows me it is deployed successfully

my web.xml contain

<display-name>Notification_Auth_server_simulator</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>
<servlet>
   <description></description>
   <display-name>Notify</display-name>
  <servlet-name>Notify</servlet-name>
  <servlet-class>com.me.Notify</servlet-class>
  </servlet>
  <servlet-mapping>
  <servlet-name>Notify</servlet-name>
 <url-pattern>/notify</url-pattern>
 </servlet-mapping>
  </web-app> 

and for jboss-web.xml

  <jboss-web>
  <context-root>mysite</context-root>
  </jboss-web>

I tried in my browser http://localhost:8080/mysite/notify and it doesn't work

what is the correct site name ?

Thanks

+2  A: 

The slashes are the other way around, and there is a double-slash after the colon:

http://localhost:8080/mysite/notify 

Furthermore, if your servlet doesn't support the GET http method, it won't work. You have to override the doGet() method.

Also make sure mysite is the name of your war.

Bozho
i use this url but it doesn't work , it doesn't connect
worldpython
did you note the other two things?
Bozho
A: 

You can probably attach to running JBoss via JMX and read what are the real runtime setting of your application. Use jconsole for that, connecting to local process needs no configuration.

binary_runner
A: 

it doesn't connect

Possible causes:

  1. The server isn't started.
  2. The server has shut down itself due to a fatal failure during startup.
  3. The hostname/IP is unknown.
  4. The port number is wrong.

Possible solutions:

  1. Start the server.
  2. Read server logs for any failures and fix accordingly.
  3. Verify correctness of hostname and IP. Use ping to check if it responds. Try using IP address instead of hostname e.g. http://127.0.0.1:8080 (if that works, then hosts file is bogus).
  4. Verify correctness of port number. It's configureable in server settings. Use tracert to check if it exist.
BalusC