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 <the_bitbucket@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.
|