You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by David Blevins <da...@visi.com> on 2009/11/01 02:21:43 UTC

Re: OpenEJB 3.1.2 - "Cannot connect to server" WARNING message

On Oct 29, 2009, at 10:19 AM, bitz wrote:

>
> Good question.  I haven't configured a cluster.  I have one instance  
> of
> Geronimo 2.2 running, and didn't make any changes to the default  
> config.
> The client side code is a very simple test app.  At this point, I'm  
> only
> doing some research and testing, nothing fancy.  Is clustering somehow
> enabled by default?

It is enabled by default, though it is designed so that it (should)  
have no effect unless there actually *is* a cluster.  Clearly  
something i s not lined up correctly.  I'll have a look in the code.

Can you post your related server side config?


-David

> Quintin Beukes-2 wrote:
>>
>> Are you using clustering?
>>
>> Quintin Beukes
>>
>>
>>
>> On Thu, Oct 29, 2009 at 1:05 AM, bitz <th...@canada.com>  
>> wrote:
>>>
>>> I'm using Geronimo 2.2 which uses OpenEJB 3.1.2.  I have a client
>>> application
>>> which retrieves a remote EJB reference and makes a remote EJB method
>>> call.
>>> I'm seeing the following message being logged by the OpenEJB  
>>> client on
>>> the
>>> client side...
>>>
>>> Oct 28, 2009 3:36:03 PM
>>> org.apache.openejb.client.StickyConnectionStrategy
>>> connect
>>> WARNING: Failover: Cannot connect to server(s): ejbd://0.0.0.0:4201
>>> Exception: Cannot connect to server 'ejbd://0.0.0.0:4201'.  Check  
>>> that
>>> the
>>> server is started and that the specified serverURL is correct..   
>>> Trying
>>> next.
>>>
>>> Well, the serverURL is not correct, and it's also not the one I  
>>> provided.
>>> Here's a snippet of the client code...
>>>
>>> final URI serverURI = new URI( "ejbd", null, "192.168.0.1", 4201,  
>>> null,
>>> null, null );
>>> final Properties contextProperties = new Properties( );
>>> contextProperties.put( Context.INITIAL_CONTEXT_FACTORY,
>>> "org.apache.openejb.client.RemoteInitialContextFactory" );
>>> contextProperties.put( Context.PROVIDER_URL,  
>>> serverURI.toString( ) );
>>>
>>> final InitialContext ctx = new InitialContext( contextProperties );
>>> final MyEjbService remote = (MyEjbService)ctx.lookup("MyEjbRemote");
>>> final String serverTime = remote.getServerTime();
>>>
>>> In
>>> org 
>>> .apache 
>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>> cluster, ServerMetaData server), the ctx.lookup("MyEjbRemote")  
>>> call is
>>> successful, but the next call to remote.getServerTime() produces the
>>> error
>>> message indicated above, yet still succeeds.  Further calls to
>>> remote.getServerTime() work fine and do not produce any error  
>>> messages.
>>>
>>> I debugged enough to find the cause.  I'll try to explain... The  
>>> first
>>> client-server communication involves a handshake where  
>>> ClusterRequest and
>>> ClusterResponse objects are exchanged.  During this handshake the  
>>> server
>>> returns a URI of "ejbd://0.0.0.0:4201".  On the next communication  
>>> to the
>>> server, for the remote.getServerTime() method call, the
>>> org 
>>> .apache 
>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>> cluster, ServerMetaData server) code attempts to use the URI  
>>> returned by
>>> the
>>> server, which obviously fails, resulting in the message, then it  
>>> falls
>>> back
>>> to the original, correct URI, which is successful.
>>>
>>> My question:  What is the reason for the ClusterRequest/ 
>>> ClusterResponse
>>> handshake, and why does the OpenEJB client try to connect using an
>>> invalid
>>> URI provided by server?
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26103713.html
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26117261.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Re: OpenEJB 3.1.2 - "Cannot connect to server" WARNING message

Posted by bitz <th...@canada.com>.
I'm using a snapshot of Geronimo 2.2, revision 830701, downloaded on Oct 28,
2009.  As I said, I did not alter the Geronimo config at all, but I've
pasted it for you below.  On the server side, there's a single stateless
session bean, with a single remote method.  Very simple.  Thanks for your
help.


Geronimo config.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<attributes xmlns:ns2="http://geronimo.apache.org/xml/ns/plugins-1.3"
xmlns="http://geronimo.apache.org/xml/ns/attributes-1.2">
    <comment>
==================================================================
Warning - This XML file is regenerated by Geronimo whenever
changes are made to Geronimo's configuration.

If you want to include comments, create a single comment element
element.  They are allowable at any level of the configuration.

!!!! Do not edit this file while Geronimo is running !!!!
==================================================================</comment>
    <module
name="org.apache.geronimo.framework/client-system/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/j2ee-system/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/jee-specs/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.classloaders/xbean-finder/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/client/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-security/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-corba-yoko/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.framework/xmlbeans/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/rmi-naming/2.2-SNAPSHOT/car">
        <gbean name="RMIRegistry">
            <attribute name="port">${NamingPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="NamingProperties">
            <attribute
name="namingProviderUrl">rmi://${ServerHostname}:${NamingPort +
PortOffset}</attribute>
        </gbean>
        <gbean name="DefaultThreadPool">
            <attribute name="keepAliveTime">30000</attribute>
            <attribute name="minPoolSize">${MinThreadPoolSize}</attribute>
            <attribute name="maxPoolSize">${MaxThreadPoolSize}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.plugins.classloaders/geronimo-javaee-deployment_1.1MR3_spec/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.framework/plugin/2.2-SNAPSHOT/car">
        <gbean name="DownloadedPluginRepos">
            <attribute
name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.2.txt</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/geronimo-gbean-deployer/2.2-SNAPSHOT/car">
        <gbean name="Deployer">
            <attribute
name="remoteDeployAddress">http://${RemoteDeployHostname}:${HTTPPort +
PortOffset}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/j2ee-server/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/j2ee-security/2.2-SNAPSHOT/car">
        <gbean name="JMXService">
            <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${JMXPort + PortOffset}</attribute>
            <attribute
