Project

General

Profile

Problems with pre-bind session for tigase-server-7.1.0

wince jay
Added over 2 years ago

Hi guys,

I encounter the error when i try to pre-bind the session in jaxl php library.

Here is the server log error description(my tigase server's version is 7.1.0-snapshot):

java.lang.NullPointerException
    at tigase.server.ConnectionManager.getServiceId(ConnectionManager.java:1231)
    at tigase.server.ConnectionManager.getServiceId(ConnectionManager.java:1217)
    at tigase.server.ConnectionManager.getXMPPIOService(ConnectionManager.java:1259)
    at tigase.server.bosh.BoshConnectionManager.getSeeOtherHostForJID(BoshConnectionManager.java:531)
    at tigase.server.bosh.BoshSession.init(BoshSession.java:338)
    at tigase.server.bosh.BoshConnectionManager.preBindSession(BoshConnectionManager.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:233)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at tigase.admin.Script19.run(Script19.groovy:89)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:352)
    at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72)
    at tigase.server.script.Script.runCommand(Script.java:159)
    at tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1071)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1415)

Please give me some advises to understand the error report !Thanks in advance la~.


Replies (13)

Added by Wojciech Kapcia TigaseTeam over 2 years ago

How exactly are you trying to utilize pre-bind?

Please note, that Tigase doesn't support anonymous pre-bind for the moment.

Added by wince jay over 2 years ago

Not anonymous.There is attached a real jid to from attribute.

This is my steps:

Step 1 request

<iq type="set" to="bosh@im.example.com" id="3">
<command xmlns="http://jabber.org/protocol/commands" node="pre-bind-bosh-session">
<x xmlns="jabber:x:data" type="submit">
<field var="from"><value>jay011461751374@im.example.com</value></field>
<field var="hold"><value>1</value></field>
<field var="wait"><value>60</value></field>
</x>
</command>
</iq>

Step 2 response

Server occured error :

java.lang.NullPointerException
    at tigase.server.ConnectionManager.getServiceId(ConnectionManager.java:1231)
    at tigase.server.ConnectionManager.getServiceId(ConnectionManager.java:1217)
    at tigase.server.ConnectionManager.getXMPPIOService(ConnectionManager.java:1259)
    at tigase.server.bosh.BoshConnectionManager.getSeeOtherHostForJID(BoshConnectionManager.java:531)
    at tigase.server.bosh.BoshSession.init(BoshSession.java:338)
    at tigase.server.bosh.BoshConnectionManager.preBindSession(BoshConnectionManager.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:233)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at tigase.admin.Script19.run(Script19.groovy:89)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:352)
    at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72)
    at tigase.server.script.Script.runCommand(Script.java:159)
    at tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1071)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1415)
<iq xmlns="jabber:client" to="admin@im.example.com/jaxl#73879a391b21f0495b1f09df1a49c05e" id="3" from="bosh@im.example.com" type="result">
<command xmlns="http://jabber.org/protocol/commands" status="completed" node="pre-bind-bosh-session">
<x xmlns="jabber:x:data" type="result">
<field var="Script result" type="text-multi"><value>Script finished with no errors but returned no results.</value></field>
</x></command>
</iq>

There is no expected "from" jid to response!

Could you figure out what's wrong with the sent stanza or any conditions to provide ? For my local server version 7.0.2 is ok for me to add user via ad-hoc command.

Thanks in advance!

Added by Wojciech Kapcia TigaseTeam over 2 years ago

I've tried one of the latest versions of Tigase and it works just fine.

  • Which exact version do you use?

  • have you modified Tigase in any way?

Added by wince jay over 2 years ago

Thanks for your reply.

I check out source code from https://repository.tigase.org/git/tigase-server.git at "46ea242" commit(origin/release,7.1.0-snapshot) and

I found that there are some differences between the java code from svn repository at "46ea242" commit(origion/release,7.1.0-snapshot) and tigase-server-7.1.0-SNAPSHOT-b4139/jars/tigase-server.jar(Enclosed);

The diff between the source and build jar.

compare.png (25.5 KB) compare.png The diff between the source and build jar.

Added by wince jay over 2 years ago

And here is my all dependencies

dependencies for tigase-server-7.1.0-snapshot

lib.png (27.1 KB) lib.png dependencies for tigase-server-7.1.0-snapshot

Added by Wojciech Kapcia TigaseTeam over 2 years ago

wince jay wrote:

I check out source code from https://repository.tigase.org/git/tigase-server.git at "46ea242" commit(origin/release,7.1.0-snapshot) and

I found that there are some differences between the java code from svn repository at "46ea242" commit(origion/release,7.1.0-snapshot)

  • There is no svn repository (at least not officially);

  • While preparing your own packages please follow Building Server and Generating Packages guide in order to generate proper package;

  • while discussing problems in functionality always use packages prepared and distributed by Tigase team - please try to reproduce the issue in one of the latest nightlies

