2010-01-13 19 views
5

estoy enfrentando el problema con el auto WCF alojamiento de aplicaciones al intentar ejecutar con la siguiente configuración:Puerto siendo utilizado por otra aplicación en WCF

<system.serviceModel> 
    <services> 
     <service name="statisticsCollectingService"> 
     <endpoint address="net.tcp://localhost:8200/RadioStatistics/" 
       binding="netTcpBinding" 
       contract="RadioStatistics.Services.IStatisticsCollectingService" /> 
     <endpoint address="http://localhost:8100/RadioStatistics/" 
       binding="basicHttpBinding" 
       contract="RadioStatistics.Services.IStatisticsCollectingService" /> 
     </service> 

     <service name="biDataExportService"> 
     <endpoint address="net.tcp://localhost:8001/RadioStatistics/" 
        binding="netTcpBinding" 
        contract="RadioStatistics.Services.IBIDataExportService" /> 
     </service> 
    </services> 
    </system.serviceModel> 

La excepción se produce de la siguiente manera:

System.Configuration.ConfigurationErrorsException: Error creating context 'spring.root': The process cannot access the file because it is being used by another process ---> Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'statisticsCollectingServiceHost' defined in 'config [C:\TTL\zer_rel_12_1_main_TTL_C1077\TTL\CommonTools\RadioStatistics\bin\Debug\RadioStatistics.ServerApp.vshost.exe.Config#spring/objects] line 4' : Initialization of object failed : HTTP could not register URL http://+:8000/RadioStatistics/services/ because TCP port 8000 is being used by another application. ---> System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL http://+:8000/RadioStatistics/services/ because TCP port 8000 is being used by another application. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process 
    at System.Net.HttpListener.AddAll() 
    at System.Net.HttpListener.Start() 
    at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() 
    at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) 
    at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) 
    at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open() 
    at Spring.ServiceModel.Activation.ServiceHostFactoryObject.AfterPropertiesSet() in l:\projects\spring-net\trunk\src\Spring\Spring.Services\ServiceModel\Activation\ServiceHostFactoryObject.cs:line 176 
    at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InvokeInitMethods(Object target, String name, IConfigurableObjectDefinition definition) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:line 1264 
    at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:line 1860 
    at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:line 884 
    --- End of inner exception stack trace --- 
    at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:line 901 
    at Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectFactory.cs:line 2097 
    at Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectFactory.cs:li 

Ejecutar un Windows XP SP3 ya estaba tratando de hacer lo siguiente:

httpcfg set urlacl/u http://+:8100/RadioStatistics//a "D: (A ;; GX ;;; BU)"

(supongo que con todas las variantes posibles de subvenciones y/o usuarios en general - como DU (para usuarios de dominio)

? también se trata de añadir a la lista de IP

httpcfg conjunto iplisten -i 0.0.0.0:8100

Esto fue después de que yo he encontrado un evento en el registro de eventos:

No se puede vincular al transporte subyacente para 0.0.0.0:8100. La lista de solo escucha de IP puede contener una referencia a una interfaz que no puede existir en esta máquina. El campo de datos contiene el número de error.

Lo peor es que ya estaba funcionando en el pasado (antes de irme de vacaciones hace unas semanas). La máquina parece sin cambios para mí ya que no fue tocada. Pero el error me vuelve loco. Lo peor es que el error ocurre independientemente del puerto elegido.

De cource funciona absolutamente bien después de eliminar el basicHttpBinding.

TIA

Roland

Respuesta

6

Usted puede tener algo más escuchando en el mismo puerto. Intente ejecutar

netstat -o -n -a 

para obtener una lista de todos los procesos y lo que están escuchando.

+0

Sin resultado. El puerto es realmente gratis. Como mencioné, la elección de cualquier otro puerto da exactamente el mismo error. He intentado varios puertos diferentes, incluidos 80. También apagué el IIS, sin resultado :( – Roland

0

@Roland, sé que esta es una publicación muy antigua y también te he visto preguntando esto en otros sitios. Recientemente tuve este problema por mucho tiempo. Eventualmente tengo dos formas de resolver esto. 1) Aunque probablemente esta no sea la manera recomendada, obtenga permiso de administrador local en la cuenta que ejecuta el servicio de ventana. Esta es la razón por la cual cuando las personas ejecutan VS como administrador, este problema desaparece en su máquina local porque HTTP otorga de manera predeterminada permiso al administrador local.

2) Como dijo, use httpcfg en el servidor xp/2003 para configurar la url y el número de puerto como lo hizo; vale la pena mencionar que "D:(A;;GX;;;LS)" es el SDDL correcto que funcionó para mí; Probé con otros pero no funcionó. Igualmente importante, no incluya el nombre del servicio al configurar simplemente use httpcfg set urlacl -u http://+:portnumber -a D:(A;;GX;;;LS)". Y no configure iplisten con httpcfg ya que esto probablemente evitará que IIS se ejecute en el servidor. El error que obtuvo del registro de eventos fue: "No se puede vincular al transporte subyacente para 0.0.0.0:8100. La lista IP de solo lectura puede contener una referencia a una interfaz que puede no existir en esta máquina. El campo de datos contiene el número de error "sugiere que IIS está detenido. De hecho, si haces httpcfg query iplisten, solo deberías ver el ipaddress predeterminado 0.0.0.0. Después de configurar la url usando httpcfg, debe reiniciar http con net stop http y esperar a que todo se detenga con éxito. Luego haz net start http. Si http no se pudo detener correctamente, debe reiniciar el servidor después de lo cual se debería ejecutar IIS (si eliminó cualquier dirección de acceso IP no válida). Luego, inicie su servicio de ventana y consulte con netstat -an | findstr "0.0:yourportnumber" si hay un resultado, significa que su servicio de ventana está funcionando ahora.

Solo para agregar, he seguido las instrucciones en nuestro primer servidor de desarrollo y no funcionó inicialmente porque 1) agregué iplisten y 2) No reinicié http después de configurar la url. 3) No revisé para asegurarme de que iis funcionaba correctamente. Espero que esto ayude de alguna manera.

Cuestiones relacionadas