name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort +
PortOffset}/JMXConnector</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/server-security-config/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.classloaders/geronimo-schema-jee_5/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/j2ee-deployer/2.2-SNAPSHOT/car">
        <gbean name="WebBuilder">
            <attribute
name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/jetty-2.0</attribute>
        </gbean>
        <gbean name="EnvironmentEntryBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/client-transaction/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/farming/2.2-SNAPSHOT/car"
load="false">
        <gbean name="NodeInfo">
            <attribute name="name">${ClusterNodeName}</attribute>
        </gbean>
        <gbean name="ClusterInfo">
            <attribute name="name">${FarmName}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/aspectj/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/clustering/2.2-SNAPSHOT/car">
        <gbean name="Node">
            <attribute name="nodeName">${ClusterNodeName}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car"
load="false">
        <gbean name="DefaultBackingStrategyFactory">
            <attribute name="nbReplica">${ReplicaCount}</attribute>
        </gbean>
        <gbean name="DefaultDispatcherHolder">
            <attribute name="endPointURI">${EndPointURI}</attribute>
            <attribute name="clusterName">${WADIClusterName}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/transaction/2.2-SNAPSHOT/car">
        <gbean name="XidFactory">
            <attribute name="tmId">${TmId}</attribute>
        </gbean>
        <gbean name="ResourceBindings">
            <attribute name="format">${ResourceBindingsFormat}</attribute>
            <attribute
name="nameInNamespace">${ResourceBindingsNameInNamespace}</attribute>
            <attribute
name="namePattern">${ResourceBindingsNamePattern}</attribute>
            <attribute
