What is the url of my servlet.war?

Hey, I'm new to servlet and jboss, I just deploy my servlet to jboss 4.2. The jboss console shows me that it has been successfully deployed

my web.xml contains

<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 does not work

What is the correct site name?

thanks

+4
source share
3 answers

Slashes are the other way around, and after the colon, a double slash occurs:

 http://localhost:8080/mysite/notify 

Also, if your servlet does not support the GET http method, it will not work. You must override the doGet() method.

Also make sure mysite is the name of your war.

+4
source

he does not connect

Possible reasons:

  • The server is not running.
  • The server shut down due to a fatal crash on startup.
  • The hostname / IP is unknown.
  • Invalid port number.

Possible solutions:

  • Start the server.
  • Read server logs for any failures and fix accordingly.
  • Verify that the host name and IP address are correct. Use ping to check if it is responding. Try using an IP address instead of a host name, for example. http://127.0.0.1:8080 (if this works, then the hosts file is dummy).
  • Verify the port number is correct. It is configured in the server settings. Use tracert to check if it exists.
+1
source

Perhaps you can connect to JBoss through JMX and read what the actual runtime setting of your application is. To do this, use jconsole; no connection is required to connect to the local process.

0
source

Source: https://habr.com/ru/post/1310361/


All Articles