Showing posts with label Tomcat. Show all posts
Showing posts with label Tomcat. Show all posts

Monday, February 11, 2013

java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.

In earlier post, we have seen how to rid of - java.net.BindException: Address already in use: JVM_Bind :8080. Today i saw another similar error, please see the error below.


java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:649)
    at org.apache.tomcat.util.net.AprEndpoint.start(AprEndpoint.java:766)
    at org.apache.coyote.http11.Http11AprProtocol.start(Http11AprProtocol.java:137)
    at org.apache.catalina.connector.Connector.start(Connector.java:1122)
    at org.apache.catalina.core.StandardService.start(StandardService.java:540)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Feb 11, 2013 8:13:42 PM org.apache.catalina.core.StandardService start
SEVERE: Failed to start connector [Connector[HTTP/1.1-8080]]
LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.catalina.connector.Connector.start(Connector.java:1129)
    at org.apache.catalina.core.StandardService.start(StandardService.java:540)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Feb 11, 2013 8:13:42 PM org.apache.coyote.ajp.AjpAprProtocol start
SEVERE: Error starting endpoint

Wednesday, January 23, 2013

Tomcat - If a JSP change does not reflect on your browser


If you face an issue in which you’re JSP changes does not reflect on your browser even after restart of your tomcat server, there could be two possible reasons -

1. Cache - This happens mostly with Internet explorer. IE does caching of JavaScript/CSS and even images in browser, hence even if u make changes to your JSP file it does not reflect on the browser. IE simply displays data from browsers cache instead of getting new data from server. To resolve this you need to clear cache of the browser and perhaps close the browser and reopen it.

2. Tomcat - The work directory is where Tomcat writes any files that it needs during runtime, such as the generated servlet code for JSPs.

Example - C:\apache-tomcat-7.0.11\work\Catalina\localhost

Even if you deployed latest code in your webapp directory changes does not reflect on your browser, the possible reason could be tomcat not able to write changes in work directory. To resolve this you can go to above directory and delete those temp files.

Tuesday, April 24, 2012

Step by step guide to consume a web service

Consuming a web service is very easy all you need to have a WSDL url and an IDE i.e Eclipse for creating web service client. Provide WSDL url and download the stubs. Below mentioned files are automatically generated by WSDL.

Lets create a simple web service client.

Step by step process to create web service client. Please see the screen shots below.





Saturday, April 21, 2012

Step by step guide to publish a simple Hello World web service using tomcat

For running this example, below mentioned particulars are used.
  • Tomcat 7.0.11
  • JDK 1.6.0_21
  • MyEclipse 8.6

In this example, We have an interface HelloWS which contains a abstract method sayHello() which is to be exposed and a class HelloWSImpl.java which will implement HelloWS. Please go through each of the screen shots.

Creating a New Web Service Project