name="abstractNameQuery">${ResourceBindingsQuery}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/connector-deployer/2.2-SNAPSHOT/car">
        <gbean name="ResourceRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="corbaEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>j2ee-corba-yoko</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
        <gbean name="AdminObjectRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
        <gbean name="ClientResourceRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="corbaEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>client-corba-yoko</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/derby/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/system-database/2.2-SNAPSHOT/car">
        <gbean name="DerbyNetwork">
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${DerbyPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/openjpa/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/webservices-common/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car">
        <gbean name="EJBNetworkService">
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute
name="multicastHost">${MulticastDiscoveryAddress}</attribute>
            <attribute
name="multicastPort">${MulticastDiscoveryPort}</attribute>
            <attribute name="clusterName">${ClusterName}</attribute>
        </gbean>
        <gbean name="DefaultStatefulContainer">
            <attribute name="timeout">${StatefulTimeout}</attribute>
            <attribute name="capacity">${Capacity}</attribute>
            <attribute name="bulkPassivate">${BulkPassivate}</attribute>
        </gbean>
        <gbean name="DefaultSingletonContainer">
            <attribute name="accessTimeout">${AccessTimeout}</attribute>
        </gbean>
        <gbean name="DefaultBMPContainer">
            <attribute name="poolSize">${BMPPoolSize}</attribute>
        </gbean>
        <gbean name="DefaultStatelessContainer">
            <attribute name="timeout">${StatelessTimeout}</attribute>
            <attribute name="poolSize">${StatelessPoolSize}</attribute>
            <attribute name="strictPooling">${StrictPooling}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-deployer/2.2-SNAPSHOT/car">
        <gbean name="EjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
        <gbean name="ClientEjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-clustering-wadi/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/openejb-clustering-builder-wadi/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/jasper/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/tomcat6/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-no-ha/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-clustering-wadi/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/tomcat6-clustering-builder-wadi/2.2-SNAPSHOT/car">
        <gbean name="TomcatClusteringBuilder">
            <attribute
name="defaultSweepInterval">${DefaultWadiSweepInterval}</attribute>
            <attribute
name="defaultNumPartitions">${DefaultWadiNumPartitions}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-corba-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/j2ee-corba-yoko/2.2-SNAPSHOT/car">
        <gbean name="NameServer">
            <attribute name="port">${COSNamingPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="Server">
            <attribute name="port">${ORBSSLPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="UnprotectedServer">
            <attribute name="port">${ORBPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/mejb/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/online-deployer/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.framework/shutdown/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/transformer-agent/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-framework/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-geronimo/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-remote/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/persistence-jpa10-deployer/2.2-SNAPSHOT/car">
        <gbean name="PersistenceUnitBuilder">
            <attribute
name="defaultPersistenceProviderClassName">org.apache.openjpa.persistence.PersistenceProviderImpl</attribute>
            <attribute
name="defaultPersistenceUnitProperties">openjpa.Log=commons
                                       
openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
                                       
openjpa.jdbc.UpdateManager=operation-order
                                       
openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="defaultEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>openjpa</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/upgrade-cli/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/offline-deployer/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/hot-deployer/2.2-SNAPSHOT/car">
        <gbean name="HotDeployer">
            <attribute name="path">deploy/</attribute>
            <attribute name="pollIntervalMillis">2000</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/remote-deploy-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/jasper-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/sharedlib/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/axis-deployer/2.2-SNAPSHOT/car">
        <gbean name="AxisModuleBuilderExtension">
            <attribute name="listener">?name=${webcontainer}</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="defaultEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>${webcontainerName}</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/jaxws-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis2/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/axis2-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'tomcat6')"/>
    <module
name="org.apache.geronimo.configs/jaxws-ejb-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis2-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/axis2-ejb-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'tomcat6')"/>
    <module
name="org.apache.geronimo.configs/jaxws-sun-tools/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/jaxws-tools/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/spring/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/cxf-jaxws-tools/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf-tools/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'jetty7')"/>
    <module name="org.apache.geronimo.configs/cxf-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/cxf-ejb-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'jetty7')"/>
    <module name="org.apache.geronimo.configs/concurrent/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/concurrent-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/javamail/2.2-SNAPSHOT/car">
        <gbean name="SMTPTransport">
            <attribute name="host">${SMTPHost}</attribute>
            <attribute name="port">${SMTPPort}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.plugins/uddi-db/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/uddi-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/welcome-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/jmx-security/2.2-SNAPSHOT/car"
load="false">
        <gbean name="JMXSecureConnector">
            <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${JMXSecurePort + PortOffset}</attribute>
            <attribute
name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort +
PortOffset}/JMXSecureConnector</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/activemq-broker/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/activemq-ra/2.2-SNAPSHOT/car">
        <gbean name="ActiveMQ RA">
            <attribute
name="ServerUrl">tcp://${ServerHostname}:${ActiveMQPort +
PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/myfaces/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/myfaces-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/ca-helper-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-ds/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-car-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-car-jmx/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/mconsole-ds/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/pluto-support/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/dojo-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/mconsole-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/activemq-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/debugviews-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/plancreator-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/plugin-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/sysdb-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/openejb-console-tomcat/2.2-SNAPSHOT/car"/>
    <module name="test/MyServer/1.0/car"/>
</attributes>



Geronimo config-substitutions.properties:

# Put variables and their substitution values in this file. 
# They will be used when processing the corresponding config.xml. 
# Values in this file can be overridden by environment variables and system
properties 
# by prefixing the property name with
'org.apache.geronimo.config.substitution.' 
# For example, an entry such as hostName=localhost 
# can be overridden by an environment variable or system property
org.apache.geronimo.config.substitution.hostName=foo 
# When running multiple instances of Geronimo choose a PortOffset value such
that none of the ports conflict. 
# For example, try PortOffset=10 
#Wed Oct 28 14:44:34 EDT 2009
ORBPort=6882
AJPPort=8009
MaxThreadPoolSize=500
ResourceBindingsNamePattern=
Capacity=1000
SMTPHost=localhost
StatelessPoolSize=10
StatelessTimeout=0
ResourceBindingsQuery=?\#org.apache.geronimo.naming.ResourceSource
DerbyPort=1527
BMPPoolSize=10
COSNamingPort=1050
StatefulTimeout=20
webcontainer=TomcatWebContainer
OpenEJBPort=4201
ORBSSLPort=2001
PortOffset=0
JMXPort=9999
ClusterNodeName=NODE
EndPointURI=http\://localhost\:8080
NamingPort=1099
DefaultWadiSweepInterval=36000
WebConnectorConTimeout=20000
WADIClusterName=DEFAULT_WADI_CLUSTER
BulkPassivate=100
MulticastDiscoveryPort=6142
HTTPSPort=8443
MinThreadPoolSize=200
MulticastDiscoveryAddress=239.255.3.2
ReplicaCount=2
ServerHostname=0.0.0.0
ActiveMQPort=61616
SMTPPort=25
webcontainerName=tomcat6
ResourceBindingsNameInNamespace=jca\:
StrictPooling=true
JMXSecurePort=9998
DefaultWadiNumPartitions=24
AccessTimeout=30
HTTPPort=8080
FarmName=DEFAULT_FARM
ClusterName=cluster1
ResourceBindingsFormat={groupId}/{artifactId}/{j2eeType}/{name}
RemoteDeployHostname=localhost
TmId=71,84,77,73,68




David Blevins wrote:
> 
> 
> On Oct 29, 2009, at 10:19 AM, bitz wrote:
> 
>>
>> Good question.  I haven't configured a cluster.  I have one instance  
>> of
>> Geronimo 2.2 running, and didn't make any changes to the default  
>> config.
>> The client side code is a very simple test app.  At this point, I'm  
>> only
>> doing some research and testing, nothing fancy.  Is clustering somehow
>> enabled by default?
> 
> It is enabled by default, though it is designed so that it (should)  
> have no effect unless there actually *is* a cluster.  Clearly  
> something i s not lined up correctly.  I'll have a look in the code.
> 
> Can you post your related server side config?
> 
> 
> -David
> 
>> Quintin Beukes-2 wrote:
>>>
>>> Are you using clustering?
>>>
>>> Quintin Beukes
>>>
>>>
>>>
>>> On Thu, Oct 29, 2009 at 1:05 AM, bitz <th...@canada.com>  
>>> wrote:
>>>>
>>>> I'm using Geronimo 2.2 which uses OpenEJB 3.1.2.  I have a client
>>>> application
>>>> which retrieves a remote EJB reference and makes a remote EJB method
>>>> call.
>>>> I'm seeing the following message being logged by the OpenEJB  
>>>> client on
>>>> the
>>>> client side...
>>>>
>>>> Oct 28, 2009 3:36:03 PM
>>>> org.apache.openejb.client.StickyConnectionStrategy
>>>> connect
>>>> WARNING: Failover: Cannot connect to server(s): ejbd://0.0.0.0:4201
>>>> Exception: Cannot connect to server 'ejbd://0.0.0.0:4201'.  Check  
>>>> that
>>>> the
>>>> server is started and that the specified serverURL is correct..   
>>>> Trying
>>>> next.
>>>>
>>>> Well, the serverURL is not correct, and it's also not the one I  
>>>> provided.
>>>> Here's a snippet of the client code...
>>>>
>>>> final URI serverURI = new URI( "ejbd", null, "192.168.0.1", 4201,  
>>>> null,
>>>> null, null );
>>>> final Properties contextProperties = new Properties( );
>>>> contextProperties.put( Context.INITIAL_CONTEXT_FACTORY,
>>>> "org.apache.openejb.client.RemoteInitialContextFactory" );
>>>> contextProperties.put( Context.PROVIDER_URL,  
>>>> serverURI.toString( ) );
>>>>
>>>> final InitialContext ctx = new InitialContext( contextProperties );
>>>> final MyEjbService remote = (MyEjbService)ctx.lookup("MyEjbRemote");
>>>> final String serverTime = remote.getServerTime();
>>>>
>>>> In
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server), the ctx.lookup("MyEjbRemote")  
>>>> call is
>>>> successful, but the next call to remote.getServerTime() produces the
>>>> error
>>>> message indicated above, yet still succeeds.  Further calls to
>>>> remote.getServerTime() work fine and do not produce any error  
>>>> messages.
>>>>
>>>> I debugged enough to find the cause.  I'll try to explain... The  
>>>> first
>>>> client-server communication involves a handshake where  
>>>> ClusterRequest and
>>>> ClusterResponse objects are exchanged.  During this handshake the  
>>>> server
>>>> returns a URI of "ejbd://0.0.0.0:4201".  On the next communication  
>>>> to the
>>>> server, for the remote.getServerTime() method call, the
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server) code attempts to use the URI  
>>>> returned by
>>>> the
>>>> server, which obviously fails, resulting in the message, then it  
>>>> falls
>>>> back
>>>> to the original, correct URI, which is successful.
>>>>
>>>> My question:  What is the reason for the ClusterRequest/ 
>>>> ClusterResponse
>>>> handshake, and why does the OpenEJB client try to connect using an
>>>> invalid
>>>> URI provided by server?
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26103713.html
>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26117261.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26158850.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: OpenEJB 3.1.2 - "Cannot connect to server" WARNING message

Posted by bitz <th...@canada.com>.
I'm using a snapshot of Geronimo 2.2, revision 830701, downloaded on Oct 28,
2009.  As I said, I did not alter the Geronimo config at all, but I've
pasted it for you below.  On the server side, there's a single stateless
session bean, with a single remote method.  Very simple.  Thanks for your
help.


Geronimo config.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<attributes xmlns:ns2="http://geronimo.apache.org/xml/ns/plugins-1.3"
xmlns="http://geronimo.apache.org/xml/ns/attributes-1.2">
    <comment>
==================================================================
Warning - This XML file is regenerated by Geronimo whenever
changes are made to Geronimo's configuration.

If you want to include comments, create a single comment element
element.  They are allowable at any level of the configuration.

!!!! Do not edit this file while Geronimo is running !!!!
==================================================================</comment>
    <module
name="org.apache.geronimo.framework/client-system/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/j2ee-system/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/jee-specs/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.classloaders/xbean-finder/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/client/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-security/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-corba-yoko/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.framework/xmlbeans/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/rmi-naming/2.2-SNAPSHOT/car">
        <gbean name="RMIRegistry">
            <attribute name="port">${NamingPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="NamingProperties">
            <attribute
name="namingProviderUrl">rmi://${ServerHostname}:${NamingPort +
PortOffset}</attribute>
        </gbean>
        <gbean name="DefaultThreadPool">
            <attribute name="keepAliveTime">30000</attribute>
            <attribute name="minPoolSize">${MinThreadPoolSize}</attribute>
            <attribute name="maxPoolSize">${MaxThreadPoolSize}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.plugins.classloaders/geronimo-javaee-deployment_1.1MR3_spec/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.framework/plugin/2.2-SNAPSHOT/car">
        <gbean name="DownloadedPluginRepos">
            <attribute
name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.2.txt</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/geronimo-gbean-deployer/2.2-SNAPSHOT/car">
        <gbean name="Deployer">
            <attribute
name="remoteDeployAddress">http://${RemoteDeployHostname}:${HTTPPort +
PortOffset}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/j2ee-server/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/j2ee-security/2.2-SNAPSHOT/car">
        <gbean name="JMXService">
            <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${JMXPort + PortOffset}</attribute>
            <attribute
