Project

General

Profile

No response back on http rest api

share yuan
Added 10 months ago

Problem Description:

1.Call the rest interface

1.png

2.Http protocol post access

2.png

  然后请求不到tigase的rest接口。

Environmental configuration

1.Tigase version:7.1.0

1.Tigase configuration:init.properies

config-type=--gen-config-def
--admin=admin@app.im
--virt-hosts = 192.168.0.37,app.im,test-d

--user-db=mysql
--user-db-uri=jdbc:mysql://192.168.0.63:3306/tigase?user=tigase&password=tigase_123&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

sess-man/plugins-conf/urn\:ietf\:params\:xml\:ns\:\xmpp-bind/apns-token-db-uri=jdbc:mysql://192.168.0.63:3306/tigase?user=tigase&password=tigase_123&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
sess-man/plugins-conf/enabled-mechanisms=SCRAM-SHA-1,PLAIN
sess-man/plugins-conf/client-key=QERHTELKCS
sess-man/plugins-conf/server-key=POANFJGWYQ

basic-conf/logging/tigase.http.level=FINEST
basic-conf/logging/tigase.db.jdbc.level=FINER
basic-conf/logging/tigase.xmpp.impl.level=FINE
basic-conf/logging/tigase.muc.level=FINE
basic-conf/logging/tigase.apns.level=FINE

#sess-man/plugins-conf/amp/user-store-limit-enable[B]=false
#sess-man/plugins-conf//user-store-limit-enable[B]=false
amp/store-limit[L]=10000

--sm-plugins=+urn:xmpp:receipts,+message-push,+message-archive-xep-0136

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
http/rest/api-keys[s]=open_access
http/http/ports[i]=19080,19081
http/http/19081/domain=app.im
http/http/19081/socket=ssl

#--comp-name-2 = muc
#--comp-class-2 = tigase.muc.MUCComponent


--comp-name-2 = muc
--comp-class-2 = tigase.group.GroupComponent

--comp-name-3=message-archive
--comp-class-3=tigase.archive.MessageArchiveComponent

--comp-name-4=rest
--comp-class-4=tigase.http.rest.RestMessageReceiver
rest/use-local-server[B]=true
message-archive/auto=true
sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message

Replies (7)

Added by colin cao 10 months ago

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
http/setup/admin-credentials=admin:tigase
http/http/port[I]=8080
http/dns-webservice/active[B]=true
http/api-keys[s]=open_access
http/server-class[S]=tigase.http.java.JavaStandaloneHttpServer

Added by share yuan 10 months ago

Each login will report the following error

java.lang.IllegalArgumentException: Null input buffer
    at javax.crypto.Cipher.doFinal(Cipher.java:2160)
    at tigase.http.util.AES.decrypt(AES.java:69)
    at tigase.http.java.DummyServletRequest.getUserPrincipal(DummyServletRequest.java:416)
    at tigase.http.java.DummyServletRequest.isUserInRole(DummyServletRequest.java:399)
    at javax.servlet.http.HttpServletRequest$isUserInRole$4.call(Unknown Source)
    at tigase.http.rest.RestServlet$_processRequest_closure3.doCall(RestServlet.groovy:149)
    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:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:439)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
    at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at tigase.http.rest.RestServlet.processRequest(RestServlet.groovy:129)
    at tigase.http.rest.RestExtServlet.processRequest(RestExtServlet.groovy:189)
    at tigase.http.rest.RestExtServlet$processRequest$0.callCurrent(Unknown Source)
    at tigase.http.rest.RestServlet.service(RestServlet.groovy:96)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at tigase.http.java.RequestHandler.handle(RequestHandler.java:124)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
    at tigase.http.java.JavaStandaloneHttpServer$ExecutorWithTimeout.lambda$0(JavaStandaloneHttpServer.java:187)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Added by share yuan 10 months ago

The initial start of the project reported this mistake

com.notnoop.exceptions.InvalidSSLConfig: java.io.IOException: Short read of DER length
    at com.notnoop.apns.internal.Utilities.newSSLContext(Utilities.java:89)
    at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:174)
    at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:141)
    at tigase.apns.APNSManager.<clinit>(APNSManager.java:64)
    at tigase.xmpp.impl.BindResource.init(BindResource.java:118)
    at tigase.server.xmppsession.SessionManager.setProperties(SessionManager.java:922)
    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)
Caused by: java.io.IOException: Short read of DER length
    at sun.security.util.DerInputStream.getLength(DerInputStream.java:582)
    at sun.security.util.DerValue.init(DerValue.java:391)
    at sun.security.util.DerValue.<init>(DerValue.java:332)
    at sun.security.util.DerValue.<init>(DerValue.java:345)
    at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1938)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at com.notnoop.apns.internal.Utilities.newSSLContext(Utilities.java:86)
    ... 22 more

Added by Wojciech Kapcia TigaseTeam 10 months ago

Please use English to describe your problem.

Added by share yuan 10 months ago

Wojciech Kapcia wrote:

Please use English to describe your problem.

OK, I'm really embarrassed. I have already translated into English. What you have done in the open source business is really great. I really like it for you! Come on!

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 10 months ago

You have the issues with the modified version of Tigase XMPP Server and all errors are reported in the code which is not part of the Tigase XMPP Server!
We do not provide class at tigase.http.util.AES.decrypt(AES.java:69) which is visible on the first stack trace which you provided and we do not provide at tigase.apns.APNSManager.<clinit>(APNSManager.java:64) visible on the second stack trace.

Please keep in mind that you are using an OpenSource software licensed with AGPLv3 license, so you may need to opensource your modified version of Tigase XMPP Server.

If you wish to not be forced to opensource it or get help with your modified version of Tigase XMPP Server which you are using please send an email at support@tigase.net.

Added by share yuan 10 months ago

Andrzej Wójcik wrote:

You have the issues with the modified version of Tigase XMPP Server and all errors are reported in the code which is not part of the Tigase XMPP Server!
We do not provide class at tigase.http.util.AES.decrypt(AES.java:69) which is visible on the first stack trace which you provided and we do not provide at tigase.apns.APNSManager.<clinit>(APNSManager.java:64) visible on the second stack trace.

Please keep in mind that you are using an OpenSource software licensed with AGPLv3 license, so you may need to opensource your modified version of Tigase XMPP Server.

If you wish to not be forced to opensource it or get help with your modified version of Tigase XMPP Server which you are using please send an email at support@tigase.net.

Thank you very much, very good product, work hard team!

    (1-7/7)