Debugging Wildfire and plug-ins

Hi,

So I finally got Wildfire compiling successfully in Eclipse. How do I get my compiled server to be installed and running in debug?

My goal is to be able to write and debug a plug-in but I’'m stuck at the initial step of launching and debugging the server.

Newbie alert - please note that I come from the MS .NET world, and haven’'t touched Java or related dev environments for many years, so sorry for any silly questions that may come out of my keyboard.

Thanks.

http://wiki.jivesoftware.org/display/WILDFIRE/BuildWildfirewith+Eclipse#BuildWildfirewithEclipse-DebugWildfire should help.

LG

Sorry, I forgot to mention that I followed your instructions before (very helpful and it got me where I am now). However nothing happens when I start debugging. I checked that no other instance of the server is running. Is there any log file cretaed in the background or trace info that I can check?

Thanks.

Hi,

Eclipse should display errors if it fails to start on standard out, especially if you are using the debug mode.

I did update the wiki document and hope that this matches now 3.1:

http://wiki.jivesoftware.org/display/WILDFIRE/BuildWildfirewith+Eclipse#BuildWildfirewithEclipse-DebugWildfire3.1(Halloweenupdate)

LG

Hi, LG

I was trying to configure Wildfire 3.1.1 debug in Eclipse 3.2 but, even with your update, Wildfire still couldn’'t find the “wildfire.xml”. I solved the problem by:

  1. setting the woking dir to “$”

  2. changing the parameter of the call to “verifyHome” in XMPPServer.locateWildfire line 688 col 43 from “…” to “.”

Are these changes right? Do they have any side effect?

Unfortunately, now I’‘m getting this error that I couldn’'t solve yet:

java.lang.NullPointerException

at org.jivesoftware.admin.AdminConsole.getAppName(AdminConsole.java:119)

at org.jivesoftware.wildfire.handler.IQVersionHandler.(XMPPServer.java:147)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at org.jivesoftware.wildfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.wildfire.starter.ServerStarter.main(ServerStarter.java:49)

It is trying to call the method selectSingleNode from the generatedModel null reference.

Thanks in advance.

Rodrigo

Update:

Yes, my modifications has a side-effect: when I run wildifire by the “run” ant target, it can’'t find the wildfire.xml…

i have the same problem while running and debuging in the Eclipse.

Failed to load admin-sidebar.xml file from Wildfire classes - admin console will not work correctly.

java.lang.NullPointerException

at org.jivesoftware.admin.AdminConsole.getAppName(AdminConsole.java:119)

at org.jivesoftware.wildfire.handler.IQVersionHandler.<init>(IQVersionHandle r.java:43)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at org.jivesoftware.wildfire.XMPPServer.loadModule(XMPPServer.java:469)

at org.jivesoftware.wildfire.XMPPServer.loadModules(XMPPServer.java:440)

at org.jivesoftware.wildfire.XMPPServer.start(XMPPServer.java:372)

at org.jivesoftware.wildfire.XMPPServer.<init>(XMPPServer.java:147)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at org.jivesoftware.wildfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.wildfire.starter.ServerStarter.main(ServerStarter.java:49)

???

java.lang.NullPointerException

at org.jivesoftware.admin.AdminConsole.getAppName(AdminConsole.java:119)

at org.jivesoftware.wildfire.handler.IQVersionHandler.<init>(IQVersionHandle r.java:43)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at org.jivesoftware.wildfire.XMPPServer.loadModule(XMPPServer.java:469)

at org.jivesoftware.wildfire.XMPPServer.loadModules(XMPPServer.java:440)

at org.jivesoftware.wildfire.XMPPServer.start(XMPPServer.java:372)

at org.jivesoftware.wildfire.XMPPServer.<init>(XMPPServer.java:147)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at java.lang.Class.newInstance0(Class.java:350)

at java.lang.Class.newInstance(Class.java:303)

at org.jivesoftware.wildfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.wildfire.starter.ServerStarter.main(ServerStarter.java:49)