name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort +
PortOffset}/JMXConnector</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/server-security-config/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.classloaders/geronimo-schema-jee_5/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/j2ee-deployer/2.2-SNAPSHOT/car">
        <gbean name="WebBuilder">
            <attribute
name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/jetty-2.0</attribute>
        </gbean>
        <gbean name="EnvironmentEntryBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/client-transaction/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/client-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/farming/2.2-SNAPSHOT/car"
load="false">
        <gbean name="NodeInfo">
            <attribute name="name">${ClusterNodeName}</attribute>
        </gbean>
        <gbean name="ClusterInfo">
            <attribute name="name">${FarmName}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/aspectj/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/clustering/2.2-SNAPSHOT/car">
        <gbean name="Node">
            <attribute name="nodeName">${ClusterNodeName}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car"
load="false">
        <gbean name="DefaultBackingStrategyFactory">
            <attribute name="nbReplica">${ReplicaCount}</attribute>
        </gbean>
        <gbean name="DefaultDispatcherHolder">
            <attribute name="endPointURI">${EndPointURI}</attribute>
            <attribute name="clusterName">${WADIClusterName}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/transaction/2.2-SNAPSHOT/car">
        <gbean name="XidFactory">
            <attribute name="tmId">${TmId}</attribute>
        </gbean>
        <gbean name="ResourceBindings">
            <attribute name="format">${ResourceBindingsFormat}</attribute>
            <attribute
name="nameInNamespace">${ResourceBindingsNameInNamespace}</attribute>
            <attribute
name="namePattern">${ResourceBindingsNamePattern}</attribute>
            <attribute
