Project

General

Profile

A NPE problem when I start the tigase-server 7.2.0_SNAPSHOT.

Wei Sun
Added over 1 year ago

The exactly version of tigase-server is 8c18087acfd2fc6e0df8e19102f5e0a95a3fd0aa, it is the latest version.

The config.tdsl.old file:

config-type = '--gen-config-def'
--virt-hosts= 'www.touchair.cn,touchat.touchair.cn'
admins = [ 'admin@www.touchair.cn', 'pubsub@www.touchair.cn','http@www.touchair.cn','http@localhost','http@info_72','muc@info_72']

dataSource {
    default() {
       uri = 'jdbc:mysql://127.0.0.1:3306/tigasedb?user=user&password=password&autoCreateUser=true&useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true'
}
}

httpServer {
    connections {
        8082 () {
            socket = plain
            domain = 'www.touchair.cn'
        }
    }
}

--api-keys=heilcoding


pubsub (class: tigase.pubsub.PubSubComponent, active:true) {
}

message-archive(class: tigase.archive.MessageArchiveComponent, active:true){
}

sess-man (class: tigase.server.xmppsession.SessionManager) {
    message-archive-xep-0136 (class: tigase.archive.processors.Xep0136MessageArchivingProcessor) {
        required-store-method = body
    }
}

When I start the tigase-server, I got those logs:

2017-09-25 19:11:51.369 [main]             ConfiguratorAbstract.parseArgs()        CONFIG:   Setting defaults: --property-file = etc/config.tdsl.old
2017-09-25 19:11:51.511 [main]             OldConfigHolder.logOutput()             CONFIG:   Configuration file etc\config.tdsl.old was updated to match current configuration format and renamed to etc\config.tdsl.
2017-09-25 19:11:51.514 [main]             OldConfigHolder.logOutput()             CONFIG:   Previous version of a configuration file was saved as etc\config.tdsl.old.13
2017-09-25 19:11:51.514 [main]             ConfigHolder.loadFromDSLFiles()         CONFIG:   Loading configuration from file: etc\config.tdsl
2017-09-25 19:11:51.537 [main]             ConfigHolder.loadConfiguration()        CONFIG:   Configuration file etc\config.tdsl was updated to match current format. Previous version of configuration file was saved as etc\config.tdsl.old
2017-09-25 19:11:51.538 [main]             ConfigHolder.loadConfiguration()        CONFIG:   Loaded configuration:
admins = [
    'admin@www.touchair.cn',
    'pubsub@www.touchair.cn',
    'http@www.touchair.cn',
    'http@localhost',
    'http@info_72',
    'muc@info_72'
]
'config-type' = '--gen-config-def'
'virtual-hosts' = [ 'www.touchair.cn', 'touchat.touchair.cn' ]
dataSource {
    default () {
        uri = 'jdbc:mysql://127.0.0.1:3306/tigasedb?user=user&password=password&autoCreateUser=true&useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true'
    }
}
http {
    'api-keys' = [ 'heilcoding' ]
}
httpServer {
    connections {
        8082 () {
            domain = 'www.touchair.cn'
            socket = 'plain'
        }
    }
}
'message-archive' (class: tigase.archive.MessageArchiveComponent) {}
pubsub (class: tigase.pubsub.PubSubComponent) {}
'sess-man' (class: tigase.server.xmppsession.SessionManager) {
    'message-archive-xep-0136' (class: tigase.archive.processors.Xep0136MessageArchivingProcessor) {
        'required-store-method' = 'body'
    }
}

2017-09-25 19:12:01.077 [main]             Kernel.getInstance()                    SEVERE:   Exception getting instance

