karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xtra Coder (Jira)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5054) Default rmiRegistryPort 1099 is used always besides different configuration
Date Tue, 20 Aug 2019 21:38:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-5054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16911746#comment-16911746
] 

Xtra Coder commented on KARAF-5054:
-----------------------------------

Unfortunately problem do exists :(

I'm experiencing it on virtual server which is (let's say) does not look to be quick ...

Below are two events occurring one after another. "CM Configuration Updater" thread which
feeds dictionary of properties into activator provides them later than activator starts in
another thread.

This happens in 4.2.6.

{code:java}
2019-08-20T21:10:17,700 | INFO  | FelixStartLevel           | Activator                  
     | 19 - org.apache.karaf.deployer.features - 4.2.6 | Deployment finished. Registering
FeatureDeploymentListener
2019-08-20T21:10:18,244 | INFO  | FelixStartLevel           | core                       
     | 14 - org.apache.aries.jmx.core - 1.1.8 | Starting JMX OSGi agent
2019-08-20T21:10:18,270 | INFO  | FelixStartLevel           | core                       
     | 14 - org.apache.aries.jmx.core - 1.1.8 | Registering MBean with ObjectName [osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=cd5fb3f1-01f7-45d3-a67b-51faffbcc9f5]
for service with service.id [16]
2019-08-20T21:12:23,365 | WARN  | activator-1-thread-1      | Activator                  
     | 31 - org.apache.karaf.management.server - 4.2.6 | Error starting activator
java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
    java.net.BindException: Address already in use (Bind failed)
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335) ~[?:?]
    at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:243) ~[?:?]
    at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) ~[?:?]
    at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) ~[?:?]
    at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:234) ~[?:?]
    at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:220) ~[?:?]
    at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:205) ~[?:?]
    at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203) ~[?:?]
    at org.apache.karaf.management.RmiRegistryFactory.init(RmiRegistryFactory.java:124) ~[31:org.apache.karaf.management.server:4.2.6]
    at org.apache.karaf.management.internal.Activator.doStart(Activator.java:128) ~[31:org.apache.karaf.management.server:4.2.6]
    at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:292) [31:org.apache.karaf.management.server:4.2.6]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
    at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.net.BindException: Address already in use (Bind failed)
    at java.net.PlainSocketImpl.socketBind(Native Method) ~[?:?]
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:436) ~[?:?]
    at java.net.ServerSocket.bind(ServerSocket.java:381) ~[?:?]
    at java.net.ServerSocket.<init>(ServerSocket.java:243) ~[?:?]
    at java.net.ServerSocket.<init>(ServerSocket.java:135) ~[?:?]
    at sun.rmi.transport.tcp.TCPDirectSocketFactory.createServerSocket(TCPDirectSocketFactory.java:45)
~[?:?]
    at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) ~[?:?]
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:324) ~[?:?]
    ... 15 more

	
"CM Configuration Updater (ManagedService Update: pid=[org.apache.karaf.management])@2" daemon
prio=5 tid=0x20 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at org.apache.karaf.util.tracker.BaseActivator.updated(BaseActivator.java:161)
	  at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
	  at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
	  at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
	  at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1113)
	  at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1069)
	  at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
	  at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
	  at java.lang.Thread.run(Thread.java:834)	
{code}
 


> Default rmiRegistryPort 1099 is used always besides different configuration
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-5054
>                 URL: https://issues.apache.org/jira/browse/KARAF-5054
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.1.0
>         Environment: Windows 7 64bit, karaf 4.1.0 binary distribution, java 1.8.0_121,
clean start
>            Reporter: Jens Vagts
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> When starting a _clean_ karaf instance (either very first first start or with {{clean}}
command line parameter) the karaf management feature always tries to open the default port
{{1099}} before opening the configured port resulting in a confusing exception in the {{karaf.log}}:
> {noformat}
> 2017-03-22T08:08:51,523 | WARN  | pool-23-thread-1 | Activator                      
 | 38 - org.apache.karaf.management.server - 4.1.0 | Error starting activator
> java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
> 	java.net.BindException: Address already in use: JVM_Bind
> 	at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:341) [?:?]
> 	at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:249) [?:?]
> 	at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) [?:?]
> 	at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) [?:?]
> 	at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:234) [?:?]
> 	at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:195) [?:?]
> 	at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:180) [?:?]
> 	at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203) [?:?]
> 	at org.apache.karaf.management.RmiRegistryFactory.init(RmiRegistryFactory.java:128)
[38:org.apache.karaf.management.server:4.1.0]
> 	at org.apache.karaf.management.internal.Activator.doStart(Activator.java:104) [38:org.apache.karaf.management.server:4.1.0]
> 	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:242) [38:org.apache.karaf.management.server:4.1.0]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
> 	at java.lang.Thread.run(Thread.java:745) [?:?]
> Caused by: java.net.BindException: Address already in use: JVM_Bind
> 	at java.net.DualStackPlainSocketImpl.bind0(Native Method) ~[?:?]
> 	at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106) ~[?:?]
> 	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) ~[?:?]
> 	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190) ~[?:?]
> 	at java.net.ServerSocket.bind(ServerSocket.java:375) ~[?:?]
> 	at java.net.ServerSocket.<init>(ServerSocket.java:237) ~[?:?]
> 	at java.net.ServerSocket.<init>(ServerSocket.java:128) ~[?:?]
> 	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45)
~[?:?]
> 	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:345)
~[?:?]
> 	at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) ~[?:?]
> 	at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:330) ~[?:?]
> 	... 15 more
> {noformat}
> if the port is already used by another process (e.g. another karaf instance).
> The configured port {{rmiRegistryPort = 1100}} in the config file  {{org.apache.karaf.management.cfg}}
will be nevertheless applied afterwards.
> This can easily reproduced by creating two instances of the standard karaf {{4.1.0}}
binary distributions and applying above configuration to the second instance.
> This occurs on _Windows_ (7 64 bit tested) only, and can *not* be reproduced on _Linux_
OS!
> The same behavior (of using the default port before the differently configured one) has
been observed for other ports as of: rmi server port ({{rmiServerPort}} in {{org.apache.karaf.management.cfg}})
and ssh ({{sshPort}} in {{org.apache.karaf.shell.cfg}}. Depending on the logging configuration
the failing usage of the default ports can be seen before the configured ports are taken into
account.
> Re-configuring the ports at runtime via the configuration properties works fine!
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Mime
View raw message