as it fails to load plugin.

Error loading plugin

java.lang.NullPointerException

at org.jivesoftware.admin.AdminConsole.rebuildModel(AdminConsole.java:287)

at org.jivesoftware.admin.AdminConsole.addModel(AdminConsole.java:100)

at org.jivesoftware.wildfire.container.PluginManager.loadPlugin(PluginManager.java :459)

at org.jivesoftware.wildfire.container.PluginManager.access$1(PluginManager.java:2 07)

at org.jivesoftware.wildfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:907)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (ScheduledThreadPoolExecutor.java:65)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(ScheduledThreadPoolExecutor.java:142)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:166)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 650)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

at java.lang.Thread.run(Thread.java:595)


Link:[???|http://www.chenhl.com|??? ??? ???]

Link:[intelchen???|http://www.chenbh.com|intelchen xmpp jabber]

Message was edited by: intelchen

Hi,

don’'t change the code, you need to modify the VM Arguments: and set

-DwildfireHome="."

to “.” or to the path which matches your Wildfire home.

LG

Ooops! Sorry, I was modifying the program args… My mistake. But I still had to modify the working dir to “$”, what coincides with the following line of the buildfile “”.

Nevertheless, the “NullPointerException” I reported before (after changing the code) is still being thrown during Wildfire initialization.

Regards.

Rodrigo

bad luck 2. it’'s my mistake did not change the VM Arguments “.” .

but the NullPointerException is still on.


Link: ???

Link: intelchen

Message was edited by: intelchen

Message was edited by: intelchen

Hi,

I did try it again with 3.1.0 today and there it works fine but with 3.1.1 this exception is thrown. But it is thrown after the log entry in error.log:

2006.11.11 14:04:51 [org.jivesoftware.admin.AdminConsole.load(AdminConsole.java:233)

] Failed to load admin-sidebar.xml file from Wildfire classes - admin console will not work correctly.

So one must look for the xml file and why it fails to load.

LG

http://wiki.jivesoftware.org/display/WILDFIRE/BuildWildfirewith+Eclipse updated for 3.1.1

LG

I had the same problems as the others, but most of them are sorted out now. Something’‘s wrong with i18n though. In the wiki you say you should add a folder to the classpath, wildfire_src\resources\i18n. But in trunk I can’'t find such a folder. What should I add instead?

When I run the debug configuration I get:

java.util.MissingResourceException: Can’'t find bundle for base name wildfire_i18n, locale en

at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)

at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)

at java.util.ResourceBundle.getBundle(ResourceBundle.java:576)

at org.jivesoftware.util.LocaleUtils.getLocalizedString(LocaleUtils.java:387)

What should I do?

(I’'m using Eclipse 3.2 if that should matter somehow.)

Tim

Hi,

you should get a “wildfire_src\resources\i18n” folder as soon as you unzip wildfire_src.zip.

LG

Yeah, resources/i18n seem to be there in 3.1.1 sources, but not in trunk. Was it removed?

I can’‘t find it in subversion for 3.1.1 either though, http://www.jivesoftware.org/fisheye/browse/svn-org/wildfire/tags/wildfire_3_1_1/ src/resources. There’'s no i18n there.

Tim

I have sovled the NullPointException problem.

Classpath

Advanced … Add Folders OK

wildfire_src\resources\i18n OK

and also Add Folders wildfire_src\src\resources\ OK

then the admin-sidebar.xml file will be found during the running and debuging.

hi Tim:

i18n resources is not under the ''src/resources ‘’ dir .

but u can find it under just ‘‘resources’’ dir.

intelchen

Message was edited by: intelchen

intelchen, the exception isn’'t being thrown anymore here too! But I had to add “src/resources/jar” and not just “src/resources”.

Thank you!

So I did also add wildfire_src\src\resources\jar to the wiki document which seems to be needed as soon as one does login which I didn’'t.

Hi intelchen,

It worked after adding src/i18n folder to the classpath. Maybe that’‘s what you meant to say, but didn’'t say

Tim