tigase.kernel.KernelException: Can't create instance of bean 'message-router' (class: class tigase.server.MessageRouter)

    at tigase.kernel.core.Kernel.createNewInstance(Kernel.java:205)

    at tigase.kernel.core.Kernel.initBean(Kernel.java:114)

    at tigase.kernel.core.Kernel.getInstance(Kernel.java:388)
  =============================================================================
    at tigase.server.Bootstrap.start(Bootstrap.java:152)
  ERROR! Terminating the server process.
    at tigase.server.XMPPServer.start(XMPPServer.java:141)
  Problem initializing the server: tigase.kernel.KernelException: tigase.kernel.KernelException: Can't create instance of bean 'message-router' (class: class tigase.server.MessageRouter)
    at tigase.server.XMPPServer.main(XMPPServer.java:122)
  Please fix the problem and start the server again.
Caused by: java.lang.NullPointerException
  =============================================================================
    at java.util.regex.Matcher.getTextLength(Matcher.java:1283)

    at java.util.regex.Matcher.reset(Matcher.java:309)

    at java.util.regex.Matcher.<init>(Matcher.java:229)

    at java.util.regex.Pattern.matcher(Pattern.java:1093)

    at tigase.util.Version.of(Version.java:90)

    at tigase.util.DependencyChecker.checkDependencies(DependencyChecker.java:77)
    at tigase.server.BasicComponent.<init>(BasicComponent.java:137)
    at tigase.server.AbstractMessageReceiver.<init>(AbstractMessageReceiver.java:244)
    at tigase.server.MessageRouter.<init>(MessageRouter.java:74)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at tigase.kernel.core.Kernel.createNewInstance(Kernel.java:188)
    at tigase.kernel.core.Kernel.initBean(Kernel.java:114)
    at tigase.kernel.core.Kernel.getInstance(Kernel.java:388)
    at tigase.server.Bootstrap.start(Bootstrap.java:152)
    at tigase.server.XMPPServer.start(XMPPServer.java:141)
    at tigase.server.XMPPServer.main(XMPPServer.java:122)
ShutdownThread started...

Total number of threads: 10
No locked threads.

Disconnected from the target VM, address: '127.0.0.1:64485', transport: 'socket'
Save thread-dump to file: logs/thread-dump.log, size: 3449
ShutdownThread finished...
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=32m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

Process finished with exit code 1

Please tell me how to resolve the problem? thank you very much.


Replies (7)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

This error should not appear if you are using jars provided by us or if you compile Tigase XMPP Server using maven.

How you created your tigase-server.jar? I need this information to check the exact cause of this issue.

Added by Wei Sun over 1 year ago

I compiled Tigase XMPP Server using maven at the root directory(mycatalog\tigase-server\, refer to "maven compile Directory.png"), and then I created my tigase-server.jar:

mvn -Pdist -f documentation/pom.xml clean install
mvn -Pdist -f pom.xml clean install

while I start the tigase-server at the mycatalog\tigase-server\server directory (refer to the last "start tigase-server Directory.png" ).

thanks

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

I've created an issue #6141 and I think that I've fixed this issue. Correct me if I'm wrong, but you are starting Tigase XMPP Server from within IDE, right?

In this case, NPE was thrown as the manifest file is inaccessible due to IDE providing separate custom class loader which ignores manifest file and load classes from target/classes directory instead of using jar file.

Please check out the current version of source code and let me know if this issue is fixed for you.

Added by Wei Sun over 1 year ago

I start Tigase XMPP Server from within IDE, and Now I can start the tigase-server with the current version of source code.

thank you, Andrzej.

Added by Wei Sun over 1 year ago

Andrzej Wójcik wrote:

I've created an issue #6141 and I think that I've fixed this issue. Correct me if I'm wrong, but you are starting Tigase XMPP Server from within IDE, right?

In this case, NPE was thrown as the manifest file is inaccessible due to IDE providing separate custom class loader which ignores manifest file and load classes from target/classes directory instead of using jar file.

Please check out the current version of source code and let me know if this issue is fixed for you.

hi,Andrzej, I can start the tigase-server with the current version of source code in IDE. But there are some warnings:

warning1:

2017-09-28 11:26:20.865 [main]             RequestHandler.registerServlet()        WARNING:  null
java.lang.NullPointerException: Cannot get property 'length' on null object
    at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:57)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)
    at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:293)
    at tigase.http.modules.rest.RestExtServlet.loadHandlers(RestExtServlet.groovy:59)
    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.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:166)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:163)
    at tigase.http.modules.rest.RestServlet.init(RestServlet.groovy:66)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at tigase.http.java.RequestHandler.registerServlet(RequestHandler.java:173)
    at tigase.http.java.RequestHandler.<init>(RequestHandler.java:79)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:134)
    at tigase.http.java.JavaStandaloneHttpServer.lambda$0(JavaStandaloneHttpServer.java:74)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:74)
    at tigase.http.modules.rest.RestModule.start(RestModule.java:144)
    at tigase.http.AbstractHttpModule.initialize(AbstractHttpModule.java:78)
    at tigase.http.modules.AbstractBareModule.initialize(AbstractBareModule.java:191)
    at tigase.http.modules.rest.RestModule.initialize(RestModule.java:229)
    at tigase.kernel.core.Kernel.initBean(Kernel.java:157)
    at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:582)
    at tigase.kernel.core.Kernel.injectDependency(Kernel.java:770)
    at tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1375)
    at tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:1035)
    at tigase.kernel.core.Kernel.initBean(Kernel.java:148)
    at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:582)
    at tigase.kernel.core.Kernel.injectIfRequired(Kernel.java:733)
    at tigase.kernel.core.Kernel.getInstance(Kernel.java:393)
    at tigase.server.Bootstrap.start(Bootstrap.java:152)
    at tigase.server.XMPPServer.start(XMPPServer.java:141)
    at tigase.server.XMPPServer.main(XMPPServer.java:122)
2017-09-28 11:26:20.867 [main]             RequestHandler.registerServlet()        WARNING:  null
java.lang.NullPointerException: Cannot get property 'length' on null object
    at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:57)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)
    at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:293)
    at tigase.http.modules.rest.RestExtServlet.loadHandlers(RestExtServlet.groovy:59)
    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.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:166)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:163)
    at tigase.http.modules.rest.RestServlet.init(RestServlet.groovy:66)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at tigase.http.java.RequestHandler.registerServlet(RequestHandler.java:173)
    at tigase.http.java.RequestHandler.<init>(RequestHandler.java:79)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:134)
    at tigase.http.java.JavaStandaloneHttpServer.lambda$0(JavaStandaloneHttpServer.java:74)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:74)
    at tigase.http.modules.rest.RestModule.start(RestModule.java:144)
    at tigase.http.AbstractHttpModule.initialize(AbstractHttpModule.java:78)
    at tigase.http.modules.AbstractBareModule.initialize(AbstractBareModule.java:191)
    at tigase.http.modules.rest.RestModule.initialize(RestModule.java:229)
    at tigase.kernel.core.Kernel.initBean(Kernel.java:157)
    at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:582)
    at tigase.kernel.core.Kernel.injectDependency(Kernel.java:770)
    at tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1375)
    at tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:1035)
    at tigase.kernel.core.Kernel.initBean(Kernel.java:148)
    at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:582)
    at tigase.kernel.core.Kernel.injectIfRequired(Kernel.java:733)
    at tigase.kernel.core.Kernel.getInstance(Kernel.java:393)
    at tigase.server.Bootstrap.start(Bootstrap.java:152)
    at tigase.server.XMPPServer.start(XMPPServer.java:141)
    at tigase.server.XMPPServer.main(XMPPServer.java:122)

warning2:

2017-09-28 11:26:36.241 [main]             DSLBeanConfigurator.dumpConfiguration()  WARNING: Dumping full server configuration to: etc\config-dump.properties

Does it matter? thanks

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

As for those warnings. The second one is just an information that configuration which is used is dumped to a file and can be reviewed.

As for the first warning, it was caused by NPE which was caused by missing HTTP API component scripts directory. This directory is created when distribution package is created and is not available if you start Tigase XMPP Server from IDE. I've fixed NPE and added a warning with correct message.

Please keep in mind that starting Tigase XMPP Server from IDE is possible but not recommended.

Added by Wei Sun over 1 year ago

OK,thank you for your response.

    (1-7/7)