name="abstractNameQuery">${ResourceBindingsQuery}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/connector-deployer/2.2-SNAPSHOT/car">
        <gbean name="ResourceRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="corbaEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>j2ee-corba-yoko</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
        <gbean name="AdminObjectRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
        <gbean name="ClientResourceRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="corbaEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>client-corba-yoko</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/derby/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/system-database/2.2-SNAPSHOT/car">
        <gbean name="DerbyNetwork">
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${DerbyPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/openjpa/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/webservices-common/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car">
        <gbean name="EJBNetworkService">
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute
name="multicastHost">${MulticastDiscoveryAddress}</attribute>
            <attribute
name="multicastPort">${MulticastDiscoveryPort}</attribute>
            <attribute name="clusterName">${ClusterName}</attribute>
        </gbean>
        <gbean name="DefaultStatefulContainer">
            <attribute name="timeout">${StatefulTimeout}</attribute>
            <attribute name="capacity">${Capacity}</attribute>
            <attribute name="bulkPassivate">${BulkPassivate}</attribute>
        </gbean>
        <gbean name="DefaultSingletonContainer">
            <attribute name="accessTimeout">${AccessTimeout}</attribute>
        </gbean>
        <gbean name="DefaultBMPContainer">
            <attribute name="poolSize">${BMPPoolSize}</attribute>
        </gbean>
        <gbean name="DefaultStatelessContainer">
            <attribute name="timeout">${StatelessTimeout}</attribute>
            <attribute name="poolSize">${StatelessPoolSize}</attribute>
            <attribute name="strictPooling">${StrictPooling}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-deployer/2.2-SNAPSHOT/car">
        <gbean name="EjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
        <gbean name="ClientEjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-clustering-wadi/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/openejb-clustering-builder-wadi/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/jasper/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/tomcat6/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-no-ha/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/tomcat6-clustering-wadi/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/tomcat6-clustering-builder-wadi/2.2-SNAPSHOT/car">
        <gbean name="TomcatClusteringBuilder">
            <attribute
name="defaultSweepInterval">${DefaultWadiSweepInterval}</attribute>
            <attribute
name="defaultNumPartitions">${DefaultWadiNumPartitions}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-corba-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/j2ee-corba-yoko/2.2-SNAPSHOT/car">
        <gbean name="NameServer">
            <attribute name="port">${COSNamingPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="Server">
            <attribute name="port">${ORBSSLPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="UnprotectedServer">
            <attribute name="port">${ORBPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/mejb/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/online-deployer/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.framework/shutdown/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/transformer-agent/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-framework/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-geronimo/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/gshell-remote/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/persistence-jpa10-deployer/2.2-SNAPSHOT/car">
        <gbean name="PersistenceUnitBuilder">
            <attribute
name="defaultPersistenceProviderClassName">org.apache.openjpa.persistence.PersistenceProviderImpl</attribute>
            <attribute
name="defaultPersistenceUnitProperties">openjpa.Log=commons
                                       
openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
                                       
openjpa.jdbc.UpdateManager=operation-order
                                       
openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="defaultEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>openjpa</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.framework/upgrade-cli/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.framework/offline-deployer/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/hot-deployer/2.2-SNAPSHOT/car">
        <gbean name="HotDeployer">
            <attribute name="path">deploy/</attribute>
            <attribute name="pollIntervalMillis">2000</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/remote-deploy-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/jasper-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/sharedlib/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/axis-deployer/2.2-SNAPSHOT/car">
        <gbean name="AxisModuleBuilderExtension">
            <attribute name="listener">?name=${webcontainer}</attribute>
            <attribute
propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder"
name="defaultEnvironment">
                <environment:environment
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
                            <artifactId>${webcontainerName}</artifactId>
                            <type>car</type>
            </dependency>
          </dependencies>
        </environment:environment>
            </attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/jaxws-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis2/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/axis2-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'tomcat6')"/>
    <module
name="org.apache.geronimo.configs/jaxws-ejb-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/axis2-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/axis2-ejb-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'tomcat6')"/>
    <module
name="org.apache.geronimo.configs/jaxws-sun-tools/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/jaxws-tools/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/spring/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/cxf-jaxws-tools/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf-tools/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf/2.2-SNAPSHOT/car"
load="false"/>
    <module name="org.apache.geronimo.configs/cxf-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'jetty7')"/>
    <module name="org.apache.geronimo.configs/cxf-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.configs/cxf-ejb-deployer/2.2-SNAPSHOT/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName ==
'jetty7')"/>
    <module name="org.apache.geronimo.configs/concurrent/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/concurrent-deployer/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/javamail/2.2-SNAPSHOT/car">
        <gbean name="SMTPTransport">
            <attribute name="host">${SMTPHost}</attribute>
            <attribute name="port">${SMTPPort}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.plugins/uddi-db/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/uddi-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/welcome-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.framework/jmx-security/2.2-SNAPSHOT/car"
load="false">
        <gbean name="JMXSecureConnector">
            <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${JMXSecurePort + PortOffset}</attribute>
            <attribute
name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort +
PortOffset}/JMXSecureConnector</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/activemq-broker/2.2-SNAPSHOT/car"/>
    <module name="org.apache.geronimo.configs/activemq-ra/2.2-SNAPSHOT/car">
        <gbean name="ActiveMQ RA">
            <attribute
name="ServerUrl">tcp://${ServerHostname}:${ActiveMQPort +
PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/myfaces/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/myfaces-deployer/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/ca-helper-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-ds/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-car-ejb/2.2-SNAPSHOT/car"
load="false"/>
    <module
name="org.apache.geronimo.plugins.monitoring/agent-car-jmx/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/mconsole-ds/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/pluto-support/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.configs/dojo-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins.monitoring/mconsole-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/activemq-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/debugviews-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/plancreator-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/plugin-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/sysdb-console-tomcat/2.2-SNAPSHOT/car"/>
    <module
name="org.apache.geronimo.plugins/openejb-console-tomcat/2.2-SNAPSHOT/car"/>
    <module name="test/MyServer/1.0/car"/>
</attributes>



Geronimo config-substitutions.properties:

# Put variables and their substitution values in this file. 
# They will be used when processing the corresponding config.xml. 
# Values in this file can be overridden by environment variables and system
properties 
# by prefixing the property name with
'org.apache.geronimo.config.substitution.' 
# For example, an entry such as hostName=localhost 
# can be overridden by an environment variable or system property
org.apache.geronimo.config.substitution.hostName=foo 
# When running multiple instances of Geronimo choose a PortOffset value such
that none of the ports conflict. 
# For example, try PortOffset=10 
#Wed Oct 28 14:44:34 EDT 2009
ORBPort=6882
AJPPort=8009
MaxThreadPoolSize=500
ResourceBindingsNamePattern=
Capacity=1000
SMTPHost=localhost
StatelessPoolSize=10
StatelessTimeout=0
ResourceBindingsQuery=?\#org.apache.geronimo.naming.ResourceSource
DerbyPort=1527
BMPPoolSize=10
COSNamingPort=1050
StatefulTimeout=20
webcontainer=TomcatWebContainer
OpenEJBPort=4201
ORBSSLPort=2001
PortOffset=0
JMXPort=9999
ClusterNodeName=NODE
EndPointURI=http\://localhost\:8080
NamingPort=1099
DefaultWadiSweepInterval=36000
WebConnectorConTimeout=20000
WADIClusterName=DEFAULT_WADI_CLUSTER
BulkPassivate=100
MulticastDiscoveryPort=6142
HTTPSPort=8443
MinThreadPoolSize=200
MulticastDiscoveryAddress=239.255.3.2
ReplicaCount=2
ServerHostname=0.0.0.0
ActiveMQPort=61616
SMTPPort=25
webcontainerName=tomcat6
ResourceBindingsNameInNamespace=jca\:
StrictPooling=true
JMXSecurePort=9998
DefaultWadiNumPartitions=24
AccessTimeout=30
HTTPPort=8080
FarmName=DEFAULT_FARM
ClusterName=cluster1
ResourceBindingsFormat={groupId}/{artifactId}/{j2eeType}/{name}
RemoteDeployHostname=localhost
TmId=71,84,77,73,68




David Blevins wrote:
> 
> 
> On Oct 29, 2009, at 10:19 AM, bitz wrote:
> 
>>
>> Good question.  I haven't configured a cluster.  I have one instance  
>> of
>> Geronimo 2.2 running, and didn't make any changes to the default  
>> config.
>> The client side code is a very simple test app.  At this point, I'm  
>> only
>> doing some research and testing, nothing fancy.  Is clustering somehow
>> enabled by default?
> 
> It is enabled by default, though it is designed so that it (should)  
> have no effect unless there actually *is* a cluster.  Clearly  
> something i s not lined up correctly.  I'll have a look in the code.
> 
> Can you post your related server side config?
> 
> 
> -David
> 
>> Quintin Beukes-2 wrote:
>>>
>>> Are you using clustering?
>>>
>>> Quintin Beukes
>>>
>>>
>>>
>>> On Thu, Oct 29, 2009 at 1:05 AM, bitz <th...@canada.com>  
>>> wrote:
>>>>
>>>> I'm using Geronimo 2.2 which uses OpenEJB 3.1.2.  I have a client
>>>> application
>>>> which retrieves a remote EJB reference and makes a remote EJB method
>>>> call.
>>>> I'm seeing the following message being logged by the OpenEJB  
>>>> client on
>>>> the
>>>> client side...
>>>>
>>>> Oct 28, 2009 3:36:03 PM
>>>> org.apache.openejb.client.StickyConnectionStrategy
>>>> connect
>>>> WARNING: Failover: Cannot connect to server(s): ejbd://0.0.0.0:4201
>>>> Exception: Cannot connect to server 'ejbd://0.0.0.0:4201'.  Check  
>>>> that
>>>> the
>>>> server is started and that the specified serverURL is correct..   
>>>> Trying
>>>> next.
>>>>
>>>> Well, the serverURL is not correct, and it's also not the one I  
>>>> provided.
>>>> Here's a snippet of the client code...
>>>>
>>>> final URI serverURI = new URI( "ejbd", null, "192.168.0.1", 4201,  
>>>> null,
>>>> null, null );
>>>> final Properties contextProperties = new Properties( );
>>>> contextProperties.put( Context.INITIAL_CONTEXT_FACTORY,
>>>> "org.apache.openejb.client.RemoteInitialContextFactory" );
>>>> contextProperties.put( Context.PROVIDER_URL,  
>>>> serverURI.toString( ) );
>>>>
>>>> final InitialContext ctx = new InitialContext( contextProperties );
>>>> final MyEjbService remote = (MyEjbService)ctx.lookup("MyEjbRemote");
>>>> final String serverTime = remote.getServerTime();
>>>>
>>>> In
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server), the ctx.lookup("MyEjbRemote")  
>>>> call is
>>>> successful, but the next call to remote.getServerTime() produces the
>>>> error
>>>> message indicated above, yet still succeeds.  Further calls to
>>>> remote.getServerTime() work fine and do not produce any error  
>>>> messages.
>>>>
>>>> I debugged enough to find the cause.  I'll try to explain... The  
>>>> first
>>>> client-server communication involves a handshake where  
>>>> ClusterRequest and
>>>> ClusterResponse objects are exchanged.  During this handshake the  
>>>> server
>>>> returns a URI of "ejbd://0.0.0.0:4201".  On the next communication  
>>>> to the
>>>> server, for the remote.getServerTime() method call, the
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server) code attempts to use the URI  
>>>> returned by
>>>> the
>>>> server, which obviously fails, resulting in the message, then it  
>>>> falls
>>>> back
>>>> to the original, correct URI, which is successful.
>>>>
>>>> My question:  What is the reason for the ClusterRequest/ 
>>>> ClusterResponse
>>>> handshake, and why does the OpenEJB client try to connect using an
>>>> invalid
>>>> URI provided by server?
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26103713.html
>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26117261.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26158685.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: OpenEJB 3.1.2 - "Cannot connect to server" WARNING message

