-
15. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 12:12 PM (in response to ataylor)I have this following logs:
INFO: live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/var/webapps/formation/hornetq/journal,bindingsDirectory=/var/webapps/formation/hornetq/bindings,largeMessagesDirectory=/var/webapps/formation/hornetq/large-messages,pagingDirectory=/var/webapps/formation/hornetq/paging)
30 oct. 2012 06:56:36 org.hornetq.core.logging.impl.JULLogDelegate warn
ATTENTION: Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.
But why :
ATTENTION: Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.
Log instead clustering configuration sin't activated, it's normal ?
And do you think sharedStore=true can act in this problem ? What is exactly this shared store ?
-
16. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 12:16 PM (in response to adryen31)shared store is used for clustering
like i say, prepare me an example i can run and i can help you more
-
17. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 1:41 AM (in response to ataylor)I have already say, I can't it's a no open source code of my enterprise ...
I would have liked to , but I do not have the right
It's is very complicated for me. I can see in file system what shared store is located ?
because each hornetq instance have different configurations of:
<paging-directory>/var/webapps/ROOT/hornetq/paging</paging-directory>
<bindings-directory>/var/webapps/ROOT/hornetq/bindings</bindings-directory>
<journal-directory>/var/webapps/ROOT/hornetq/journal</journal-directory>
-
18. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 4:12 AM (in response to adryen31)I have the following stacktrace when I launch one application i tomcat:
HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:774)
at com.edeal.frontline.messaging.impl.PublisherSubscriberMessagingManagerImpl.<init>(PublisherSubscriberMessagingManagerImpl.java:51)
at com.edeal.frontline.messaging.impl.MessagingServerWrapper.start(MessagingServerWrapper.java:93)
at com.edeal.frontline.FrontlineLoaderServlet.loadMessagingServer(FrontlineLoaderServlet.java:85)
at com.edeal.frontline.FrontlineLoaderServlet.init(FrontlineLoaderServlet.java:72)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
I have also this informations:
On one node:
TransportConfiguration Name: 02222cf8-2331-11e2-a7b8-b35f4c078e5a
NettyConnector [host=localhost, port=5445, httpEnabled=false, useServlet=false, servletPath=/messaging/HornetQServlet, sslEnabled=false, useNio=false]
RemotingConnectionImpl [clientID=null, nodeID=null, transportConnection=org.hornetq.core.remoting.impl.netty.NettyConnection@334021a9[local= /127.0.0.1:52544, remote=localhost/127.0.0.1:5445]]
On other node:
TransportConfiguration Name: 82a187e9-2331-11e2-ba74-0dda6c50fc08
NettyConnector [host=localhost, port=5445, httpEnabled=false, useServlet=false, servletPath=/messaging/HornetQServlet, sslEnabled=false, useNio=false]
RemotingConnectionImpl [clientID=null, nodeID=null, transportConnection=org.hornetq.core.remoting.impl.netty.NettyConnection@1b4a8134[local= /127.0.0.1:52598, remote=localhost/127.0.0.1:5445]]
I don't understand why previous 2 nodes bind remote=localhost/127.0.0.1:5445
I use it:
TransportConfiguration tc = new TransportConfiguration(NettyConnectorFactory.class.getName());
System.out.println("********************************** Transport Configuration ****************************************");
System.out.println(tc.getName());
System.out.println(tc.getParams());
System.out.println("***************************************************************************");
final ServerLocator serverLocator = HornetQClient.createServerLocatorWithHA(tc);
LOGGER.info("Publisher/Subscriber messaging manager initialization beginning");
try {
this.clientSessionFactory = serverLocator.createSessionFactory();
Perhaps the client session factory is the same on each node into each webapp ...
possible which share all sale netty connection / remote connection ?
-
19. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 5:03 AM (in response to adryen31)I have already say, I can't it's a no open source code of my enterprise ...
without an example that i can use i can't really help you any more, you don't have to use you application, I was just saying you could write something that does a similar thing
-
20. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 5:22 AM (in response to ataylor)I will try to use you idea one unique hornetq for all four applications, but on each application I instanciate by this:
But I think my previous code like this itsn't take in account:
String serverConfigurationFilePath = "/META-INF/hornetq-configuration.xml";
URL scfpURL = Class.forName("com.webapp.MyClass").getResource(serverConfigurationFilePath);
FileConfiguration configuration;
configuration.setConfigurationUrl(scfpURL.toURI().toString());
configuration.start();
HornetQ messagingServer = HornetQServers.newHornetQServer(this.configuration);
TransportConfiguration tc = new TransportConfiguration(NettyConnectorFactory.class.getName());
final ServerLocator serverLocator = HornetQClient.createServerLocatorWithHA(tc);
this.clientSessionFactory = serverLocator.createSessionFactory();
this.clientProducerSession = this.clientSessionFactory.createSession();
this.clientProducer = this.clientProducerSession.createProducer();
When I can force my HornetQClient to use same conf of my previous :HornetQ messagingServer = HornetQServers.newHornetQServer(this.configuration);
?
-
21. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 5:24 AM (in response to adryen31)I will try to use you idea one unique hornetq for all four applications
Thats what you should be doing anyway, it makes no sense to have multiple servers.
-
22. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 5:26 AM (in response to ataylor)Your idea, one hornetq instance and not one hornetq instance for each webapp
-
23. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 5:28 AM (in response to adryen31)Your idea, one hornetq instance and not one hornetq instance for each webapp
One instance shared by all apps, i dont see why you would want to have multiple servers, you wouldnt do that with a database would you?
-
24. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 5:49 AM (in response to ataylor)I don't want to have multiple servers, now I search to have in only one tomcat, 4 webapp which use 1 common hornetq.
how I can recover a hornetq client from my configuration used to create my hornetq server:
URL scfpURL = Class.forName("com.webapp.MyClass").getResource(serverConfigurationFilePath);
FileConfiguration configuration;
configuration.setConfigurationUrl(scfpURL.toURI().toString());
configuration.start();
HornetQ messagingServer = HornetQServers.newHornetQServer(this.configuration);
TransportConfiguration tc = new TransportConfiguration(NettyConnectorFactory.class.getName());
final ServerLocator serverLocator = HornetQClient.createServerLocatorWithHA(tc);
this.clientSessionFactory = serverLocator.createSessionFactory();
this.clientProducerSession = this.clientSessionFactory.createSession();
this.clientProducer = this.clientProducerSession.createProducer();
-
25. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 6:01 AM (in response to adryen31)Im not really sure what your asking, simply deploy hornetq configure it as you want and configure the clients to look it up. also you shoaul be able to use the invm connector instead of netty
-
26. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 6:17 AM (in response to ataylor)Yes but how I can recover clients ? how I can look it ? Why invm instead netty ?
-
27. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 6:20 AM (in response to adryen31)Yes but how I can recover clients ? how I can look it ?
Im not sure what you mean here
Why invm instead netty ?
Well all your apps are in the same vm so why use a network.
-
28. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 31, 2012 8:27 AM (in response to ataylor)Yes for invm because for the moment all my 4 webapp which can use hornetq are in same tomcat, but imagine in futur I split my 4 webapp, in 2 webapp in 2 tomcat on my network, it will no longer be in the same vm
and invm connector it does not work in this case.
Andy Taylor a écrit:
Yes but how I can recover clients ? how I can look it ?
Im not sure what you mean here
Why invm instead netty ?
Well all your apps are in the same vm so why use a network.
I have this following configuration:
URL scfpURL = Class.forName("com.webapp.MyClass").getResource(serverConfigurationFilePath);
FileConfiguration configuration;
configuration.setConfigurationUrl(scfpURL.toURI().toString());
configuration.start();
HornetQ messagingServer = HornetQServers.newHornetQServer(this.configuration);
messagingServer.start();
Ok but when in another webapp I can check if server is already start or not, and if is already starthow I can the webapp on the already running hornetq instance ?
And when I can recover my clientSessionFactory with same configuration file ?
-
29. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 31, 2012 9:22 AM (in response to adryen31)Ok but when in another webapp I can check if server is already start or not, and if is already starthow I can the webapp on the already running hornetq instance ?
you should deploy it so its always running
And when I can recover my clientSessionFactory with same configuration file ?
I'm not even sure what you are asking here