Address already in use: JVM_Bind

Bogdan picture Bogdan · Sep 15, 2010 · Viewed 158.2k times · Source

I'm using Glassfish 3.0.1, JVM 1.6.0_21 on Windows XP Pro;

I don't know exactly what has changed in my environment but I get this stacktrace as soon as I try to deploy an enterprise application (ejb module + app client module).

There is nothing running on port 3820, except Glassfish... I checked with netstat with the server stopped and the server started.

What could be the cause of this? Some internal process conflict?

Any tips on how I can debug this further?

WARNING: Can not find resource bundle for this logger.  class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
SEVERE: iiop.createsocket_exception
WARNING: Can not find resource bundle for this logger.  class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
SEVERE: java.net.BindException: Address already in use: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:106)
        at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:106)
        at com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:72)
        at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSSLServerSocket(IIOPSSLSocketFactory.java:402)
        at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createServerSocket(IIOPSSLSocketFactory.java:281)
        at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:91)
        at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:247)
        at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:264)
        at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:131)
        at com.sun.corba.ee.impl.oa.poa.POAImpl.initialize(POAImpl.java:474)
        at com.sun.corba.ee.impl.oa.poa.POAImpl.makeRootPOA(POAImpl.java:323)
        at com.sun.corba.ee.impl.oa.poa.POAFactory$1.evaluate(POAFactory.java:279)
        at com.sun.corba.ee.impl.orbutil.closure.Future.evaluate(Future.java:57)
        at com.sun.corba.ee.impl.resolver.LocalResolverImpl.resolve(LocalResolverImpl.java:51)
        at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:55)
        at com.sun.corba.ee.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1289)
        at com.sun.corba.ee.impl.naming.cosnaming.TransientNameService.initialize(TransientNameService.java:122)
        at com.sun.corba.ee.impl.naming.cosnaming.TransientNameService.<init>(TransientNameService.java:90)
        at org.glassfish.enterprise.iiop.impl.PEORBConfigurator.configure(PEORBConfigurator.java:154)
        at com.sun.corba.ee.impl.orb.ORBConfiguratorImpl.runUserConfigurators(ORBConfiguratorImpl.java:191)
        at com.sun.corba.ee.impl.orb.ORBConfiguratorImpl.configure(ORBConfiguratorImpl.java:176)
        at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl.java:579)
        at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(ORBImpl.java:680)
        at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(ORBImpl.java:666)
        at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(ORBFactory.java:91)
        at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.initORB(GlassFishORBManager.java:612)
        at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.getORB(GlassFishORBManager.java:289)
        at org.glassfish.enterprise.iiop.impl.GlassFishORBFactoryImpl.createORB(GlassFishORBFactoryImpl.java:83)
        at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:122)
        at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getProtocolManager(GlassFishORBHelper.java:189)
        at com.sun.ejb.containers.BaseContainer.initializeProtocolManager(BaseContainer.java:810)
        at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:558)
        at com.sun.ejb.containers.AbstractSingletonContainer.<init>(AbstractSingletonContainer.java:136)
        at com.sun.ejb.containers.CMCSingletonContainer.<init>(CMCSingletonContainer.java:73)
        at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:109)
        at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
        at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:197)
        at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:63)
        at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)

WARNING: Can not find resource bundle for this logger.  class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
WARNING: Can not find resource bundle for this logger.  class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
SEVERE: "IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3820"

EDIT Here it's exactly what I tried:

C:\Documents and Settings\b.tanase>netstat -p tcp -ano | findstr :3820

asadmin> start-domain domain1
Waiting for DAS to start ...
Started domain: domain1
Domain location: D:\java\glassfish-3.0.1\glassfish\domains\domain1
Log file: D:\java\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
Admin port for the domain: 4848
Command start-domain executed successfully.

C:\Documents and Settings\b.tanase>netstat -p tcp -ano | findstr :3820

asadmin> deploy d:/java/projects/netbeans-projects/CountingSystem/dist/CountingS
ystem.ear
com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while l
oading the app : java.lang.RuntimeException: EJB Container initialization error
Exception while invoking class org.glassfish.ejb.startup.EjbDeployer load method
 : java.lang.RuntimeException: EJB Container initialization error


Command deploy failed.

C:\Documents and Settings\b.tanase>netstat -p tcp -ano | findstr :3820
  TCP    0.0.0.0:3820           0.0.0.0:0              LISTENING       2428

As you can see there's nothing listening on port 3820 until the deployment failes (before EJB Container initialization error I get in the server log the stacktrace posted at the beggining of the post)

Answer

J-16 SDiZ picture J-16 SDiZ · Sep 15, 2010

Your local port 443 / 8181 / 3820 is used.

If you are on linux/unix:

  • use netstat -an and lsof -n to check who is using this port

If you are on windows

  • use netstat -an and tcpview to check.