Notice how the port number (8009) specified for the mod_jk connector on
"instance1" matches the value of the corresponding
worker.instance1.port
in the sample workers.properties below.
# Define 1 real worker using ajp13 with this sample workers.properties
worker.list=loadbalancer
#Set properties for instance1
worker.instance1.type=ajp13
worker.instance1.host=my.domain1.com
worker.instance1.port=8009
asadmin create-system-properties --target instance1 AJP_INSTANCE_NAME=instance1
asadmin create-system-properties --target instance1 AJP_PORT=8009
did you start the AJP instance with the same jk port defined in workers.properties?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> To: users_at_glassfish.dev.java.net
> Subject: cluster + mod_jk loadbalancer (+ session replication)
> From: forums_at_java.net
> Date: Sat, 30 Jul 2011 20:12:07 -0500
>
> Hi,
> I've been trying to setup a cluster and use mod_jk for loadbalancing. I
> followed this tutorial :
> http://wikis.sun.com/display/GlassFish/LoadBalanceMod_jkDemo , but
> unfortunaly it's not workig for me.
> I'm getting following exceptions when I try to deploy an application :
> Cannot start container web
> java.lang.NullPointerException
> at
> com.sun.enterprise.web.WebContainer.createJKConnector(WebContainer.java:965)
> at
> com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:554)
> at
> com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
> at
> com.sun.hk2.component.ConstructorCreator$1.run(ConstructorCreator.java:86)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:83)
> at
> com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
> at
> com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
> at
> com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
> at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
> at
> org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:93)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.startContainers(ApplicationLifecycle.java:955)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:684)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:282)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:86)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:141)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:138)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:215)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:224)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:253)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:138)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.InstanceDeployCommand.execute(InstanceDeployCommand.java:186)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1048)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at java.lang.Thread.run(Thread.java:619)
> |#]
> [#|2011-07-31T02:36:08.410+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=99;_ThreadName=Thread-2;|Aborting,
> Failed to start container com.sun.enterprise.web.WebContainer|#]
> [#|2011-07-31T02:36:08.420+0200|WARNING|glassfish3.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=99;_ThreadName=Thread-2;|Error
> occurred
> java.lang.Exception: Aborting, Failed to start container
> com.sun.enterprise.web.WebContainer
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:687)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:282)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:86)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:141)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:138)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:215)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:224)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:253)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:138)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.InstanceDeployCommand.execute(InstanceDeployCommand.java:186)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1048)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at java.lang.Thread.run(Thread.java:619)
> |#]
> [#|2011-07-31T02:36:08.442+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=99;_ThreadName=Thread-2;|Exception
> while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare
> method|#]
> [#|2011-07-31T02:36:08.445+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=99;_ThreadName=Thread-2;|Exception
> while preparing the app|#]
> [#|2011-07-31T02:36:08.446+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=99;_ThreadName=Thread-2;|Aborting,
> Failed to start container com.sun.enterprise.web.WebContainer
> org.glassfish.deployment.common.DeploymentException: Aborting, Failed to
> start container com.sun.enterprise.web.WebContainer
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.InstanceDeployCommand.execute(InstanceDeployCommand.java:186)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1048)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
> at
> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.Exception: Aborting, Failed to start container
> com.sun.enterprise.web.WebContainer
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:687)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:282)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:86)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:141)
> at
> org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:138)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:215)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:224)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:253)
> at
> org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:138)
> ... 29 more
> |#]
> Any clue why this is happening ? When instead of creating a jk-listener I set
> JVM option :
> -Dcom.sun.enterprise.web.connector.enableJK=${AJP_PORT}, it seems to be
> working. But I read somewhere that this method is now deprecated and I should
> use the Network Listener. What's the difference anyway ?
> And I have another question. I'm trying to achieve session replication in the
> cluster. But when I try to test it and shutdown the instance to which I'm
> currenly logged, with a new request I'm redirected to another instance with
> new JSESSIONID and therefore my session data is lost. I managed to overcome
> this by setting worker.instance-name.domain=domain1 for all the workers in
> the workers.properties, but this seems to be causing some other issues. Is
> this the right approach ? Do I have to set the domain attribute when I want
> to get the session replication to work with mod_jk ?
> I would be very grateful for any advice or suggestion.
>
>
> --
>
> [Message sent by forum member 'thecid']
>
> View Post: http://forums.java.net/node/828025
>
>