1 Reply Latest reply on Sep 30, 2010 6:01 AM by Bartłomiej Góra

    Clustering JBoss 4.2.2 GA + Tomcat 6.0.20 + Struts 1.2.9

    Bartłomiej Góra Newbie

      Hi All.

      I want to welcome you in my first post in this forum.

      I have this problem:

       

      I've made an application in EJB 3.0 on Jboss + Struts Framework/spring on Tomcat.

      Then I wanted to cluster jboss on two machines.

      My laptop which has linux ubuntu on it, will hold jboss + tomcat.

      My stationary Computer with Windows XP will hold second jboss.

       

      I have some results:

      The two jbosses log that there are others in cluster, but i get log message that there is no transaction manager lookup class defined.

      I don;t know what to do.

       

      Next thing is that my app is connectiing using spring:

       

           <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
              <prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>
              <prop key="java.naming.provider.url">jnp://192.168.0.101:1100;jnp://192.168.0.1100</prop>
          </util:properties>

       

      When i was connection to localhost:1099 it was fine, but when I configure my app like the file above, i get connection refused.

      Anyway, could someone provide me step by step what should I do to propably configure the cluster in this configuration: 1 tomcat and two jbosses.

       

      My clases looks like this:


      @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
      @Entity
      @Table(name = "Users")
      @SequenceGenerator(name = "UserSequence", initialValue = 0, allocationSize = 1, sequenceName = "UserSequence")
      @NamedQueries(value = {
              @NamedQuery(name = "loginQuery", query = "From User u LEFT JOIN FETCH u.role WHERE u.login = :login AND u.passwd = :passwd"),
              @NamedQuery(name = "getAdminUserCount", query = "Select Count(u) From User u where login = \'admin\' "),
              @NamedQuery(name = "getLoginCount", query = "Select Count(u) From User u Where u.login = :login AND u.passwd = :passwd"),
              @NamedQuery(name = "getUsersWithPersonCountFiltered", query = "SELECT Count (u) FROM User u, Person p WHERE u.login like :login AND p.name like :name AND p.surname like :surname "),
              @NamedQuery(name = "getUsersWithPersonFiltered", query = "Select DISTINCT u From User u, Person p, Role r WHERE u.login like :login AND p.name like :name AND p.surname like :surname "),
              @NamedQuery(name = "getUserForPersonCount", query = "SELECT COUNT (u) FROM User u WHERE u.person = :person"),
              @NamedQuery(name = "getUserForPerson", query = "SELECT u FROM User u WHERE u.person = :person"),
              @NamedQuery(name = "getUserByIdCount", query = "SELECT Count(u) FROM User u WHERE u.userId = :id"),
              @NamedQuery(name = "getUserById", query = "SELECT DISTINCT u FROM User u Left Join Fetch u.groups WHERE u.userId = :id"),
              @NamedQuery(name = "getUserByLoginCount", query = "SELECT Count (u) FROM User u WHERE u.login = :login"),
              @NamedQuery(name = "getUserByLogin", query = "FROM User WHERE login = :login") })
      @NamedNativeQueries(value = { @NamedNativeQuery(name = "getUsersWithLessJobs", query = "SELECT role_id, user_id, Min(result) as min_jobs FROM (SELECT role_id, user_id, Count(processpathelement.*) as result FROM users left join processpathelement on responsible_user = user_id GROUP BY user_id, role_id)as result_table, role, users_bmsgroups WHERE role_id = roleid AND role_name <> 'CLIENT' AND user_id = groups AND users = :groupID GROUP BY user_id, role_id ORDER BY Min(result)", resultSetMapping = "getUsersWithLessJobsResult") })
      @SqlResultSetMapping(name = "getUsersWithLessJobsResult", columns = {
              @ColumnResult(name = "role_id"), @ColumnResult(name = "user_id"),
              @ColumnResult(name = "min_jobs") })
      public class User implements Serializable {

       

          private static final long serialVersionUID = -1776171399753154200L;

       

          private Long userId;

       

          private Role role;

       

          private String login;

       

          private String passwd;

       

          private String status;

      //.....

       

      And session beans:

       

      @Stateless(name = "UserBean")
      @Clustered
      public class UserBean implements UserBeanRemote, UserBeanLocal {

       

      And statefull

      @Stateful
      @Clustered
      public class UserEditorBean implements UserEditorBeanRemote,
              UserEditorBeanLocal

       

      Please help me.

      I've red the Jboss-4.2 clustering guide, but I don't understand some things.

      Maybe someone have a tutorial or something?

      I think that i could do some damage aerlier, so i want to know how make such cluster step by step.

      Maybe i should install new jboss and strat over again?