1
votes

I created a Spring, Hibernate, Hazelcast integrated application.

The Spring Config file looks like this:- SpringDispatcher-context.xml

        <?xml version="1.0" encoding="UTF-8"?>
        <!-- <beans xmlns="http://www.springframework.org/schema/beans"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:mvc="http://www.springframework.org/schema/mvc"
            xmlns:hz="http://www.hazelcast.com/schema/spring"
            xmlns:context="http://www.springframework.org/schema/context"
            xsi:schemaLocation="
                http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.hazelcast.com/schema/spring
                http://www.hazelcast.com/schema/spring/hazelcast-spring-3.0.xsd">
         -->


         <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:hz="http://www.hazelcast.com/schema/spring"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.hazelcast.com/schema/spring
        http://www.hazelcast.com/schema/spring/hazelcast-spring-3.2.xsd">





        <hz:hazelcast id="hazelastInstance">


            <hz:config>


                <hz:group name="dev" password="password" />
                <hz:network port="5701" port-auto-increment="false">
                    <hz:join>
                        <hz:multicast enabled="false" multicast-group="225.225.225.0"
                            multicast-port="54327" />

                        <hz:tcp-ip enabled="true">
                            <hz:members>192.168.0.101, 192.168.0.104</hz:members>
                        </hz:tcp-ip>
                    </hz:join>
                </hz:network>
                <!-- <hz:map name="map" backup-count="2" max-size="0"
                    eviction-percentage="30" read-backup-data="true" cache-value="true"
                    eviction-policy="NONE" merge-policy="com.hazelcast.map.merge.PassThroughMergePolicy" /> -->
            </hz:config>
            </hz:hazelcast>




        <!-- <bean id="sessionFactory"
                class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
                <property name="configLocation">
                    <value>classpath:hibernate.cfg.xml</value>
                </property>
                <property name="configurationClass">
                    <value>org.hibernate.cfg.Configuration</value>
                </property>
            </bean> -->


        <bean id="sessionFactory"  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
         <property name="dataSource" ref="dataSource"></property>
         <property name="packagesToScan" value="com.last.forms"></property>
         <property name="hibernateProperties">
            <props>
                <prop key="dialect">org.hibernate.dialect.MySQL5Dialect</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="show_sql">false</prop>
                <prop key="connection.pool_size">1</prop>
            </props>
         </property>    


         <property name="configLocation">
                    <value>classpath:hibernate.cfg.xml</value>
                </property>
        </bean>


        <bean id="dataSource" 
            class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
              <property name="driverClassName" value="com.mysql.jdbc.Driver" /> 
              <property name="url" value="jdbc:mysql://localhost/mock_data" /> 
              <property name="username" value="root" /> 
              <property name="password" value="root" /> 
           </bean> 


           <context:component-scan base-package="com.last.controllers" />
         <mvc:annotation-driven />




           <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
                <property name="prefix" value="/WEB-INF/jsp/" />
                <property name="suffix" value=".jsp" />
            </bean>

        </beans>

The various Hazelcast tutorials ask me to copy the following line of code in Hazelcast.xml.

    <management-center enabled="true">http://localhost:8080/mancenter-3.2-RC2</management-center>

But I do not use the Hazelcast.xml which I finally found in the Hazelcast package's bin folder.

Instead I copied Hazelcast jars to my lib folder in eclipse.

What configuration will I need to do in my workspace to run the Mancenter Management Center?

1
Please note that my mancenter-3.2-RC2.war is deployed on the server.Dipanshu Verma
Also I have tried to connect to hazelcast instances from man.center by clicking the part "or click here to assign web url dynamically (not recommended)"Dipanshu Verma

1 Answers

4
votes

Mancenter Management Center is like a stand alone web application. You can deploy its WAR in your web application server and it should run. To make sure it is up and running, try hitting it from your browser. Once that is done, set you hazelcast to connect to it. This is done in hazelcast.xml.

<management-center enabled="true">http://localhost:8080/mancenter-3.2-RC2</management-center>

Your hazelcast.xml should be in your application classpath - otherwise, the default hazelcast.xml will be used.

Also, make sure that mancenter version and hazelcast version match.