Posted by bitz <th...@canada.com>.
I'm using a snapshot of Geronimo 2.2, revision 830701, downloaded on Oct 28,
2009.  As I said, I did not alter the Geronimo config at all, but I've
pasted it for you below.  On the server side, there's a single stateless
session bean, with a single remote method.  Very simple.  Thanks for your
help.


Geronimo config.xml:

I'm unable to post this message with the entire config.xml file, so I've
stripped it down to what I think are the relevant bits.

    <module name="org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car">
        <gbean name="EJBNetworkService">
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute
name="multicastHost">${MulticastDiscoveryAddress}</attribute>
            <attribute
name="multicastPort">${MulticastDiscoveryPort}</attribute>
            <attribute name="clusterName">${ClusterName}</attribute>
        </gbean>
        <gbean name="DefaultStatefulContainer">
            <attribute name="timeout">${StatefulTimeout}</attribute>
            <attribute name="capacity">${Capacity}</attribute>
            <attribute name="bulkPassivate">${BulkPassivate}</attribute>
        </gbean>
        <gbean name="DefaultSingletonContainer">
            <attribute name="accessTimeout">${AccessTimeout}</attribute>
        </gbean>
        <gbean name="DefaultBMPContainer">
            <attribute name="poolSize">${BMPPoolSize}</attribute>
        </gbean>
        <gbean name="DefaultStatelessContainer">
            <attribute name="timeout">${StatelessTimeout}</attribute>
            <attribute name="poolSize">${StatelessPoolSize}</attribute>
            <attribute name="strictPooling">${StrictPooling}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-deployer/2.2-SNAPSHOT/car">
        <gbean name="EjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
        <gbean name="ClientEjbRefBuilder">
            <attribute
name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module
name="org.apache.geronimo.configs/openejb-clustering-wadi/2.2-SNAPSHOT/car"
load="false"/>

Geronimo config-substitutions.properties:

# Put variables and their substitution values in this file. 
# They will be used when processing the corresponding config.xml. 
# Values in this file can be overridden by environment variables and system
properties 
# by prefixing the property name with
'org.apache.geronimo.config.substitution.' 
# For example, an entry such as hostName=localhost 
# can be overridden by an environment variable or system property
org.apache.geronimo.config.substitution.hostName=foo 
# When running multiple instances of Geronimo choose a PortOffset value such
that none of the ports conflict. 
# For example, try PortOffset=10 
#Wed Oct 28 14:44:34 EDT 2009
ORBPort=6882
AJPPort=8009
MaxThreadPoolSize=500
ResourceBindingsNamePattern=
Capacity=1000
SMTPHost=localhost
StatelessPoolSize=10
StatelessTimeout=0
ResourceBindingsQuery=?\#org.apache.geronimo.naming.ResourceSource
DerbyPort=1527
BMPPoolSize=10
COSNamingPort=1050
StatefulTimeout=20
webcontainer=TomcatWebContainer
OpenEJBPort=4201
ORBSSLPort=2001
PortOffset=0
JMXPort=9999
ClusterNodeName=NODE
EndPointURI=http\://localhost\:8080
NamingPort=1099
DefaultWadiSweepInterval=36000
WebConnectorConTimeout=20000
WADIClusterName=DEFAULT_WADI_CLUSTER
BulkPassivate=100
MulticastDiscoveryPort=6142
HTTPSPort=8443
MinThreadPoolSize=200
MulticastDiscoveryAddress=239.255.3.2
ReplicaCount=2
ServerHostname=0.0.0.0
ActiveMQPort=61616
SMTPPort=25
webcontainerName=tomcat6
ResourceBindingsNameInNamespace=jca\:
StrictPooling=true
JMXSecurePort=9998
DefaultWadiNumPartitions=24
AccessTimeout=30
HTTPPort=8080
FarmName=DEFAULT_FARM
ClusterName=cluster1
ResourceBindingsFormat={groupId}/{artifactId}/{j2eeType}/{name}
RemoteDeployHostname=localhost
TmId=71,84,77,73,68




David Blevins wrote:
> 
> 
> On Oct 29, 2009, at 10:19 AM, bitz wrote:
> 
>>
>> Good question.  I haven't configured a cluster.  I have one instance  
>> of
>> Geronimo 2.2 running, and didn't make any changes to the default  
>> config.
>> The client side code is a very simple test app.  At this point, I'm  
>> only
>> doing some research and testing, nothing fancy.  Is clustering somehow
>> enabled by default?
> 
> It is enabled by default, though it is designed so that it (should)  
> have no effect unless there actually *is* a cluster.  Clearly  
> something i s not lined up correctly.  I'll have a look in the code.
> 
> Can you post your related server side config?
> 
> 
> -David
> 
>> Quintin Beukes-2 wrote:
>>>
>>> Are you using clustering?
>>>
>>> Quintin Beukes
>>>
>>>
>>>
>>> On Thu, Oct 29, 2009 at 1:05 AM, bitz <th...@canada.com>  
>>> wrote:
>>>>
>>>> I'm using Geronimo 2.2 which uses OpenEJB 3.1.2.  I have a client
>>>> application
>>>> which retrieves a remote EJB reference and makes a remote EJB method
>>>> call.
>>>> I'm seeing the following message being logged by the OpenEJB  
>>>> client on
>>>> the
>>>> client side...
>>>>
>>>> Oct 28, 2009 3:36:03 PM
>>>> org.apache.openejb.client.StickyConnectionStrategy
>>>> connect
>>>> WARNING: Failover: Cannot connect to server(s): ejbd://0.0.0.0:4201
>>>> Exception: Cannot connect to server 'ejbd://0.0.0.0:4201'.  Check  
>>>> that
>>>> the
>>>> server is started and that the specified serverURL is correct..   
>>>> Trying
>>>> next.
>>>>
>>>> Well, the serverURL is not correct, and it's also not the one I  
>>>> provided.
>>>> Here's a snippet of the client code...
>>>>
>>>> final URI serverURI = new URI( "ejbd", null, "192.168.0.1", 4201,  
>>>> null,
>>>> null, null );
>>>> final Properties contextProperties = new Properties( );
>>>> contextProperties.put( Context.INITIAL_CONTEXT_FACTORY,
>>>> "org.apache.openejb.client.RemoteInitialContextFactory" );
>>>> contextProperties.put( Context.PROVIDER_URL,  
>>>> serverURI.toString( ) );
>>>>
>>>> final InitialContext ctx = new InitialContext( contextProperties );
>>>> final MyEjbService remote = (MyEjbService)ctx.lookup("MyEjbRemote");
>>>> final String serverTime = remote.getServerTime();
>>>>
>>>> In
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server), the ctx.lookup("MyEjbRemote")  
>>>> call is
>>>> successful, but the next call to remote.getServerTime() produces the
>>>> error
>>>> message indicated above, yet still succeeds.  Further calls to
>>>> remote.getServerTime() work fine and do not produce any error  
>>>> messages.
>>>>
>>>> I debugged enough to find the cause.  I'll try to explain... The  
>>>> first
>>>> client-server communication involves a handshake where  
>>>> ClusterRequest and
>>>> ClusterResponse objects are exchanged.  During this handshake the  
>>>> server
>>>> returns a URI of "ejbd://0.0.0.0:4201".  On the next communication  
>>>> to the
>>>> server, for the remote.getServerTime() method call, the
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server) code attempts to use the URI  
>>>> returned by
>>>> the
>>>> server, which obviously fails, resulting in the message, then it  
>>>> falls
>>>> back
>>>> to the original, correct URI, which is successful.
>>>>
>>>> My question:  What is the reason for the ClusterRequest/ 
>>>> ClusterResponse
>>>> handshake, and why does the OpenEJB client try to connect using an
>>>> invalid
>>>> URI provided by server?
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26103713.html
>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26117261.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26158990.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: OpenEJB 3.1.2 - "Cannot connect to server" WARNING message

Posted by bitz <th...@canada.com>.
I'm using a snapshot of Geronimo 2.2, revision 830701, downloaded on Oct 28,
2009.  As I said, I did not alter the Geronimo config at all, but I've
pasted it for you below.  On the server side, there's a single stateless
session bean, with a single remote method.  Very simple.  Thanks for your
help.


Geronimo config.xml:

I'm unable to post with the config.xml contents embedded, so I've attached
it as a file.

Geronimo config-substitutions.properties:

