You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Chris Hall <cr...@trifecta.com> on 2006/11/08 16:09:48 UTC
Clustering and Database Access
Hello,
I've been playing with a Geronimo cluster recently and it's gone rather
well thus far. Load balancing, session replication, and sticky sessions
are all working... but database access has me stumped.
I'm running into the following error when I attempt to deploy to the
cluster:
xml problem for web app .
...<snipped>...
Caused by: org.apache.xmlbeans.XmlException: Invalid deployment
descriptor: [error: cvc-complex-type.2.4a: Expected elements
'resource-ref@http://geronimo.apache.org/xml/ns/naming-1.1
resource-env-ref@http://geronimo.apache.org/xml/ns/naming-1.1
message-destination@http://geronimo.apache.org/xml/ns/naming-1.1
security-realm-name@http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1
gbean@http://geronimo.apache.org/xml/ns/deployment-1.1' instead of
'cluster@http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1' here]
The WAR works correctly on this server when the clustering GBeans aren't
included in the deployment plan, so I know the application and the
database pool are correct. The Geronimo sample applications deploy
correctly to the cluster and I can see session replication and sticky
sessions in action, so I know that the cluster is configured correctly.
The problem is in my deployment plan, and the error message confirms
this. However, it's virtually identical to the plan used by the sample
applications (which work on the cluster). The only difference is the
inclusion of a <resource-ref/> element to map the DB pool to a JNDI
resource (the same element that works without clustering). Pulling the
<resource-ref/> element out of the deployment plan and the web.xml
allows the application to deploy... though without DB access.
Has anyone configured a cluster with database access? Am I going about
this in the right way, or am I completely off-base?
I can provide the geronimo-web.xml and web.xml if they will help.
Thanks.
-Chris
Regd Geronimo, Login Modules and EJB Project
Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
I understand that under Geronimo 1.0 login modules
cannot be identified if they are part of the war file.
So,I created an ejb project and added the login
modules to that project.Now it is able to find the
login module but not the dependent classes that the
module uses.
For instance, my login module using some utility
classes which are in another jar. I added this jar to
the manifest classpath of the ejb project.
Now when I try to reference the login module class,it
finds the class but not the dependent class.
Is there a way to fix this?
____________________________________________________________________________________
Sponsored Link
Free Uniden 5.8GHz Phone System with Packet8 Internet Phone Service
http://www.getpacket8.net/yahoo2
Re: Clustering and Database Access
Posted by Chris Hall <cr...@trifecta.com>.
Aaron Mulder wrote:
> OK, the order of elements should be:
>
> 1) environment
> 2) context-root
> 3) cluster
> 4) resource-ref
> 5) gbean
>
> You can get this from:
>
> http://geronimo.apache.org/schemas-1.1/geronimo-tomcat-1.1.xsd
That did it. Thanks!
-Chris
Re: Clustering and Database Access
Posted by Aaron Mulder <am...@alumni.princeton.edu>.
OK, the order of elements should be:
1) environment
2) context-root
3) cluster
4) resource-ref
5) gbean
You can get this from:
http://geronimo.apache.org/schemas-1.1/geronimo-tomcat-1.1.xsd
If just putting things in that order doesn't do it, change the first
line of the resource-ref to:
<resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
Thanks,
Aaron
On 11/8/06, Chris Hall <cr...@trifecta.com> wrote:
> Aaron Mulder wrote:
> > Can you post your geronimo-web.xml? It sounds like maybe some
> > elements are out of order or have the wrong namespace. Or, if you
> > have an XML Schema validation tool or function in your IDE you might
> > try validating your geronimo-web.xml against the geronimo-tomcat
> > schema in the schemas/ directory of your Geronimo tree.
>
> I've tried shuffling the resource-ref around... should I be declaring it
> differently?
>
> Here's my geronimo-web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
>
> <dep:environment xmlns:dep="geronimo.apache.org/xml/ns/deployment-1.1">
> <dep:moduleId>
> <dep:groupId>webapp</dep:groupId>
> <dep:artifactId>store</dep:artifactId>
> <dep:version>1.0</dep:version>
> <dep:type>war</dep:type>
> </dep:moduleId>
> <dep:dependencies>
> <dep:dependency>
> <dep:groupId>console.dbpool</dep:groupId>
> <dep:artifactId>WebAppDS</dep:artifactId>
> </dep:dependency>
> </dep:dependencies>
> </dep:environment>
>
> <context-root>/</context-root>
>
> <resource-ref>
> <ref-name>jdbc/WebAppDS</ref-name>
> <resource-link>WebAppDS</resource-link>
> </resource-ref>
>
> <cluster>TomcatCluster</cluster>
>
> <!-- Cluster -->
> <gbean name="TomcatCluster"
> class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean">
> <attribute
> name="className">org.apache.catalina.cluster.tcp.SimpleTcpCluster</attribute>
> <attribute name="initParams">
>
> managerClassName=org.apache.catalina.cluster.session.DeltaManager
> expireSessionsOnShutdown=false
> useDirtyFlag=false
> notifyListenersOnReplication=true
> </attribute>
>
> <reference
> name="Membership"><name>TomcatMembership</name></reference>
> <reference name="Receiver"><name>TomcatReceiver</name></reference>
> <reference name="Sender"><name>TomcatSender</name></reference>
> <reference
> name="TomcatValveChain"><name>ReplicationValve</name></reference>
> </gbean>
>
> <!-- Membership -->
> <gbean name="TomcatMembership"
> class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean">
> <attribute
> name="className">org.apache.catalina.cluster.mcast.McastService</attribute>
> <attribute name="initParams">
> mcastAddr=228.0.0.4
> mcastBindAddress=127.0.0.1
> mcastPort=45564
> mcastFrequency=500
> mcastDropTime=3000
> </attribute>
> </gbean>
>
> <!-- Receiver -->
> <gbean name="TomcatReceiver"
> class="org.apache.geronimo.tomcat.cluster.ReceiverGBean">
> <attribute
> name="className">org.apache.catalina.cluster.tcp.ReplicationListener</attribute>
> <attribute name="initParams">
> tcpListenAddress=127.0.0.1
> tcpListenPort=4001
> tcpSelectorTimeout=100
> tcpThreadCount=6
> </attribute>
> </gbean>
>
> <!-- Sender -->
> <gbean name="TomcatSender"
> class="org.apache.geronimo.tomcat.cluster.SenderGBean">
> <attribute
> name="className">org.apache.catalina.cluster.tcp.ReplicationTransmitter</attribute>
> <attribute name="initParams">
> replicationMode=pooled
> ackTimeout=15000
> </attribute>
> </gbean>
>
> <!-- Valves -->
> <gbean name="ReplicationValve"
> class="org.apache.geronimo.tomcat.ValveGBean">
> <attribute
> name="className">org.apache.catalina.cluster.tcp.ReplicationValve</attribute>
> <attribute name="initParams">
>
> filter=.*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;
> </attribute>
> <reference
> name="NextValve"><name>JvmRouteBinderValve</name></reference>
> </gbean>
> <gbean name="JvmRouteBinderValve"
> class="org.apache.geronimo.tomcat.ValveGBean">
> <attribute
> name="className">org.apache.catalina.cluster.session.JvmRouteBinderValve</attribute>
> <attribute name="initParams">
> enabled=true
> </attribute>
> </gbean>
>
> </web-app>
>
>
> Thanks.
>
> -Chris
>
Re: Clustering and Database Access
Posted by Chris Hall <cr...@trifecta.com>.
Aaron Mulder wrote:
> Can you post your geronimo-web.xml? It sounds like maybe some
> elements are out of order or have the wrong namespace. Or, if you
> have an XML Schema validation tool or function in your IDE you might
> try validating your geronimo-web.xml against the geronimo-tomcat
> schema in the schemas/ directory of your Geronimo tree.
I've tried shuffling the resource-ref around... should I be declaring it
differently?
Here's my geronimo-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
<dep:environment xmlns:dep="geronimo.apache.org/xml/ns/deployment-1.1">
<dep:moduleId>
<dep:groupId>webapp</dep:groupId>
<dep:artifactId>store</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>war</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>console.dbpool</dep:groupId>
<dep:artifactId>WebAppDS</dep:artifactId>
</dep:dependency>
</dep:dependencies>
</dep:environment>
<context-root>/</context-root>
<resource-ref>
<ref-name>jdbc/WebAppDS</ref-name>
<resource-link>WebAppDS</resource-link>
</resource-ref>
<cluster>TomcatCluster</cluster>
<!-- Cluster -->
<gbean name="TomcatCluster"
class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean">
<attribute
name="className">org.apache.catalina.cluster.tcp.SimpleTcpCluster</attribute>
<attribute name="initParams">
managerClassName=org.apache.catalina.cluster.session.DeltaManager
expireSessionsOnShutdown=false
useDirtyFlag=false
notifyListenersOnReplication=true
</attribute>
<reference
name="Membership"><name>TomcatMembership</name></reference>
<reference name="Receiver"><name>TomcatReceiver</name></reference>
<reference name="Sender"><name>TomcatSender</name></reference>
<reference
name="TomcatValveChain"><name>ReplicationValve</name></reference>
</gbean>
<!-- Membership -->
<gbean name="TomcatMembership"
class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean">
<attribute
name="className">org.apache.catalina.cluster.mcast.McastService</attribute>
<attribute name="initParams">
mcastAddr=228.0.0.4
mcastBindAddress=127.0.0.1
mcastPort=45564
mcastFrequency=500
mcastDropTime=3000
</attribute>
</gbean>
<!-- Receiver -->
<gbean name="TomcatReceiver"
class="org.apache.geronimo.tomcat.cluster.ReceiverGBean">
<attribute
name="className">org.apache.catalina.cluster.tcp.ReplicationListener</attribute>
<attribute name="initParams">
tcpListenAddress=127.0.0.1
tcpListenPort=4001
tcpSelectorTimeout=100
tcpThreadCount=6
</attribute>
</gbean>
<!-- Sender -->
<gbean name="TomcatSender"
class="org.apache.geronimo.tomcat.cluster.SenderGBean">
<attribute
name="className">org.apache.catalina.cluster.tcp.ReplicationTransmitter</attribute>
<attribute name="initParams">
replicationMode=pooled
ackTimeout=15000
</attribute>
</gbean>
<!-- Valves -->
<gbean name="ReplicationValve"
class="org.apache.geronimo.tomcat.ValveGBean">
<attribute
name="className">org.apache.catalina.cluster.tcp.ReplicationValve</attribute>
<attribute name="initParams">
filter=.*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;
</attribute>
<reference
name="NextValve"><name>JvmRouteBinderValve</name></reference>
</gbean>
<gbean name="JvmRouteBinderValve"
class="org.apache.geronimo.tomcat.ValveGBean">
<attribute
name="className">org.apache.catalina.cluster.session.JvmRouteBinderValve</attribute>
<attribute name="initParams">
enabled=true
</attribute>
</gbean>
</web-app>
Thanks.
-Chris
Re: Clustering and Database Access
Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Can you post your geronimo-web.xml? It sounds like maybe some
elements are out of order or have the wrong namespace. Or, if you
have an XML Schema validation tool or function in your IDE you might
try validating your geronimo-web.xml against the geronimo-tomcat
schema in the schemas/ directory of your Geronimo tree.
Thanks,
Aaron
On 11/8/06, Chris Hall <cr...@trifecta.com> wrote:
> Hello,
>
> I've been playing with a Geronimo cluster recently and it's gone rather
> well thus far. Load balancing, session replication, and sticky sessions
> are all working... but database access has me stumped.
>
> I'm running into the following error when I attempt to deploy to the
> cluster:
>
> xml problem for web app .
> ...<snipped>...
> Caused by: org.apache.xmlbeans.XmlException: Invalid deployment
> descriptor: [error: cvc-complex-type.2.4a: Expected elements
> 'resource-ref@http://geronimo.apache.org/xml/ns/naming-1.1
> resource-env-ref@http://geronimo.apache.org/xml/ns/naming-1.1
> message-destination@http://geronimo.apache.org/xml/ns/naming-1.1
> security-realm-name@http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1
> gbean@http://geronimo.apache.org/xml/ns/deployment-1.1' instead of
> 'cluster@http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1' here]
>
>
> The WAR works correctly on this server when the clustering GBeans aren't
> included in the deployment plan, so I know the application and the
> database pool are correct. The Geronimo sample applications deploy
> correctly to the cluster and I can see session replication and sticky
> sessions in action, so I know that the cluster is configured correctly.
>
> The problem is in my deployment plan, and the error message confirms
> this. However, it's virtually identical to the plan used by the sample
> applications (which work on the cluster). The only difference is the
> inclusion of a <resource-ref/> element to map the DB pool to a JNDI
> resource (the same element that works without clustering). Pulling the
> <resource-ref/> element out of the deployment plan and the web.xml
> allows the application to deploy... though without DB access.
>
> Has anyone configured a cluster with database access? Am I going about
> this in the right way, or am I completely off-base?
>
> I can provide the geronimo-web.xml and web.xml if they will help.
>
> Thanks.
>
>
> -Chris
>