Added by wince jay over 2 years ago

Really thanks for your patience.

Must i wait for the version release by tigase team If i want to get the source code of tigase-server-7.1.0 ?

Added by Wojciech Kapcia TigaseTeam over 2 years ago

No, you don't - code is public in available in repository: https://projects.tigase.org/projects/tigase-server/repository?utf8=%E2%9C%93&branch=master&tag=&rev=release

Please note, that you have to clone git repository and then checkout release branch as master branch contains 7.2.0-SNAPSHOT code.

Added by wince jay over 2 years ago

Very Thanks for your instructions.

Added by wince jay over 2 years ago

Hi,wojciech.I'm still stuck by the error when trying to pre-bind the session while it is NOT for the tigase-server-7.1.0-SNAPSHOT-b4139 from http://build.tigase.org/nightlies/dists/.

Here is my details step:

Step 1: clone tigase server git repository(git clone https://repository.tigase.org/git/tigase-server.git) and check out release branch.

Step 2: Import into eclipse as maven project and convert into maven project.

Step 3: Debug configuration.New java application , for the "Arguments" ,I fill in "--property-file etc/init.properties" as Program arguments,"-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djdbc.drivers=com.mysql.jdbc -server -Xms200M -Xmx400M -XX:MaxDirectMemorySize=512m" as VM arguments.

Step 4:Copy the scripts whole folder into tigase maven project and overwrite the original scripts folder from b4139(nightly build).

Step 5:Start the tigase server under debug mode.

Here are my additional denpendencies for tigase server maven project in eclipse.

Added by Wojciech Kapcia TigaseTeam over 2 years ago

wince jay wrote:

Hi,wojciech.I'm still stuck by the error when trying to pre-bind the session while it is NOT for the tigase-server-7.1.0-SNAPSHOT-b4139 from http://build.tigase.org/nightlies/dists/.

So - it works while using our nightly build and it's not working while in eclipse?

Here is my details step:

The scripts are present in the repository - you can specify the path in @etc/init.properties@:

--script-dir=src/main/groovy/tigase/admin

Therefore you will be able to use what you've cloned directly.

Are you able to establish normal BOSH connection to Tigase started in eclipse?

Added by wince jay over 2 years ago

Very thankful to your prompt response!

The scripts are present in the repository - you can specify the path in etc/init.properties:

--script-dir=src/main/groovy/tigase/admin

I copy all scripts including http and admin into tigase-server maven eclipse project and i see the log file that the scripts are really normally loaded(see script debug.txt).

I also noted the error report when starting the tigase server in eclipse and i attached the log file.

2016-05-06 10:17:58.518 [main] SetupServlet$_loadTemplates_closure3.doCall() FINEST: resource index was not found and could not be loaded

java.io.IOException: Resource not found

at tigase.http.setup.SetupServlet.load(SetupServlet.groovy:160)

at tigase.http.setup.SetupServlet.access$0(SetupServlet.groovy)

at tigase.http.setup.SetupServlet$_loadTemplates_closure3.doCall(SetupServlet.groovy:141)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)

at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)

at groovy.lang.Closure.call(Closure.java:426)

at groovy.lang.Closure.call(Closure.java:442)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)

at tigase.http.setup.SetupServlet.loadTemplates(SetupServlet.groovy:139)

at tigase.http.setup.SetupServlet.init(SetupServlet.groovy:69)

at javax.servlet.GenericServlet.init(GenericServlet.java:244)

at tigase.http.java.RequestHandler.registerServlet(RequestHandler.java:108)

at tigase.http.java.RequestHandler.<init>(RequestHandler.java:72)

at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:157)

at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:107)

at tigase.http.HttpServer.deploy(HttpServer.java:99)

at tigase.http.setup.SetupModule.start(SetupModule.java:99)

at tigase.http.HttpMessageReceiver.reconfigure(HttpMessageReceiver.java:273)

at tigase.http.HttpMessageReceiver.setProperties(HttpMessageReceiver.java:229)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:516)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:1)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addComponent(MessageRouter.java:108)

at tigase.server.MessageRouter.addRouter(MessageRouter.java:145)

at tigase.server.MessageRouter.setProperties(MessageRouter.java:698)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:516)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:1)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131)

at tigase.server.MessageRouter.setConfig(MessageRouter.java:597)

at tigase.server.XMPPServer.start(XMPPServer.java:142)

at tigase.server.XMPPServer.main(XMPPServer.java:112)

Added by Wojciech Kapcia TigaseTeam over 2 years ago

wince jay wrote:

Very thankful to your prompt response!

The scripts are present in the repository - you can specify the path in etc/init.properties:

[...]

I copy all scripts including http and admin into tigase-server maven eclipse project and i see the log file that the scripts are really normally loaded(see script debug.txt).

I also noted the error report when starting the tigase server in eclipse and i attached the log file.

[...]

Unfortunately HTTP-API component doesn't support --script-dir configuration option.

    (1-13/13)