You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> on 2007/11/14 14:31:56 UTC

[Deploy in JBOSS] Address already in use Exception

Hi all, 
I'm a newbie to CXF and web services in general... 
The thing is that I created a service and a client with CXF and deployed them in JBoss, both of the service and client are working fine except that when I re-deploy the service to JBoss I get a "Address already in use" Exception. 
It looks that JBoss opens a port when I publish the service endpoint, and doesn't close it when I un-deploy the service war file. 
I tried to use the stop() method to un-publish the end point -I called the method in the destroy() method of the listening Servlet- but it didn't work 

I don't know what to do!! the documentation of CXF is very lacks!! 

Any help is very appreciated 

-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Hi All, 
I solved the problem by adding this code into destroy() method of the servlet that publishes my services 

public void destroy() { 
... 
JettyHTTPServerEngineFactory factory = new JettyHTTPServerEngineFactory(); 
JettyHTTPServerEngine jetty = factory.retrieveJettyHTTPServerEngine(9090); 
try { 
jetty.getServer().stop(); 
} catch (Exception e) { 
e.printStackTrace(); 
} 
... 
} 

Thanks for you cooperation, I wish this will help someone else, bye! 
----- Original Message ----- 
From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
To: cxf-user@incubator.apache.org 
Sent: Saturday, December 8, 2007 5:20:01 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Hi All, it's me again 
Dear Saleh, I tried your solution but the endpoints were not published at all! thanks a lot for help. 
================================ 
Dear CXF team, I think what I'm facing is a bug in the CXF itself, what made me say this, is that I made a very simple project with one service that returns "hello world" and tested it using altova [XMLSpy] it works fine, but the problem of unbinding exists, we can't deploy some thing that doesn't unbind in our production servers. 

So, if you don't think it's a bug please help me figure out where is the problem, I'll really appreciate it. 

thank you all in advanced. 
----- Original Message ----- 
From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 7:10:24 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 


Dear Andrew, 
Thanks a lot for your cooperation you did your best, and you was helpful coz even if the problem wasn't solved but at least I could fined something to say to my Boss ;-) 

Dear Saleh, 
Thanks for your reply , I'll try it and feed you back.. 
----- Original Message ----- 
From: "Saleh Al-Ghashmi" <ab...@gmail.com> 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 6:44:27 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 




