Debugging Tigase Server with PubSub and MUC modules using NetBeans IDE on Windows platform

9 posts / 0 new
Last post
Anonymous
Debugging Tigase Server with PubSub and MUC modules using NetBeans IDE on Windows platform

Steps Building and Running Tigase server with PubSub and MUC modules in Debug using Netbeans 6.9 (On Windows)

1. Download NetBeans NetBeans and Apache Maven Apache Maven if not available on the your system or you have older versions.

2. Checkout all the sources
a. https://svn.tigase.org/reps/tigase-xmltools/trunk/
b. https://svn.tigase.org/reps/tigase-utils/trunk/
c. https://svn.tigase.org/reps/tigase-server/trunk/
d. https://svn.tigase.org/reps/tigase-pubsub/trunk
e. https://svn.tigase.org/reps/tigase-muc/trunk

3. Open NetBeans IDE and add all checkout projects in the workspace.

4. Click Tools->Options->miscellaneous->Maven tab.

5. Browse for the location where Apache Maven is installed in External Maven Home and click OK to set otherwise Embedded Maven is used for building projects.

6. Set Tigase XMPP Server 5.1.0 as Main project. Following are the dependencies of the server

a. For adding TigaseUtils as dependency of server add the following XML in pom.xml

<dependency>
<groupId>tigase</groupId>
<artifactId>tigase-utils</artifactId>
<version>3.3.11-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

b. For adding Tigase-XMLTools as dependency of server add the following XML in pom.xml

<dependency>
<groupId>tigase</groupId>
<artifactId>tigase-xmltools</artifactId>
<version>3.3.6-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

c. For adding derby as dependency of server add the following XML in pom.xml

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.6.2.1</version>
</dependency>

d. For adding derby tools as dependency of server add the following XML in pom.xml

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.6.2.1</version>
</dependency>

e. For adding tigase-PubSub module as dependency of server add the following XML in pom.xml

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>tigase-pubsub</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>

f. For adding tigase-MUC module as dependency of server add the following XML in pom.xml

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>tigase-muc</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>

7. Clean and Build all projects and make sure to put the followings JARS in tigase-server/libs directory.

a. tigase-muc-2.0.0-SNAPSHOT.jar
b. tigase-pubsub-2.1.0-SNAPSHOT.jar
c. tigase-utils-3.3.11-SNAPSHOT.jar
d. tigase-xmltools-3.3.6-SNAPSHOT.jar

8. An important step is to create tigase-DB-repository by executing following commands from command prompt.

a. set CLASSPATH=tigase-server-dir-path\libs\derby.jar; tigase-server-dir-path\libs\derbytools.jar; tigase-server-dir-path\target\tigase-server-5.1.0-SNAPSHOT.jar;

Note: This command will set the CLASSPATH of derby, derby tools and tigase-server snapshot for creating the tigase derby DB

b. java -Dij.protocol=jdbc:derby: -Dij.database="derby-db-path\derbyRep\;create=true" -Dderby.system.home="tigase-server-dir-path\scripts" org.apache.derby.tools.ij " tigase-server-dir-path\database\derby-schema-4.sql"

c. java -Dij.protocol=jdbc:derby: -Dij.database= derby-db-path\derbyRep\ -Dderby.system.home="tigase-server-dir-path\scripts" org.apache.derby.tools.ij " tigase-server-dir-path\database\derby-schema-4-sp.schema"

d. java -Dij.protocol=jdbc:derby: -Dij.database= derby-db-path\derbyRep\ -Dderby.system.home=" tigase-server-dir-path\scripts" org.apache.derby.tools.ij " tigase-server-dir-path\database\derby-schema-4-props.sql”

9. Update the tigase-server-dir-path\etc\init.properties file as

--cluster-mode = false
config-type = --gen-config-def
--cluster-nodes = SERVERNAME (make sure to replace this with actual one)
--debug = server
--user-db = derby
--admins = admin@ SERVERNAME
--virt-hosts = SERVERNAME
--user-db-uri = jdbc:derby:derby-db-path\\derbyRep
--comp-class-2 = tigase.pubsub.PubSubClusterComponent
--comp-name-2 = pubsub
--comp-class-1 = tigase.muc.MUCComponent
--comp-name-1 = muc
--sm-plugins = +jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register,+roster-presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,-zlib

10. Tigase Server with PubSub and MUC module is now ready for debugging purpose by using netbeans IDE.

Application: 

Thanks Shawn Clark and Artur Hefczyc for helping me for running the Debug using Netbeans IDE. Added my experience on the forum so that it should save a lot of time for others.

Thank a lot for this it is very helpful, making it a front page article now.

Alessandro

where can i find pom.xml file in step 6.c and pom.xml file in step 6.d ?

Whole step 6 is about changing tigase-server pom.xml which can be found in the svn: https://svn.tigase.org/reps/tigase-server/trunk/pom.xml

Alessandro

Thank wojtek. Follow you, are all steps 6 (6a,6b,6c,6d,6d,6e,6f) about changing tigase-server pom.xml ?

Yes

Alessandro

Thanks everybody for your help and quick replies.

step 7: when I clean and build tigase-muc project, have 100 errors:
[ERROR]COMPILATION ERROR :
-------------------------------------------------------------
[ERROR]\tigase-muc\src\main\java\tigase\muc\RoomConfig.java:[36,18] cannot find symbol
symbol : class BareJID
location: package tigase.xmpp
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[36,18] cannot find symbol
symbol : class BareJID
location: package tigase.xmpp
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[37,18] cannot find symbol
symbol : class JID
location: package tigase.xmpp
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[54,23] cannot find symbol
symbol : class BareJID
location: class tigase.muc.Room
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[60,15] cannot find symbol
symbol : class BareJID
location: class tigase.muc.Room
[ERROR]\tigase-muc\src\main\java\tigase\muc\History.java:[30,18] cannot find symbol
symbol : class BareJID
location: package tigase.xmpp
[ERROR]\tigase-muc\src\main\java\tigase\muc\History.java:[31,18] cannot find symbol
symbol : class JID
location: package tigase.xmpp
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[67,23] cannot find symbol
symbol : class JID
location: class tigase.muc.Room
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[74,23] cannot find symbol
symbol : class JID
location: class tigase.muc.Room
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[79,41] cannot find symbol
symbol : class JID
location: class tigase.muc.Room
[ERROR]\tigase-muc\src\main\java\tigase\muc\Room.java:[84,23] cannot find symbol
symbol : class BareJID
location: class tigase.muc.Room
....

Tigase Server with PubSub module is now ready for debugging purpose by using netbeans IDE but I don't know where to begin debugging? Please help me.

You probably missed tigase-utils dependency which is required to compile most of our code.