Project

General

Profile

How to launch up tigase instance using netbeans? And debug the codes step by step?

boruida wh
Added over 4 years ago

Now I've using tigase for about 4months,

I think the server is very high efficient,

and I would like to study the codes and do more tests in the codes.

But I donot know how to launch up the tigase instance using NetBeans(or other dev tools as well)

I hope that the instance can be debuged and I could study the codes with Spark

with more tests and experiments. Because I have some special usage and

may want to change some codes and test the function.

Could you help me with the debug start?

Thanks very much!


Replies (7)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Yes, it's possible, and quite easy I may add:

  • open project in NetBeans;

  • go to Properties and then open Actions section

  • find "Run project" action and in the set properties add (please adjust paths as needed):

exec.args=-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -classpath %classpath tigase.server.XMPPServer --property-file etc/init.properties

In principle you need to arguments that are usually passed to Tigase when running normaly (from tigase.conf), including path to properties file (i.e. @etc/init.properties@).

For debugging purposes you need to modify in similar manner Debug project action.

Added by boruida wh over 4 years ago

hi

just did as you said, and when click "RUN" button in NetBeans, it shows the lines in console window.

No tigase server instance launched. Could you show me the detail steps, thanks very very much!!!

cd E:\1boruida\3code\tigase-server; "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45" cmd /c "\"\"C:\Program Files\NetBeans 7.4\java\maven\bin\mvn.bat\" -Dexec.args=\"-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -classpath %classpath tigase.server.XMPPServer --property-file etc/init.properties\" -Dmaven.ext.class.path=\"C:\Program Files\NetBeans 7.4\java\maven-nblib\netbeans-eventspy.jar\"\"\""

Scanning for projects...


Building Tigase XMPP Server 5.3.0-SNAPSHOT


--- buildnumber-maven-plugin:1.2:create (default) @ tigase-server ---

Checking for local modifications: skipped.

Updating project files from SCM: skipped.

ShortRevision tag detected. The value is '8'.

Executing: cmd.exe /X /C "git rev-parse --verify --short=8 HEAD"

Working directory: E:\1boruida\3code\tigase-server

Storing buildNumber: null at timestamp: 2014-8-14 1:12:11

ShortRevision tag detected. The value is '8'.

Executing: cmd.exe /X /C "git rev-parse --verify --short=8 HEAD"

Working directory: E:\1boruida\3code\tigase-server

Storing buildScmBranch: UNKNOWN_BRANCH

--- gmaven-plugin:1.5:execute (gitver) @ tigase-server ---

setting revision to: 0

--- maven-resources-plugin:2.6:resources (default-resources) @ tigase-server ---

Using 'UTF-8' encoding to copy filtered resources.

Copying 6 resources

--- maven-compiler-plugin:2.5.1:compile (default-compile) @ tigase-server ---

Compiling 3 source files to E:\1boruida\3code\tigase-server\target\classes


BUILD SUCCESS


Total time: 3.424s

Finished at: Thu Aug 14 01:12:13 CST 2014

Final Memory: 20M/221M


Added by Wojciech Kapcia TigaseTeam over 4 years ago

boruida wh wrote:

hi

just did as you said, and when click "RUN" button in NetBeans, it shows the lines in console window.

No tigase server instance launched. Could you show me the detail steps, thanks very very much!!!

In the same dialog:

  • in the Execute goals you need to specify @process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec@;

  • in the Set properties you need to also include:

exec.executable=java
exec.workingdir=<path/to/tigase-server>

(in your case it will be E:\1boruida\3code\tigase-server

Added by boruida wh over 4 years ago

Could not find goal 'exec;' in plugin org.codehaus.mojo:exec-maven-plugin:1.2.1 among available goals exec, java, help -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.

Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:

[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException

look forward for your reply, thanks!

Added by Wojciech Kapcia TigaseTeam over 4 years ago

please try without semicolon:

process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

Added by boruida wh over 4 years ago

thanks, it works. but some exception occures, i'll track them.

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Most likely missing dependencies - you would have to add at least database drivers and/or components that you would use (muc, pubsub, etc).

    (1-7/7)