Andrew Dinn wrote: 
> 
> Hi Eman, 
> 
> Your config files look ok. I'm afraid I don't really understand what is 
> going wrong in that case. 
> 
> Regarding your destroy code I have two comments. Firstly, I was 
> suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
> there is no guarantee that the default bus at the point where your 
> destroy code is run is the same bus as the one you installed at the 
> point where the create code was run. Maybe you should stash the cxf 
> servlet somewhere when you create e.g. attach it to the servlet which is 
> running the create code. Then you can pick it up later and call its 
> destroy method. 
> 
> Hope this helps. If not then I am afraid I am stumped :-( 
> 
> regards, 
> 
> 
> Andrew Dinn JBoss Transactions 
> ------------------------------ 
> JBoss, a Division of Red Hat 
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
> Street, Windsor, Berkshire, 
> SI4 1TE, United Kingdom. 
> Registered in UK and Wales under Company Registration No. 3798903 
> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
> Owens (Ireland) 
> 
> Eman Ali al-Maktari [IT Department] wrote: 
>> Hi Andrew, 
>> I tried to stop the bus using: 
>> public void destroy() { 
>> Bus bus = CXFBusFactory.getDefaultBus(); 
>> if (eCategories.isPublished()){ 
>> System.out.println("I'll stop Categories!"); 
>> eCategories.stop(); 
>> bus.shutdown(false); 
>> System.out.println("I't was stopped"); 
>> } 
>> super.destroy(); 
>> } 
>> 
>> but the problem still exist, I also tried removing 
>> NOTE: this destroy() method is the servlet method. 
>> I also tried to not explicitly create a CXFServlet(), and the problem 
>> happened again and again :-( 
>> 
>> These are my XML files: 
>> ================CXF.XML======================= 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> 
>> <bean id="logInbound" 
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
>> <bean id="logOutbound" 
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
>> 
>> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
>> <property name="inInterceptors"> 
>> <list> 
>> <ref bean="logInbound"/> 
>> </list> 
>> </property> 
>> <property name="outInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> <property name="outFaultInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> </bean> 
>> </beans> 
>> ====================CXF-SERVLET.XML======================== 
>> <?xml version="1.0" encoding="UTF-8"?> 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xmlns:soap="http://cxf.apache.org/bindings/soap" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/bindings/soap 
>> http://cxf.apache.org/schemas/configuration/soap.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> </beans> 
>> 
>> ===================WEB.XML (When I create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet> 
>> <servlet-name>cxf</servlet-name> 
>> <display-name>cxf</display-name> 
>> <description>Apache CXF Endpoint</description> 
>> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>cxf</servlet-name> 
>> <url-pattern>/services/*</url-pattern> 
>> </servlet-mapping> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> ===================WEB.XML (When I don't create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> 
>> =============================================================== 
>> The WebServiceServlet is the servlet where I publish and unpublish the 
>> end points, 
>> 
>> Any help will be really, really, really appreciated. 
>> 
>> 
>> ----- Original Message ----- 
>> From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Thanks a lot Andrew, 
>> 
>> I really needed a clue 
>> I'm going to try the "Stopping Bus" solution as soon as I can, I hope it 
>> will be the solution.. 
>> 
>> for my code, it's written in a servlet that is loaded when the 
>> application deployed (you guest it correctly ;) ) 
>> 
>> Thanks again, I'll feed you back! 
>> 
>> ----- Original Message ----- 
>> From: "Andrew Dinn" <ad...@redhat.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Eman Ali al-Maktari [IT Department] wrote: 
>>> This is my code: 
>>> 
>>> Endpoint eCategories = publishCategories(); 
>>> 
>>> private Endpoint publishCategories() { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
>>> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
>>> CXFServlet cxf = new CXFServlet(); 
>>> Bus bus = cxf.getBus(); 
>>> BusFactory.setDefaultBus(bus); 
>>> Endpoint e = Endpoint.create(categoriesImpl); 
>>> e.publish(address); 
>>> return e; 
>>> } 
>>> public void init(ServletConfig config) throws ServletException { 
>>> super.init(config); 
>>> System.out.println("Server started\\"); 
>>> 
>>> // Categories 
>>> if (!eCategories.isPublished()) { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> eCategories.publish(address); 
>>> } 
>>> } 
>>> 
>>> public void destroy() { 
>>> if (eCategories.isPublished()) eCategories.stop(); 
>>> super.destroy(); 
>>> } 
>> 
>> Ok, I am not certain what is going on because I don't know for sure 
>> where the first segment of code in your listing is invoked from. 
>> Assuming it is run when the app is deployed, I think I see the problem 
>> here. You are explicitly creating a CXFServlet() in your code rather 
>> than relying on cxf/JBoss deployer code to create it. This should mean 
>> that you need to explicitly delete the servlet (and its associated bus 
>> and transport) when your app is undeployed. You can verify this by 
>> checking to see if your destroy method is ever called. If not then I 
>> would expect this to leave the bus and transport holding on to the 
>> socket. Perhaps Dan or one of the other CXF team could confirm this? 
>> 
>> I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
>> cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
>> down the servlet when the app is undeployed. Alternatively, you will 
>> have to work out a way of catching the undeploy in your app code and 
>> deleting the servlet (e.g. if your app deploys some other servlet you 
>> can delete the cxf bus from its destroy method). 
>> 
>> 
>> Andrew Dinn (JBoss Transactions) 
>> -------------------------------- 
>> JBoss, a Division of Red Hat 
>> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
>> Street, Windsor, Berkshire, 
>> SI4 1TE, United Kingdom. 
>> Registered in UK and Wales under Company Registration No. 3798903 
>> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
>> Owens (Ireland) 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> 
Hi Eman, 
I 'll solve your problem because I faced this problem before. I think you 
don't have to do all these things. You have a mistake while publishing the 
endpoint. The problem is you try to publish the endpoint twice at creation 
the endpoint and at publishing it. You just do as following: 

String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
Endpoint e = Endpoint.create(address,categoriesImpl); 
e.publish(categoriesImpl); 

I try it by myself and redeploy war many times and it works fine. 

regards, 

-- 
View this message in context: http://www.nabble.com/-Deploy-in-JBOSS--Address-already-in-use-Exception-tf4805149.html#a13951894 
Sent from the cxf-user mailing list archive at Nabble.com. 




-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Hi All, it's me again 
Dear Saleh, I tried your solution but the endpoints were not published at all! thanks a lot for help. 
================================ 
Dear CXF team, I think what I'm facing is a bug in the CXF itself, what made me say this, is that I made a very simple project with one service that returns "hello world" and tested it using altova [XMLSpy] it works fine, but the problem of unbinding exists, we can't deploy some thing that doesn't unbind in our production servers. 

So, if you don't think it's a bug please help me figure out where is the problem, I'll really appreciate it. 

thank you all in advanced. 
----- Original Message ----- 
From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 7:10:24 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 


Dear Andrew, 
Thanks a lot for your cooperation you did your best, and you was helpful coz even if the problem wasn't solved but at least I could fined something to say to my Boss ;-) 

Dear Saleh, 
Thanks for your reply , I'll try it and feed you back.. 
----- Original Message ----- 
From: "Saleh Al-Ghashmi" <ab...@gmail.com> 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 6:44:27 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 




Andrew Dinn wrote: 
> 
> Hi Eman, 
> 
> Your config files look ok. I'm afraid I don't really understand what is 
> going wrong in that case. 
> 
> Regarding your destroy code I have two comments. Firstly, I was 
> suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
> there is no guarantee that the default bus at the point where your 
> destroy code is run is the same bus as the one you installed at the 
> point where the create code was run. Maybe you should stash the cxf 
> servlet somewhere when you create e.g. attach it to the servlet which is 
> running the create code. Then you can pick it up later and call its 
> destroy method. 
> 
> Hope this helps. If not then I am afraid I am stumped :-( 
> 
> regards, 
> 
> 
> Andrew Dinn JBoss Transactions 
> ------------------------------ 
> JBoss, a Division of Red Hat 
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
> Street, Windsor, Berkshire, 
> SI4 1TE, United Kingdom. 
> Registered in UK and Wales under Company Registration No. 3798903 
> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
> Owens (Ireland) 
> 
> Eman Ali al-Maktari [IT Department] wrote: 
>> Hi Andrew, 
>> I tried to stop the bus using: 
>> public void destroy() { 
>> Bus bus = CXFBusFactory.getDefaultBus(); 
>> if (eCategories.isPublished()){ 
>> System.out.println("I'll stop Categories!"); 
>> eCategories.stop(); 
>> bus.shutdown(false); 
>> System.out.println("I't was stopped"); 
>> } 
>> super.destroy(); 
>> } 
>> 
>> but the problem still exist, I also tried removing 
>> NOTE: this destroy() method is the servlet method. 
>> I also tried to not explicitly create a CXFServlet(), and the problem 
>> happened again and again :-( 
>> 
>> These are my XML files: 
>> ================CXF.XML======================= 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> 
>> <bean id="logInbound" 
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
>> <bean id="logOutbound" 
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
>> 
>> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
>> <property name="inInterceptors"> 
>> <list> 
>> <ref bean="logInbound"/> 
>> </list> 
>> </property> 
>> <property name="outInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> <property name="outFaultInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> </bean> 
>> </beans> 
>> ====================CXF-SERVLET.XML======================== 
>> <?xml version="1.0" encoding="UTF-8"?> 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xmlns:soap="http://cxf.apache.org/bindings/soap" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/bindings/soap 
>> http://cxf.apache.org/schemas/configuration/soap.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> </beans> 
>> 
>> ===================WEB.XML (When I create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet> 
>> <servlet-name>cxf</servlet-name> 
>> <display-name>cxf</display-name> 
>> <description>Apache CXF Endpoint</description> 
>> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>cxf</servlet-name> 
>> <url-pattern>/services/*</url-pattern> 
>> </servlet-mapping> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> ===================WEB.XML (When I don't create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> 
>> =============================================================== 
>> The WebServiceServlet is the servlet where I publish and unpublish the 
>> end points, 
>> 
>> Any help will be really, really, really appreciated. 
>> 
>> 
>> ----- Original Message ----- 
>> From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Thanks a lot Andrew, 
>> 
>> I really needed a clue 
>> I'm going to try the "Stopping Bus" solution as soon as I can, I hope it 
>> will be the solution.. 
>> 
>> for my code, it's written in a servlet that is loaded when the 
>> application deployed (you guest it correctly ;) ) 
>> 
>> Thanks again, I'll feed you back! 
>> 
>> ----- Original Message ----- 
>> From: "Andrew Dinn" <ad...@redhat.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Eman Ali al-Maktari [IT Department] wrote: 
>>> This is my code: 
>>> 
>>> Endpoint eCategories = publishCategories(); 
>>> 
>>> private Endpoint publishCategories() { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
>>> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
>>> CXFServlet cxf = new CXFServlet(); 
>>> Bus bus = cxf.getBus(); 
>>> BusFactory.setDefaultBus(bus); 
>>> Endpoint e = Endpoint.create(categoriesImpl); 
>>> e.publish(address); 
>>> return e; 
>>> } 
>>> public void init(ServletConfig config) throws ServletException { 
>>> super.init(config); 
>>> System.out.println("Server started\\"); 
>>> 
>>> // Categories 
>>> if (!eCategories.isPublished()) { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> eCategories.publish(address); 
>>> } 
>>> } 
>>> 
>>> public void destroy() { 
>>> if (eCategories.isPublished()) eCategories.stop(); 
>>> super.destroy(); 
>>> } 
>> 
>> Ok, I am not certain what is going on because I don't know for sure 
>> where the first segment of code in your listing is invoked from. 
>> Assuming it is run when the app is deployed, I think I see the problem 
>> here. You are explicitly creating a CXFServlet() in your code rather 
>> than relying on cxf/JBoss deployer code to create it. This should mean 
>> that you need to explicitly delete the servlet (and its associated bus 
>> and transport) when your app is undeployed. You can verify this by 
>> checking to see if your destroy method is ever called. If not then I 
>> would expect this to leave the bus and transport holding on to the 
>> socket. Perhaps Dan or one of the other CXF team could confirm this? 
>> 
>> I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
>> cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
>> down the servlet when the app is undeployed. Alternatively, you will 
>> have to work out a way of catching the undeploy in your app code and 
>> deleting the servlet (e.g. if your app deploys some other servlet you 
>> can delete the cxf bus from its destroy method). 
>> 
>> 
>> Andrew Dinn (JBoss Transactions) 
>> -------------------------------- 
>> JBoss, a Division of Red Hat 
>> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
>> Street, Windsor, Berkshire, 
>> SI4 1TE, United Kingdom. 
>> Registered in UK and Wales under Company Registration No. 3798903 
>> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
>> Owens (Ireland) 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> 
Hi Eman, 
I 'll solve your problem because I faced this problem before. I think you 
don't have to do all these things. You have a mistake while publishing the 
endpoint. The problem is you try to publish the endpoint twice at creation 
the endpoint and at publishing it. You just do as following: 

String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
Endpoint e = Endpoint.create(address,categoriesImpl); 
e.publish(categoriesImpl); 

I try it by myself and redeploy war many times and it works fine. 

regards, 

-- 
View this message in context: http://www.nabble.com/-Deploy-in-JBOSS--Address-already-in-use-Exception-tf4805149.html#a13951894 
Sent from the cxf-user mailing list archive at Nabble.com. 




-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Dear Andrew, 
Thanks a lot for your cooperation you did your best, and you was helpful coz even if the problem wasn't solved but at least I could fined something to say to my Boss ;-) 

Dear Saleh, 
Thanks for your reply , I'll try it and feed you back.. 
----- Original Message ----- 
From: "Saleh Al-Ghashmi" <ab...@gmail.com> 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 6:44:27 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 




Andrew Dinn wrote: 
> 
> Hi Eman, 
> 
> Your config files look ok. I'm afraid I don't really understand what is 
> going wrong in that case. 
> 
> Regarding your destroy code I have two comments. Firstly, I was 
> suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
> there is no guarantee that the default bus at the point where your 
> destroy code is run is the same bus as the one you installed at the 
> point where the create code was run. Maybe you should stash the cxf 
> servlet somewhere when you create e.g. attach it to the servlet which is 
> running the create code. Then you can pick it up later and call its 
> destroy method. 
> 
> Hope this helps. If not then I am afraid I am stumped :-( 
> 
> regards, 
> 
> 
> Andrew Dinn JBoss Transactions 
> ------------------------------ 
> JBoss, a Division of Red Hat 
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
> Street, Windsor, Berkshire, 
> SI4 1TE, United Kingdom. 
> Registered in UK and Wales under Company Registration No. 3798903 
> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
> Owens (Ireland) 
> 
> Eman Ali al-Maktari [IT Department] wrote: 
>> Hi Andrew, 
>> I tried to stop the bus using: 
>> public void destroy() { 
>> Bus bus = CXFBusFactory.getDefaultBus(); 
>> if (eCategories.isPublished()){ 
>> System.out.println("I'll stop Categories!"); 
>> eCategories.stop(); 
>> bus.shutdown(false); 
>> System.out.println("I't was stopped"); 
>> } 
>> super.destroy(); 
>> } 
>> 
>> but the problem still exist, I also tried removing 
>> NOTE: this destroy() method is the servlet method. 
>> I also tried to not explicitly create a CXFServlet(), and the problem 
>> happened again and again :-( 
>> 
>> These are my XML files: 
>> ================CXF.XML======================= 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> 
>> <bean id="logInbound" 
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
>> <bean id="logOutbound" 
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
>> 
>> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
>> <property name="inInterceptors"> 
>> <list> 
>> <ref bean="logInbound"/> 
>> </list> 
>> </property> 
>> <property name="outInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> <property name="outFaultInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> </bean> 
>> </beans> 
>> ====================CXF-SERVLET.XML======================== 
>> <?xml version="1.0" encoding="UTF-8"?> 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xmlns:soap="http://cxf.apache.org/bindings/soap" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/bindings/soap 
>> http://cxf.apache.org/schemas/configuration/soap.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> </beans> 
>> 
>> ===================WEB.XML (When I create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet> 
>> <servlet-name>cxf</servlet-name> 
>> <display-name>cxf</display-name> 
>> <description>Apache CXF Endpoint</description> 
>> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>cxf</servlet-name> 
>> <url-pattern>/services/*</url-pattern> 
>> </servlet-mapping> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> ===================WEB.XML (When I don't create the CXFServlet 
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> 
>> =============================================================== 
>> The WebServiceServlet is the servlet where I publish and unpublish the 
>> end points, 
>> 
>> Any help will be really, really, really appreciated. 
>> 
>> 
>> ----- Original Message ----- 
>> From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Thanks a lot Andrew, 
>> 
>> I really needed a clue 
>> I'm going to try the "Stopping Bus" solution as soon as I can, I hope it 
>> will be the solution.. 
>> 
>> for my code, it's written in a servlet that is loaded when the 
>> application deployed (you guest it correctly ;) ) 
>> 
>> Thanks again, I'll feed you back! 
>> 
>> ----- Original Message ----- 
>> From: "Andrew Dinn" <ad...@redhat.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Eman Ali al-Maktari [IT Department] wrote: 
>>> This is my code: 
>>> 
>>> Endpoint eCategories = publishCategories(); 
>>> 
>>> private Endpoint publishCategories() { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
>>> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
>>> CXFServlet cxf = new CXFServlet(); 
>>> Bus bus = cxf.getBus(); 
>>> BusFactory.setDefaultBus(bus); 
>>> Endpoint e = Endpoint.create(categoriesImpl); 
>>> e.publish(address); 
>>> return e; 
>>> } 
>>> public void init(ServletConfig config) throws ServletException { 
>>> super.init(config); 
>>> System.out.println("Server started\\"); 
>>> 
>>> // Categories 
>>> if (!eCategories.isPublished()) { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> eCategories.publish(address); 
>>> } 
>>> } 
>>> 
>>> public void destroy() { 
>>> if (eCategories.isPublished()) eCategories.stop(); 
>>> super.destroy(); 
>>> } 
>> 
>> Ok, I am not certain what is going on because I don't know for sure 
>> where the first segment of code in your listing is invoked from. 
>> Assuming it is run when the app is deployed, I think I see the problem 
>> here. You are explicitly creating a CXFServlet() in your code rather 
>> than relying on cxf/JBoss deployer code to create it. This should mean 
>> that you need to explicitly delete the servlet (and its associated bus 
>> and transport) when your app is undeployed. You can verify this by 
>> checking to see if your destroy method is ever called. If not then I 
>> would expect this to leave the bus and transport holding on to the 
>> socket. Perhaps Dan or one of the other CXF team could confirm this? 
>> 
>> I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
>> cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
>> down the servlet when the app is undeployed. Alternatively, you will 
>> have to work out a way of catching the undeploy in your app code and 
>> deleting the servlet (e.g. if your app deploys some other servlet you 
>> can delete the cxf bus from its destroy method). 
>> 
>> 
>> Andrew Dinn (JBoss Transactions) 
>> -------------------------------- 
>> JBoss, a Division of Red Hat 
>> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
>> Street, Windsor, Berkshire, 
>> SI4 1TE, United Kingdom. 
>> Registered in UK and Wales under Company Registration No. 3798903 
>> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
>> Owens (Ireland) 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> 
Hi Eman, 
I 'll solve your problem because I faced this problem before. I think you 
don't have to do all these things. You have a mistake while publishing the 
endpoint. The problem is you try to publish the endpoint twice at creation 
the endpoint and at publishing it. You just do as following: 

String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
Endpoint e = Endpoint.create(address,categoriesImpl); 
e.publish(categoriesImpl); 

I try it by myself and redeploy war many times and it works fine. 

regards, 

-- 
View this message in context: http://www.nabble.com/-Deploy-in-JBOSS--Address-already-in-use-Exception-tf4805149.html#a13951894 
Sent from the cxf-user mailing list archive at Nabble.com. 




-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Saleh Al-Ghashmi <ab...@gmail.com>.


Andrew Dinn wrote:
> 
> Hi Eman,
> 
> Your config files look ok. I'm afraid I don't really understand what is 
> going wrong in that case.
> 
> Regarding your destroy code I have two comments. Firstly, I was 
> suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
> there is no guarantee that the default bus at the point where your 
> destroy code is run is the same bus as the one you installed at the 
> point where the create code was run. Maybe you should stash the cxf 
> servlet somewhere when you create e.g. attach it to the servlet which is 
> running the create code. Then you can pick it up later and call its 
> destroy method.
> 
> Hope this helps. If not then I am afraid I am stumped :-(
> 
> regards,
> 
> 
> Andrew Dinn JBoss Transactions
> ------------------------------
> JBoss, a Division of Red Hat
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
> Street, Windsor, Berkshire,
> SI4 1TE, United Kingdom.
> Registered in UK and Wales under Company Registration No. 3798903
> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
> Owens (Ireland)
> 
> Eman Ali al-Maktari [IT Department] wrote:
>> Hi Andrew, 
>> I tried to stop the bus using: 
>> public void destroy() { 
>> Bus bus = CXFBusFactory.getDefaultBus(); 
>> if (eCategories.isPublished()){ 
>> System.out.println("I'll stop Categories!"); 
>> eCategories.stop(); 
>> bus.shutdown(false); 
>> System.out.println("I't was stopped"); 
>> } 
>> super.destroy(); 
>> } 
>> 
>> but the problem still exist, I also tried removing 
>> NOTE: this destroy() method is the servlet method. 
>> I also tried to not explicitly create a CXFServlet(), and the problem
>> happened again and again :-( 
>> 
>> These are my XML files: 
>> ================CXF.XML======================= 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> 
>> <bean id="logInbound"
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
>> <bean id="logOutbound"
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
>> 
>> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
>> <property name="inInterceptors"> 
>> <list> 
>> <ref bean="logInbound"/> 
>> </list> 
>> </property> 
>> <property name="outInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> <property name="outFaultInterceptors"> 
>> <list> 
>> <ref bean="logOutbound"/> 
>> </list> 
>> </property> 
>> </bean> 
>> </beans> 
>> ====================CXF-SERVLET.XML======================== 
>> <?xml version="1.0" encoding="UTF-8"?> 
>> <beans xmlns="http://www.springframework.org/schema/beans" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:jaxws="http://cxf.apache.org/jaxws" 
>> xmlns:soap="http://cxf.apache.org/bindings/soap" 
>> xsi:schemaLocation=" 
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
>> http://cxf.apache.org/bindings/soap
>> http://cxf.apache.org/schemas/configuration/soap.xsd 
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
>> </beans> 
>> 
>> ===================WEB.XML (When I create the CXFServlet
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet> 
>> <servlet-name>cxf</servlet-name> 
>> <display-name>cxf</display-name> 
>> <description>Apache CXF Endpoint</description> 
>> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>cxf</servlet-name> 
>> <url-pattern>/services/*</url-pattern> 
>> </servlet-mapping> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> ===================WEB.XML (When I don't create the CXFServlet
>> explicitly)================================= 
>> <!DOCTYPE web-app PUBLIC 
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
>> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
>> 
>> <web-app> 
>> <servlet> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
>> <load-on-startup>1</load-on-startup> 
>> </servlet> 
>> <servlet-mapping> 
>> <servlet-name>WebServiceServlet</servlet-name> 
>> <url-pattern>/WebServiceServlet</url-pattern> 
>> </servlet-mapping> 
>> </web-app> 
>> 
>> =============================================================== 
>> The WebServiceServlet is the servlet where I publish and unpublish the
>> end points, 
>> 
>> Any help will be really, really, really appreciated. 
>> 
>> 
>> ----- Original Message ----- 
>> From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Thanks a lot Andrew, 
>> 
>> I really needed a clue 
>> I'm going to try the "Stopping Bus" solution as soon as I can, I hope it
>> will be the solution.. 
>> 
>> for my code, it's written in a servlet that is loaded when the
>> application deployed (you guest it correctly ;) ) 
>> 
>> Thanks again, I'll feed you back! 
>> 
>> ----- Original Message ----- 
>> From: "Andrew Dinn" <ad...@redhat.com> 
>> To: cxf-user@incubator.apache.org 
>> Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
>> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
>> 
>> Eman Ali al-Maktari [IT Department] wrote: 
>>> This is my code: 
>>>
>>> Endpoint eCategories = publishCategories(); 
>>>
>>> private Endpoint publishCategories() { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
>>> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
>>> CXFServlet cxf = new CXFServlet(); 
>>> Bus bus = cxf.getBus(); 
>>> BusFactory.setDefaultBus(bus); 
>>> Endpoint e = Endpoint.create(categoriesImpl); 
>>> e.publish(address); 
>>> return e; 
>>> } 
>>> public void init(ServletConfig config) throws ServletException { 
>>> super.init(config); 
>>> System.out.println("Server started\\"); 
>>>
>>> // Categories 
>>> if (!eCategories.isPublished()) { 
>>> String address = "http://localhost:9090/sn_categories"; 
>>> eCategories.publish(address); 
>>> } 
>>> } 
>>>
>>> public void destroy() { 
>>> if (eCategories.isPublished()) eCategories.stop(); 
>>> super.destroy(); 
>>> } 
>> 
>> Ok, I am not certain what is going on because I don't know for sure 
>> where the first segment of code in your listing is invoked from. 
>> Assuming it is run when the app is deployed, I think I see the problem 
>> here. You are explicitly creating a CXFServlet() in your code rather 
>> than relying on cxf/JBoss deployer code to create it. This should mean 
>> that you need to explicitly delete the servlet (and its associated bus 
>> and transport) when your app is undeployed. You can verify this by 
>> checking to see if your destroy method is ever called. If not then I 
>> would expect this to leave the bus and transport holding on to the 
>> socket. Perhaps Dan or one of the other CXF team could confirm this? 
>> 
>> I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
>> cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
>> down the servlet when the app is undeployed. Alternatively, you will 
>> have to work out a way of catching the undeploy in your app code and 
>> deleting the servlet (e.g. if your app deploys some other servlet you 
>> can delete the cxf bus from its destroy method). 
>> 
>> 
>> Andrew Dinn (JBoss Transactions) 
>> -------------------------------- 
>> JBoss, a Division of Red Hat 
>> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
>> Street, Windsor, Berkshire, 
>> SI4 1TE, United Kingdom. 
>> Registered in UK and Wales under Company Registration No. 3798903 
>> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
>> Owens (Ireland) 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> 
Hi Eman,
I 'll solve your problem because I faced this problem before. I think you
don't have to do all these things. You have a mistake while publishing the
endpoint. The problem is you try to publish the endpoint twice at creation
the endpoint and at publishing it. You just do as following:

String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
Endpoint e = Endpoint.create(address,categoriesImpl); 
e.publish(categoriesImpl);

I try it by myself and redeploy war many times and it works fine.

regards, 

-- 
View this message in context: http://www.nabble.com/-Deploy-in-JBOSS--Address-already-in-use-Exception-tf4805149.html#a13951894
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [Deploy in JBOSS] Address already in use Exception

Posted by Andrew Dinn <ad...@redhat.com>.
Hi Eman,

Your config files look ok. I'm afraid I don't really understand what is 
going wrong in that case.

Regarding your destroy code I have two comments. Firstly, I was 
suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
there is no guarantee that the default bus at the point where your 
destroy code is run is the same bus as the one you installed at the 
point where the create code was run. Maybe you should stash the cxf 
servlet somewhere when you create e.g. attach it to the servlet which is 
running the create code. Then you can pick it up later and call its 
destroy method.

Hope this helps. If not then I am afraid I am stumped :-(

regards,


Andrew Dinn JBoss Transactions
------------------------------
JBoss, a Division of Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland)

Eman Ali al-Maktari [IT Department] wrote:
> Hi Andrew, 
> I tried to stop the bus using: 
> public void destroy() { 
> Bus bus = CXFBusFactory.getDefaultBus(); 
> if (eCategories.isPublished()){ 
> System.out.println("I'll stop Categories!"); 
> eCategories.stop(); 
> bus.shutdown(false); 
> System.out.println("I't was stopped"); 
> } 
> super.destroy(); 
> } 
> 
> but the problem still exist, I also tried removing 
> NOTE: this destroy() method is the servlet method. 
> I also tried to not explicitly create a CXFServlet(), and the problem happened again and again :-( 
> 
> These are my XML files: 
> ================CXF.XML======================= 
> <beans xmlns="http://www.springframework.org/schema/beans" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:jaxws="http://cxf.apache.org/jaxws" 
> xsi:schemaLocation=" 
> http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
> 
> <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
> <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
> 
> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
> <property name="inInterceptors"> 
> <list> 
> <ref bean="logInbound"/> 
> </list> 
> </property> 
> <property name="outInterceptors"> 
> <list> 
> <ref bean="logOutbound"/> 
> </list> 
> </property> 
> <property name="outFaultInterceptors"> 
> <list> 
> <ref bean="logOutbound"/> 
> </list> 
> </property> 
> </bean> 
> </beans> 
> ====================CXF-SERVLET.XML======================== 
> <?xml version="1.0" encoding="UTF-8"?> 
> <beans xmlns="http://www.springframework.org/schema/beans" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:jaxws="http://cxf.apache.org/jaxws" 
> xmlns:soap="http://cxf.apache.org/bindings/soap" 
> xsi:schemaLocation=" 
> http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
> http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd 
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
> </beans> 
> 
> ===================WEB.XML (When I create the CXFServlet explicitly)================================= 
> <!DOCTYPE web-app PUBLIC 
> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
> 
> <web-app> 
> <servlet> 
> <servlet-name>WebServiceServlet</servlet-name> 
> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
> <load-on-startup>1</load-on-startup> 
> </servlet> 
> <servlet> 
> <servlet-name>cxf</servlet-name> 
> <display-name>cxf</display-name> 
> <description>Apache CXF Endpoint</description> 
> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
> <load-on-startup>1</load-on-startup> 
> </servlet> 
> <servlet-mapping> 
> <servlet-name>cxf</servlet-name> 
> <url-pattern>/services/*</url-pattern> 
> </servlet-mapping> 
> <servlet-mapping> 
> <servlet-name>WebServiceServlet</servlet-name> 
> <url-pattern>/WebServiceServlet</url-pattern> 
> </servlet-mapping> 
> </web-app> 
> ===================WEB.XML (When I don't create the CXFServlet explicitly)================================= 
> <!DOCTYPE web-app PUBLIC 
> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
> "http://java.sun.com/dtd/web-app_2_3.dtd" > 
> 
> <web-app> 
> <servlet> 
> <servlet-name>WebServiceServlet</servlet-name> 
> <servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
> <load-on-startup>1</load-on-startup> 
> </servlet> 
> <servlet-mapping> 
> <servlet-name>WebServiceServlet</servlet-name> 
> <url-pattern>/WebServiceServlet</url-pattern> 
> </servlet-mapping> 
> </web-app> 
> 
> =============================================================== 
> The WebServiceServlet is the servlet where I publish and unpublish the end points, 
> 
> Any help will be really, really, really appreciated. 
> 
> 
> ----- Original Message ----- 
> From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
> To: cxf-user@incubator.apache.org 
> Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
> 
> Thanks a lot Andrew, 
> 
> I really needed a clue 
> I'm going to try the "Stopping Bus" solution as soon as I can, I hope it will be the solution.. 
> 
> for my code, it's written in a servlet that is loaded when the application deployed (you guest it correctly ;) ) 
> 
> Thanks again, I'll feed you back! 
> 
> ----- Original Message ----- 
> From: "Andrew Dinn" <ad...@redhat.com> 
> To: cxf-user@incubator.apache.org 
> Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
> Subject: Re: [Deploy in JBOSS] Address already in use Exception 
> 
> Eman Ali al-Maktari [IT Department] wrote: 
>> This is my code: 
>>
>> Endpoint eCategories = publishCategories(); 
>>
>> private Endpoint publishCategories() { 
>> String address = "http://localhost:9090/sn_categories"; 
>> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
>> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
>> CXFServlet cxf = new CXFServlet(); 
>> Bus bus = cxf.getBus(); 
>> BusFactory.setDefaultBus(bus); 
>> Endpoint e = Endpoint.create(categoriesImpl); 
>> e.publish(address); 
>> return e; 
>> } 
>> public void init(ServletConfig config) throws ServletException { 
>> super.init(config); 
>> System.out.println("Server started\\"); 
>>
>> // Categories 
>> if (!eCategories.isPublished()) { 
>> String address = "http://localhost:9090/sn_categories"; 
>> eCategories.publish(address); 
>> } 
>> } 
>>
>> public void destroy() { 
>> if (eCategories.isPublished()) eCategories.stop(); 
>> super.destroy(); 
>> } 
> 
> Ok, I am not certain what is going on because I don't know for sure 
> where the first segment of code in your listing is invoked from. 
> Assuming it is run when the app is deployed, I think I see the problem 
> here. You are explicitly creating a CXFServlet() in your code rather 
> than relying on cxf/JBoss deployer code to create it. This should mean 
> that you need to explicitly delete the servlet (and its associated bus 
> and transport) when your app is undeployed. You can verify this by 
> checking to see if your destroy method is ever called. If not then I 
> would expect this to leave the bus and transport holding on to the 
> socket. Perhaps Dan or one of the other CXF team could confirm this? 
> 
> I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
> cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
> down the servlet when the app is undeployed. Alternatively, you will 
> have to work out a way of catching the undeploy in your app code and 
> deleting the servlet (e.g. if your app deploys some other servlet you 
> can delete the cxf bus from its destroy method). 
> 
> 
> Andrew Dinn (JBoss Transactions) 
> -------------------------------- 
> JBoss, a Division of Red Hat 
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
> Street, Windsor, Berkshire, 
> SI4 1TE, United Kingdom. 
> Registered in UK and Wales under Company Registration No. 3798903 
> Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
> Owens (Ireland) 
> 
> 
> 
> 
> 



Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Hi Andrew, 
I tried to stop the bus using: 
public void destroy() { 
Bus bus = CXFBusFactory.getDefaultBus(); 
if (eCategories.isPublished()){ 
System.out.println("I'll stop Categories!"); 
eCategories.stop(); 
bus.shutdown(false); 
System.out.println("I't was stopped"); 
} 
super.destroy(); 
} 

but the problem still exist, I also tried removing 
NOTE: this destroy() method is the servlet method. 
I also tried to not explicitly create a CXFServlet(), and the problem happened again and again :-( 

These are my XML files: 
================CXF.XML======================= 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:jaxws="http://cxf.apache.org/jaxws" 
xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 

<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 

<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
<property name="inInterceptors"> 
<list> 
<ref bean="logInbound"/> 
</list> 
</property> 
<property name="outInterceptors"> 
<list> 
<ref bean="logOutbound"/> 
</list> 
</property> 
<property name="outFaultInterceptors"> 
<list> 
<ref bean="logOutbound"/> 
</list> 
</property> 
</bean> 
</beans> 
====================CXF-SERVLET.XML======================== 
<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:jaxws="http://cxf.apache.org/jaxws" 
xmlns:soap="http://cxf.apache.org/bindings/soap" 
xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd 
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
</beans> 

===================WEB.XML (When I create the CXFServlet explicitly)================================= 
<!DOCTYPE web-app PUBLIC 
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
"http://java.sun.com/dtd/web-app_2_3.dtd" > 

<web-app> 
<servlet> 
<servlet-name>WebServiceServlet</servlet-name> 
<servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
<load-on-startup>1</load-on-startup> 
</servlet> 
<servlet> 
<servlet-name>cxf</servlet-name> 
<display-name>cxf</display-name> 
<description>Apache CXF Endpoint</description> 
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> 
<load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
<servlet-name>cxf</servlet-name> 
<url-pattern>/services/*</url-pattern> 
</servlet-mapping> 
<servlet-mapping> 
<servlet-name>WebServiceServlet</servlet-name> 
<url-pattern>/WebServiceServlet</url-pattern> 
</servlet-mapping> 
</web-app> 
===================WEB.XML (When I don't create the CXFServlet explicitly)================================= 
<!DOCTYPE web-app PUBLIC 
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
"http://java.sun.com/dtd/web-app_2_3.dtd" > 

<web-app> 
<servlet> 
<servlet-name>WebServiceServlet</servlet-name> 
<servlet-class>com.lit.linkinnews.WebServiceServlet</servlet-class> 
<load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
<servlet-name>WebServiceServlet</servlet-name> 
<url-pattern>/WebServiceServlet</url-pattern> 
</servlet-mapping> 
</web-app> 

=============================================================== 
The WebServiceServlet is the servlet where I publish and unpublish the end points, 

Any help will be really, really, really appreciated. 


----- Original Message ----- 
From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 21, 2007 5:33:51 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Thanks a lot Andrew, 

I really needed a clue 
I'm going to try the "Stopping Bus" solution as soon as I can, I hope it will be the solution.. 

for my code, it's written in a servlet that is loaded when the application deployed (you guest it correctly ;) ) 

Thanks again, I'll feed you back! 

----- Original Message ----- 
From: "Andrew Dinn" <ad...@redhat.com> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Eman Ali al-Maktari [IT Department] wrote: 
> This is my code: 
> 
> Endpoint eCategories = publishCategories(); 
> 
> private Endpoint publishCategories() { 
> String address = "http://localhost:9090/sn_categories"; 
> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
> CXFServlet cxf = new CXFServlet(); 
> Bus bus = cxf.getBus(); 
> BusFactory.setDefaultBus(bus); 
> Endpoint e = Endpoint.create(categoriesImpl); 
> e.publish(address); 
> return e; 
> } 
> public void init(ServletConfig config) throws ServletException { 
> super.init(config); 
> System.out.println("Server started\\"); 
> 
> // Categories 
> if (!eCategories.isPublished()) { 
> String address = "http://localhost:9090/sn_categories"; 
> eCategories.publish(address); 
> } 
> } 
> 
> public void destroy() { 
> if (eCategories.isPublished()) eCategories.stop(); 
> super.destroy(); 
> } 

Ok, I am not certain what is going on because I don't know for sure 
where the first segment of code in your listing is invoked from. 
Assuming it is run when the app is deployed, I think I see the problem 
here. You are explicitly creating a CXFServlet() in your code rather 
than relying on cxf/JBoss deployer code to create it. This should mean 
that you need to explicitly delete the servlet (and its associated bus 
and transport) when your app is undeployed. You can verify this by 
checking to see if your destroy method is ever called. If not then I 
would expect this to leave the bus and transport holding on to the 
socket. Perhaps Dan or one of the other CXF team could confirm this? 

I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
down the servlet when the app is undeployed. Alternatively, you will 
have to work out a way of catching the undeploy in your app code and 
deleting the servlet (e.g. if your app deploys some other servlet you 
can delete the cxf bus from its destroy method). 


Andrew Dinn (JBoss Transactions) 
-------------------------------- 
JBoss, a Division of Red Hat 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire, 
SI4 1TE, United Kingdom. 
Registered in UK and Wales under Company Registration No. 3798903 
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland) 





-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Thanks a lot Andrew, 

I really needed a clue 
I'm going to try the "Stopping Bus" solution as soon as I can, I hope it will be the solution.. 

for my code, it's written in a servlet that is loaded when the application deployed (you guest it correctly ;) ) 

Thanks again, I'll feed you back! 

----- Original Message ----- 
From: "Andrew Dinn" <ad...@redhat.com> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 21, 2007 12:18:02 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Eman Ali al-Maktari [IT Department] wrote: 
> This is my code: 
> 
> Endpoint eCategories = publishCategories(); 
> 
> private Endpoint publishCategories() { 
> String address = "http://localhost:9090/sn_categories"; 
> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
> CXFServlet cxf = new CXFServlet(); 
> Bus bus = cxf.getBus(); 
> BusFactory.setDefaultBus(bus); 
> Endpoint e = Endpoint.create(categoriesImpl); 
> e.publish(address); 
> return e; 
> } 
> public void init(ServletConfig config) throws ServletException { 
> super.init(config); 
> System.out.println("Server started\\"); 
> 
> // Categories 
> if (!eCategories.isPublished()) { 
> String address = "http://localhost:9090/sn_categories"; 
> eCategories.publish(address); 
> } 
> } 
> 
> public void destroy() { 
> if (eCategories.isPublished()) eCategories.stop(); 
> super.destroy(); 
> } 

Ok, I am not certain what is going on because I don't know for sure 
where the first segment of code in your listing is invoked from. 
Assuming it is run when the app is deployed, I think I see the problem 
here. You are explicitly creating a CXFServlet() in your code rather 
than relying on cxf/JBoss deployer code to create it. This should mean 
that you need to explicitly delete the servlet (and its associated bus 
and transport) when your app is undeployed. You can verify this by 
checking to see if your destroy method is ever called. If not then I 
would expect this to leave the bus and transport holding on to the 
socket. Perhaps Dan or one of the other CXF team could confirm this? 

I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
down the servlet when the app is undeployed. Alternatively, you will 
have to work out a way of catching the undeploy in your app code and 
deleting the servlet (e.g. if your app deploys some other servlet you 
can delete the cxf bus from its destroy method). 


Andrew Dinn (JBoss Transactions) 
-------------------------------- 
JBoss, a Division of Red Hat 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire, 
SI4 1TE, United Kingdom. 
Registered in UK and Wales under Company Registration No. 3798903 
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland) 





-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Andrew Dinn <ad...@redhat.com>.
Eman Ali al-Maktari [IT Department] wrote:
> This is my code: 
> 
> Endpoint eCategories = publishCategories(); 
> 
> private Endpoint publishCategories() { 
> String address = "http://localhost:9090/sn_categories"; 
> CategoriesImpl categoriesImpl = new CategoriesImpl(); 
> //Endpoint e = Endpoint.publish(address, categoriesImpl); 
> CXFServlet cxf = new CXFServlet(); 
> Bus bus = cxf.getBus(); 
> BusFactory.setDefaultBus(bus); 
> Endpoint e = Endpoint.create(categoriesImpl); 
> e.publish(address); 
> return e; 
> } 
> public void init(ServletConfig config) throws ServletException { 
> super.init(config); 
> System.out.println("Server started\\"); 
> 
> // Categories 
> if (!eCategories.isPublished()) { 
> String address = "http://localhost:9090/sn_categories"; 
> eCategories.publish(address); 
> } 
> } 
> 
> public void destroy() { 
> if (eCategories.isPublished()) eCategories.stop(); 
> super.destroy(); 
> }

Ok, I am not certain what is going on because I don't know for sure 
where the first segment of code in your listing is invoked from. 
Assuming it is run when the app is deployed, I think I see the problem 
here. You are explicitly creating a CXFServlet() in your code rather 
than relying on cxf/JBoss deployer code to create it. This should mean 
that you need to explicitly delete the servlet (and its associated bus 
and transport) when your app is undeployed. You can verify this by 
checking to see if your destroy method is ever called. If not then I 
would expect this to leave the bus and transport holding on to the 
socket. Perhaps Dan or one of the other CXF team could confirm this?

I suggest you configure the cxf.xml/cxf-servlet.xml files to deploy your 
cxf servlet. This should ensure that JBoss and CXF co-operate to shut 
down the servlet when the app is undeployed. Alternatively, you will 
have to work out a way of catching the undeploy in your app code and 
deleting the servlet (e.g. if your app deploys some other servlet you 
can delete the cxf bus from its destroy method).


Andrew Dinn (JBoss Transactions)
--------------------------------
JBoss, a Division of Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland)



Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
----- Forwarded Message ----- 
From: "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com> 
To: cxf-user@incubator.apache.org 
Sent: Saturday, November 17, 2007 4:48:46 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 



----- Original Message ----- 
From: "Andrew Dinn" <ad...@redhat.com> 
To: cxf-user@incubator.apache.org 
Sent: Thursday, November 15, 2007 4:06:30 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Eman Ali al-Maktari [IT Department] wrote: 
> > Dear Andrew, 
>> I tried on both 4.0.5 and 4.2.1, both on Windows and Linux 
>> For the Deployment I tried the two methods: deleting then copying, and overwriting. 
>> I checked the temp folder it's clean. 
>> 
>> Do you think it's normal? 

>err, no not really, I don't know how JBoss can do something like this. 

>What does the app in your war file do? 
my application is a web service that return to the user set of information retrieve from a database, I publish the end point of the service in the init() method of the servlet and I unpublish it in the destroy() method as follows: 
This is my code: 

Endpoint eCategories = publishCategories(); 

private Endpoint publishCategories() { 
String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
//Endpoint e = Endpoint.publish(address, categoriesImpl); 
CXFServlet cxf = new CXFServlet(); 
Bus bus = cxf.getBus(); 
BusFactory.setDefaultBus(bus); 
Endpoint e = Endpoint.create(categoriesImpl); 
e.publish(address); 
return e; 
} 
public void init(ServletConfig config) throws ServletException { 
super.init(config); 
System.out.println("Server started\\"); 

// Categories 
if (!eCategories.isPublished()) { 
String address = "http://localhost:9090/sn_categories"; 
eCategories.publish(address); 
} 
} 

public void destroy() { 
if (eCategories.isPublished()) eCategories.stop(); 
super.destroy(); 
} 


>It might be causing the problem. 
>Have you had the same problem with other war files? If you can compare 
>apps which work and others which fail then this might tell you something 
>about what is happening. 

I get this error only with war files that does the same thing (as I have three web service servers they have the same functionality on different databases, all of them are developed with CXF), but with the ordinary wars every thing is fine.. 

>Also, might you still have a client process running when you do the 
>redeploy? This could cause the problem (although I would have expected 
>it merely to cause JBoss to delay the redeploy). 

No, I stopped the client and I used Altova XmlSpy to test the services instead .. 

If it *is* JBoss code which is locking the port then look for server log 
and console log warnings/errors before and after the deploy to see if 
they shed any light on what is going on. 

The only wared thing I found is those 2 lines when I undeploy the war: 
2007-11-17 15:53:21,771 DEBUG [org.jboss.deployment.DeploymentInfo] Could not delete file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp20311Service-1.2.2-exp.war/ restart will delete it 
2007-11-17 15:53:21,771 DEBUG [org.jboss.deployment.MainDeployer] Undeployed file:/C:/jboss-4.0.5.GA/server/default/deploy/Service-1.2.2.war 


>Actually look for these anyway [the log is your friend :-]. You might 
>need to configure trace in some of the code to get the information you 
>need but I suggest you start by looking for warnings/errors and progress 
>from there to identify what trace to enable. 

>If you cannot identify anything after checking these things you could 
>take it to the JBoss AS forum or, if you have a support contract, to the 
>support portal. 

Actually I would do this if this problem happens with ordinary war files but the problem is that this problem happens only when I'm using CXF :-( , sorry to bother but I tested with different JBoss versions on different OS! so the problem is either my code or CXF or the way I deployed with!! 

any way this is my trace: 
INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog 
2007-11-17 16:06:00,248 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
INFO: jetty-6.1.3 
2007-11-17 16:06:00,295 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
WARNING: failed SelectChannelConnector @ 0.0.0.0:9090 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java 
2007-11-17 16:06:00,295 ERROR [STDERR] :133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,311 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
WARNING: failed Server@1108691 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx 
2007-11-17 16:06:00,311 ERROR [STDERR] .server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,326 ERROR [STDERR] Nov 17, 2007 4:06:00 PM org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine addServant 
SEVERE: Address already in use: bind 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept 
2007-11-17 16:06:00,326 ERROR [STDERR] or.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,342 INFO [STDOUT] Server started\ 
regards, 


Andrew Dinn (JBoss Transactions) 
-------------------------------- 
JBoss, a Division of Red Hat 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire, 
SI4 1TE, United Kingdom. 
Registered in UK and Wales under Company Registration No. 3798903 
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland) 





-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
----- Original Message ----- 
From: "Andrew Dinn" <ad...@redhat.com> 
To: cxf-user@incubator.apache.org 
Sent: Thursday, November 15, 2007 4:06:30 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Eman Ali al-Maktari [IT Department] wrote: 
> Dear Andrew, 
> I tried on both 4.0.5 and 4.2.1, both on Windows and Linux 
> For the Deployment I tried the two methods: deleting then copying, and overwriting. 
> I checked the temp folder it's clean. 
> 
> Do you think it's normal? 

err, no not really, I don't know how JBoss can do something like this. 

What does the app in your war file do? 
my application is a web service that return to the user set of information retrieve from a database, I publish the end point of the service in the init() method of the servlet and I unpublish it in the destroy() method as follows: 
This is my code: 

Endpoint eCategories = publishCategories(); 

private Endpoint publishCategories() { 
String address = "http://localhost:9090/sn_categories"; 
CategoriesImpl categoriesImpl = new CategoriesImpl(); 
//Endpoint e = Endpoint.publish(address, categoriesImpl); 
CXFServlet cxf = new CXFServlet(); 
Bus bus = cxf.getBus(); 
BusFactory.setDefaultBus(bus); 
Endpoint e = Endpoint.create(categoriesImpl); 
e.publish(address); 
return e; 
} 
public void init(ServletConfig config) throws ServletException { 
super.init(config); 
System.out.println("Server started\\"); 

// Categories 
if (!eCategories.isPublished()) { 
String address = "http://localhost:9090/sn_categories"; 
eCategories.publish(address); 
} 
} 

public void destroy() { 
if (eCategories.isPublished()) eCategories.stop(); 
super.destroy(); 
} 


It might be causing the problem. 
Have you had the same problem with other war files? If you can compare 
apps which work and others which fail then this might tell you something 
about what is happening. 

I get this error only with war files that does the same thing (as I have three web service servers they have the same functionality on different databases, all of them are developed with CXF), but with the ordinary wars every thing is fine.. 

Also, might you still have a client process running when you do the 
redeploy? This could cause the problem (although I would have expected 
it merely to cause JBoss to delay the redeploy). 

No, I stopped the client and I used Altova XmlSpy to test the services instead .. 

If it *is* JBoss code which is locking the port then look for server log 
and console log warnings/errors before and after the deploy to see if 
they shed any light on what is going on. 

The only wared thing I found is those 2 lines when I undeploy the war: 
2007-11-17 15:53:21,771 DEBUG [org.jboss.deployment.DeploymentInfo] Could not delete file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp20311Service-1.2.2-exp.war/ restart will delete it 
2007-11-17 15:53:21,771 DEBUG [org.jboss.deployment.MainDeployer] Undeployed file:/C:/jboss-4.0.5.GA/server/default/deploy/Service-1.2.2.war 


Actually look for these anyway [the log is your friend :-]. You might 
need to configure trace in some of the code to get the information you 
need but I suggest you start by looking for warnings/errors and progress 
from there to identify what trace to enable. 

If you cannot identify anything after checking these things you could 
take it to the JBoss AS forum or, if you have a support contract, to the 
support portal. 

Actually I would do this if this problem happens with ordinary war files but the problem is that this problem happens only when I'm using CXF :-( , sorry to bother but I tested with different JBoss versions on different OS, so the problem is either my code or CXF or the way I deployed with!! 

any way this is my trace: 
INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog 
2007-11-17 16:06:00,248 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
INFO: jetty-6.1.3 
2007-11-17 16:06:00,295 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
WARNING: failed SelectChannelConnector @ 0.0.0.0:9090 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java 
2007-11-17 16:06:00,295 ERROR [STDERR] :133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,311 ERROR [STDERR] Nov 17, 2007 4:06:00 PM sun.reflect.NativeMethodAccessorImpl invoke0 
WARNING: failed Server@1108691 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx 
2007-11-17 16:06:00,311 ERROR [STDERR] .server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,326 ERROR [STDERR] Nov 17, 2007 4:06:00 PM org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine addServant 
SEVERE: Address already in use: bind 
java.net.BindException: Address already in use: bind 
at sun.nio.ch.Net.bind(Native Method) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) 
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:209) 
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) 
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:294) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.mortbay.jetty.Server.doStart(Server.java:221) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) 
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:171) 
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143) 
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47) 
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:158) 
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:576) 
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121) 
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227) 
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) 
at com.lit.linkinnews.WebServiceServlet.publishCategories(WebServiceServlet.java:182) 
at com.lit.linkinnews.WebServiceServlet.<init>(WebServiceServlet.java:35) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at java.lang.Class.newInstance0(Class.java:350) 
at java.lang.Class.newInstance(Class.java:303) 
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) 
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052) 
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:585) 
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) 
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) 
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) 
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) 
at org.jboss.web.WebModule.startModule(WebModule.java:83) 
at org.jboss.web.WebModule.startService(WebModule.java:61) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) 
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) 
at $Proxy0.start(Unknown Source) 
at org.jboss.system.ServiceController.start(ServiceController.java:417) 
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy38.start(Unknown Source) 
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) 
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:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) 
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) 
at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) 
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) 
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy39.start(Unknown Source) 
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept 
2007-11-17 16:06:00,326 ERROR [STDERR] or.java:133) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) 
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) 
at $Proxy8.deploy(Unknown Source) 
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
2007-11-17 16:06:00,342 INFO [STDOUT] Server started\ 
regards, 


Andrew Dinn (JBoss Transactions) 
-------------------------------- 
JBoss, a Division of Red Hat 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire, 
SI4 1TE, United Kingdom. 
Registered in UK and Wales under Company Registration No. 3798903 
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland) 





-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Andrew Dinn <ad...@redhat.com>.
Eman Ali al-Maktari [IT Department] wrote:
  > Dear Andrew,
> I tried on both 4.0.5 and 4.2.1, both on Windows and Linux 
> For the Deployment I tried the two methods: deleting then copying, and overwriting. 
> I checked the temp folder it's clean. 
> 
> Do you think it's normal? 

err, no not really, I don't know how JBoss can do something like this.

What does the app in your war file do? It might be causing the problem. 
Have you had the same problem with other war files? If you can compare 
apps which work and others which fail then this might tell you something 
about what is happening.

Also, might you still have a client process running when you do the 
redeploy? This could cause the problem (although I would have expected 
it merely to cause JBoss to delay the redeploy).

If it *is* JBoss code which is locking the port then look for server log 
and console log warnings/errors before and after the deploy to see if 
they shed any light on what is going on.

Actually look for these anyway [the log is your friend :-]. You might 
need to configure trace in some of the code to get the information you 
need but I suggest you start by looking for warnings/errors and progress 
from there to identify what trace to enable.

If you cannot identify anything after checking these things you could 
take it to the JBoss AS forum or, if you have a support contract, to the 
support portal.

regards,


Andrew Dinn (JBoss Transactions)
--------------------------------
JBoss, a Division of Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David
Owens (Ireland)



Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Dear Glen, 
I know that I can kill the process or even restart JBoss but this is going to be the last solution, for the moment I want to see if there is a way to un-bind this port "peacefully! with no kill!!". 

Dear Andrew, 
I tried on both 4.0.5 and 4.2.1, both on Windows and Linux 
For the Deployment I tried the two methods: deleting then copying, and overwriting. 
I checked the temp folder it's clean. 

Do you think it's normal? 
thanks for your help in advanced.. 
by the way take your time , beacause I wont be able to reply before Saturday as Thu. and Fri. are our weekend in Yemen ;) 
----- Original Message ----- 
From: "Andrew Dinn" <ad...@redhat.com> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 14, 2007 7:33:26 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Eman Ali al-Maktari [IT Department] wrote: 
> Dear Upendra, 
> First of all thanks for your reply, 
> But the problem comes when I re-deploy my war file because the port 9090 "Which I published my endpoint on, in the first-time deployment" is locked by JBoss, I'm sure that this port is not used by any JBoss service. 
> 
> And to be sure that JBoss is the one who locks it I used "fport" and the result was: 
> Pid Process Port Proto Path 
> 3520 javaw -> 9090 TCP C:\Program Files\Java\jdk1.5.0_13\bin\javaw.exe 

Which JBoss AS version are you using? How do you redeploy the war file? 
Do you delete the existing deployed file then install a new copy of do 
you copy the new file over the old one? 

regards 

Andrew Dinn (JBoss Transactions) 
-------------------------------- 
JBoss, a Division of Red Hat 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire, 
SI4 1TE, United Kingdom. 
Registered in UK and Wales under Company Registration No. 3798903 
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland) 



-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Andrew Dinn <ad...@redhat.com>.
Eman Ali al-Maktari [IT Department] wrote:
> Dear Upendra, 
> First of all thanks for your reply, 
> But the problem comes when I re-deploy my war file because the port 9090 "Which I published my endpoint on, in the first-time deployment" is locked by JBoss, I'm sure that this port is not used by any JBoss service. 
> 
> And to be sure that JBoss is the one who locks it I used "fport" and the result was: 
> Pid Process Port Proto Path 
> 3520 javaw -> 9090 TCP C:\Program Files\Java\jdk1.5.0_13\bin\javaw.exe 

Which JBoss AS version are you using? How do you redeploy the war file? 
Do you delete the existing deployed file then install a new copy of do 
you copy the new file over the old one?

regards

Andrew Dinn (JBoss Transactions)
--------------------------------
JBoss, a Division of Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
Owens (Ireland)

Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Dear Upendra, 
First of all thanks for your reply, 
But the problem comes when I re-deploy my war file because the port 9090 "Which I published my endpoint on, in the first-time deployment" is locked by JBoss, I'm sure that this port is not used by any JBoss service. 

And to be sure that JBoss is the one who locks it I used "fport" and the result was: 
Pid Process Port Proto Path 
3520 javaw -> 9090 TCP C:\Program Files\Java\jdk1.5.0_13\bin\javaw.exe 

Thanks again 

----- Original Message ----- 
From: "Upendra Moturi" <up...@securegrid.net> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 14, 2007 6:25:35 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

On 11/14/07, Glen Mazza <gl...@verizon.net> wrote: 
> 
> I don't think you mean a tcp/ip port, but if you do, normally the Linux 
> command fuser -k 8080/tcp will kill any servlet container's lock on that 
> port (that occasionally happens with me on Tomcat, so I have to do that, 
> and then restart Tomcat.) 
> 
> But your question seems better suited for the JBoss forums, and more 
> detective work on your part would help as well. Does this same problem 
> occur if are deploying any WAR file, say a simple web application 
> without CXF? If so, CXF has nothing to do with the problem. 
> 
> Also, I would check to see if the deploy/undeploy works with Tomcat with 
> your war file--if you can get it working with Tomcat but not JBoss that 
> also helps point to JBoss being the problem (instead of any code in your 
> WAR file). 
> 
> HTH, 
> Glen 
> 
> 
> Am Mittwoch, den 14.11.2007, 16:31 +0300 schrieb Eman Ali al-Maktari [IT 
> Department]: 
> > Hi all, 
> > I'm a newbie to CXF and web services in general... 
> > The thing is that I created a service and a client with CXF and deployed 
> them in JBoss, both of the service and client are working fine except that 
> when I re-deploy the service to JBoss I get a "Address already in use" 
> Exception. 
> > It looks that JBoss opens a port when I publish the service endpoint, 
> and doesn't close it when I un-deploy the service war file. 
> > I tried to use the stop() method to un-publish the end point -I called 
> the method in the destroy() method of the listening Servlet- but it didn't 
> work 
> > 
> > I don't know what to do!! the documentation of CXF is very lacks!! 
> > 
> > Any help is very appreciated 
> > 



Hi, 
I have been working with jboss but a newbie to CFX.Check which port is 
already in use,you can find the ports which are used in jboss in conf 
directory of jboss, so that you can find where the problem is. 

Upendra. 


-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Upendra Moturi <up...@securegrid.net>.
On 11/14/07, Glen Mazza <gl...@verizon.net> wrote:
>
> I don't think you mean a tcp/ip port, but if you do, normally the Linux
> command fuser -k 8080/tcp will kill any servlet container's lock on that
> port (that occasionally happens with me on Tomcat, so I have to do that,
> and then restart Tomcat.)
>
> But your question seems better suited for the JBoss forums, and more
> detective work on your part would help as well. Does this same problem
> occur if are deploying any WAR file, say a simple web application
> without CXF?  If so, CXF has nothing to do with the problem.
>
> Also, I would check to see if the deploy/undeploy works with Tomcat with
> your war file--if you can get it working with Tomcat but not JBoss that
> also helps point to JBoss being the problem (instead of any code in your
> WAR file).
>
> HTH,
> Glen
>
>
> Am Mittwoch, den 14.11.2007, 16:31 +0300 schrieb Eman Ali al-Maktari [IT
> Department]:
> > Hi all,
> > I'm a newbie to CXF and web services in general...
> > The thing is that I created a service and a client with CXF and deployed
> them in JBoss, both of the service and client are working fine except that
> when I re-deploy the service to JBoss I get a "Address already in use"
> Exception.
> > It looks that JBoss opens a port when I publish the service endpoint,
> and doesn't close it when I un-deploy the service war file.
> > I tried to use the stop() method to un-publish the end point -I called
> the method in the destroy() method of the listening Servlet- but it didn't
> work
> >
> > I don't know what to do!! the documentation of CXF is very lacks!!
> >
> > Any help is very appreciated
> >



Hi,
    I have been working with jboss but a newbie to CFX.Check which port is
already in use,you can find the ports which are used in jboss in conf
directory of jboss, so that you can find where the problem is.

Upendra.

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Glen Mazza <gl...@verizon.net>.
Am Mittwoch, den 14.11.2007, 18:14 +0300 schrieb Eman Ali al-Maktari [IT
Department]:
> Thanks Glen for the quick reply, 
> 
> The port that's hold by JBoss is "9090" as the address I'm using to publish my endpoint is "http://localhost:9090/sn_categories"; 
> 

fuser -k 9090/tcp should work for you then.

Glen



Re: [Deploy in JBOSS] Address already in use Exception

Posted by "Eman Ali al-Maktari [IT Department]" <ea...@linkintime.com>.
Thanks Glen for the quick reply, 

The port that's hold by JBoss is "9090" as the address I'm using to publish my endpoint is "http://localhost:9090/sn_categories"; 

This exception happens only with the CXF war files, 
For the Tomecat deployment I'll submit the result for you as soon as I finish installing it. 

Thanks again 
----- Original Message ----- 
From: "Glen Mazza" <gl...@verizon.net> 
To: cxf-user@incubator.apache.org 
Sent: Wednesday, November 14, 2007 5:15:34 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

I don't think you mean a tcp/ip port, but if you do, normally the Linux 
command fuser -k 8080/tcp will kill any servlet container's lock on that 
port (that occasionally happens with me on Tomcat, so I have to do that, 
and then restart Tomcat.) 

But your question seems better suited for the JBoss forums, and more 
detective work on your part would help as well. Does this same problem 
occur if are deploying any WAR file, say a simple web application 
without CXF? If so, CXF has nothing to do with the problem. 

Also, I would check to see if the deploy/undeploy works with Tomcat with 
your war file--if you can get it working with Tomcat but not JBoss that 
also helps point to JBoss being the problem (instead of any code in your 
WAR file). 

HTH, 
Glen 


Am Mittwoch, den 14.11.2007, 16:31 +0300 schrieb Eman Ali al-Maktari [IT 
Department]: 
> Hi all, 
> I'm a newbie to CXF and web services in general... 
> The thing is that I created a service and a client with CXF and deployed them in JBoss, both of the service and client are working fine except that when I re-deploy the service to JBoss I get a "Address already in use" Exception. 
> It looks that JBoss opens a port when I publish the service endpoint, and doesn't close it when I un-deploy the service war file. 
> I tried to use the stop() method to un-publish the end point -I called the method in the destroy() method of the listening Servlet- but it didn't work 
> 
> I don't know what to do!! the documentation of CXF is very lacks!! 
> 
> Any help is very appreciated 
> 




-- 
Best Regards, 

Eman Ali al-Maktari 
Software Engineer 
Technical Department 
LinkInTime 
Get Mobile ))) 

www.linkintime.com 
Mobile :: (00967) 71 2000 834 
Office :: (00967) 1 427 377 
Fax :: (00967) 1 428 851 

LinkInTime Ltd. 
Iran Street 
Haddah - Sana'a - P.O.Box. 16871, YEMEN 

Re: [Deploy in JBOSS] Address already in use Exception

Posted by Glen Mazza <gl...@verizon.net>.
I don't think you mean a tcp/ip port, but if you do, normally the Linux
command fuser -k 8080/tcp will kill any servlet container's lock on that
port (that occasionally happens with me on Tomcat, so I have to do that,
and then restart Tomcat.)

But your question seems better suited for the JBoss forums, and more
detective work on your part would help as well. Does this same problem
occur if are deploying any WAR file, say a simple web application
without CXF?  If so, CXF has nothing to do with the problem. 

Also, I would check to see if the deploy/undeploy works with Tomcat with
your war file--if you can get it working with Tomcat but not JBoss that
also helps point to JBoss being the problem (instead of any code in your
WAR file).

HTH,
Glen


Am Mittwoch, den 14.11.2007, 16:31 +0300 schrieb Eman Ali al-Maktari [IT
Department]:
> Hi all, 
> I'm a newbie to CXF and web services in general... 
> The thing is that I created a service and a client with CXF and deployed them in JBoss, both of the service and client are working fine except that when I re-deploy the service to JBoss I get a "Address already in use" Exception. 
> It looks that JBoss opens a port when I publish the service endpoint, and doesn't close it when I un-deploy the service war file. 
> I tried to use the stop() method to un-publish the end point -I called the method in the destroy() method of the listening Servlet- but it didn't work 
> 
> I don't know what to do!! the documentation of CXF is very lacks!! 
> 
> Any help is very appreciated 
>