# Put variables and their substitution values in this file. 
# They will be used when processing the corresponding config.xml. 
# Values in this file can be overridden by environment variables and system
properties 
# by prefixing the property name with
'org.apache.geronimo.config.substitution.' 
# For example, an entry such as hostName=localhost 
# can be overridden by an environment variable or system property
org.apache.geronimo.config.substitution.hostName=foo 
# When running multiple instances of Geronimo choose a PortOffset value such
that none of the ports conflict. 
# For example, try PortOffset=10 
#Wed Oct 28 14:44:34 EDT 2009
ORBPort=6882
AJPPort=8009
MaxThreadPoolSize=500
ResourceBindingsNamePattern=
Capacity=1000
SMTPHost=localhost
StatelessPoolSize=10
StatelessTimeout=0
ResourceBindingsQuery=?\#org.apache.geronimo.naming.ResourceSource
DerbyPort=1527
BMPPoolSize=10
COSNamingPort=1050
StatefulTimeout=20
webcontainer=TomcatWebContainer
OpenEJBPort=4201
ORBSSLPort=2001
PortOffset=0
JMXPort=9999
ClusterNodeName=NODE
EndPointURI=http\://localhost\:8080
NamingPort=1099
DefaultWadiSweepInterval=36000
WebConnectorConTimeout=20000
WADIClusterName=DEFAULT_WADI_CLUSTER
BulkPassivate=100
MulticastDiscoveryPort=6142
HTTPSPort=8443
MinThreadPoolSize=200
MulticastDiscoveryAddress=239.255.3.2
ReplicaCount=2
ServerHostname=0.0.0.0
ActiveMQPort=61616
SMTPPort=25
webcontainerName=tomcat6
ResourceBindingsNameInNamespace=jca\:
StrictPooling=true
JMXSecurePort=9998
DefaultWadiNumPartitions=24
AccessTimeout=30
HTTPPort=8080
FarmName=DEFAULT_FARM
ClusterName=cluster1
ResourceBindingsFormat={groupId}/{artifactId}/{j2eeType}/{name}
RemoteDeployHostname=localhost
TmId=71,84,77,73,68




David Blevins wrote:
> 
> 
> On Oct 29, 2009, at 10:19 AM, bitz wrote:
> 
>>
>> Good question.  I haven't configured a cluster.  I have one instance  
>> of
>> Geronimo 2.2 running, and didn't make any changes to the default  
>> config.
>> The client side code is a very simple test app.  At this point, I'm  
>> only
>> doing some research and testing, nothing fancy.  Is clustering somehow
>> enabled by default?
> 
> It is enabled by default, though it is designed so that it (should)  
> have no effect unless there actually *is* a cluster.  Clearly  
> something i s not lined up correctly.  I'll have a look in the code.
> 
> Can you post your related server side config?
> 
> 
> -David
> 
>> Quintin Beukes-2 wrote:
>>>
>>> Are you using clustering?
>>>
>>> Quintin Beukes
>>>
>>>
>>>
>>> On Thu, Oct 29, 2009 at 1:05 AM, bitz <th...@canada.com>  
>>> wrote:
>>>>
>>>> I'm using Geronimo 2.2 which uses OpenEJB 3.1.2.  I have a client
>>>> application
>>>> which retrieves a remote EJB reference and makes a remote EJB method
>>>> call.
>>>> I'm seeing the following message being logged by the OpenEJB  
>>>> client on
>>>> the
>>>> client side...
>>>>
>>>> Oct 28, 2009 3:36:03 PM
>>>> org.apache.openejb.client.StickyConnectionStrategy
>>>> connect
>>>> WARNING: Failover: Cannot connect to server(s): ejbd://0.0.0.0:4201
>>>> Exception: Cannot connect to server 'ejbd://0.0.0.0:4201'.  Check  
>>>> that
>>>> the
>>>> server is started and that the specified serverURL is correct..   
>>>> Trying
>>>> next.
>>>>
>>>> Well, the serverURL is not correct, and it's also not the one I  
>>>> provided.
>>>> Here's a snippet of the client code...
>>>>
>>>> final URI serverURI = new URI( "ejbd", null, "192.168.0.1", 4201,  
>>>> null,
>>>> null, null );
>>>> final Properties contextProperties = new Properties( );
>>>> contextProperties.put( Context.INITIAL_CONTEXT_FACTORY,
>>>> "org.apache.openejb.client.RemoteInitialContextFactory" );
>>>> contextProperties.put( Context.PROVIDER_URL,  
>>>> serverURI.toString( ) );
>>>>
>>>> final InitialContext ctx = new InitialContext( contextProperties );
>>>> final MyEjbService remote = (MyEjbService)ctx.lookup("MyEjbRemote");
>>>> final String serverTime = remote.getServerTime();
>>>>
>>>> In
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server), the ctx.lookup("MyEjbRemote")  
>>>> call is
>>>> successful, but the next call to remote.getServerTime() produces the
>>>> error
>>>> message indicated above, yet still succeeds.  Further calls to
>>>> remote.getServerTime() work fine and do not produce any error  
>>>> messages.
>>>>
>>>> I debugged enough to find the cause.  I'll try to explain... The  
>>>> first
>>>> client-server communication involves a handshake where  
>>>> ClusterRequest and
>>>> ClusterResponse objects are exchanged.  During this handshake the  
>>>> server
>>>> returns a URI of "ejbd://0.0.0.0:4201".  On the next communication  
>>>> to the
>>>> server, for the remote.getServerTime() method call, the
>>>> org 
>>>> .apache 
>>>> .openejb.client.StickyConnectionStrategy.connect(ClusterMetaData
>>>> cluster, ServerMetaData server) code attempts to use the URI  
>>>> returned by
>>>> the
>>>> server, which obviously fails, resulting in the message, then it  
>>>> falls
>>>> back
>>>> to the original, correct URI, which is successful.
>>>>
>>>> My question:  What is the reason for the ClusterRequest/ 
>>>> ClusterResponse
>>>> handshake, and why does the OpenEJB client try to connect using an
>>>> invalid
>>>> URI provided by server?
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26103713.html
>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26117261.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/OpenEJB-3.1.2---%22Cannot-connect-to-server%22-WARNING-message-tp26103713p26159141.html
Sent from the OpenEJB User mailing list archive at Nabble.com.