Project

General

Profile

Upgrade tigase version

Keren Meir
Added over 5 years ago

Hi,

According to: (https://projects.tigase.org/boards/4/topics/148)

"The main thing is that you do not edit and modify the Tigase own files. Otherwise upgrading to a new version will always be a pain as you will have to edit over and over again Tigase's files"

In my own Tigase, I have to make changes in Tigase own files, something that can't be done in new components/plugins.

I want to upgrade my current version (the original one) with my changes. I export runnable JAR file ("tigase-server.jar"), exchange it with the current tigase-server.jar and add the relevant missing jar file to /lib folder. (The new version includes the "HTTP ADMIN API").

Now I'm running the server and I got exception (see below).

Do I need to do something else to upgrade the tigase?

ThreadExceptionHandler.uncaughtException() SEVERE: Uncaught thread: "main" exception

java.lang.IncompatibleClassChangeError: Implementing class

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

at java.lang.Class.getDeclaredMethods(Unknown Source)

at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java)

at java.security.AccessController.doPrivileged(Native Method)

at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java)

at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java)

at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java)

at org.codehaus.groovy.util.LazyReference.get(LazyReference.java)

at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java)

at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java)

at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java)

at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java)

at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java)

at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java)

at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java)

at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java)

at tigase.http.rest.RestMessageReceiver.start(RestMessageReceiver.groovy:72)

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

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

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

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

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

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

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

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


Replies (8)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

If you modify Tigase's files you should not make modifications to a JAR file. Instead, recompile everything from sources and generate a new JAR file. This way you can avoid any version incompatibility like this.

Added by Keren Meir over 5 years ago

That's what I did. I export new runnable jar file and exchange it wit the old "tigase-server.jar" file.

Is that what you mean? or something else?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Hm, maybe it is another library then. It is hard to tell form the exception. Make sure all libraries are compiled for the same Java version. It's Java7 now but we compiled for Java6 very recently. I am surprised this this exception comes from the Groovy actually. Make also sure you do not have 2 jars for the same library lying around.

Added by Keren Meir over 5 years ago

Ok, I tried to upgrade to machines with Tigase server.

In one machine I had 2 groovy.jar files (different versions). I deleted the old one and it works.

In the second machine there is another problem. The Tigase version is 5.1.5, while i'm using (in eclipse) newer version.

Therefore I got this exception:

ThreadExceptionHandler.uncaughtException() SEVERE: Uncaught thread: "main" exception

java.lang.UnsupportedClassVersionError: org/eclipse/jetty/security/LoginService : Unsupported major.minor version 51.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:634)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)

at java.net.URLClassLoader.access$000(URLClassLoader.java:73)

at java.net.URLClassLoader$1.run(URLClassLoader.java:212)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:205)

at java.lang.ClassLoader.loadClass(ClassLoader.java:321)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)

at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65)

at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:62)

at java.security.AccessController.doPrivileged(Native Method)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:62)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

at tigase.http.rest.RestMessageReceiver.start(RestMessageReceiver.groovy:72)

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

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

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

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

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

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

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

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

Is there any way to solve this problem?

Thanks a lot!

Added by Wojciech Kapcia TigaseTeam over 5 years ago

It's because of using earlier version of java to run binaries compiled with newer version without explicit configuration for target version of java to lower version. As suggested earlier - please try using java7.

Added by Keren Meir over 5 years ago

The java version in the machine is:

java version "1.6.0_18"

OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze2)

OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

I'm buliding the project with java6 as well.

I got errors like: Unsupported major.minor version 51.0 for all jetty jar files (they are all version 9.0.4)

But I don't understand why. The server works fine to me (in eclipse) with those jar files, and I build the whole server and exchange the tigase-server.jar file with the old one. So what are the files that don't success loading these jar file?

Added by Keren Meir over 5 years ago

Another thing:

which package my project need to be under while I compile it?

Now I have project named "Tigase" and have many packages in it: tigase.auth, tigase.cluster, tigase.server etc...

Is that ok?

I have many Prohibited package name: java.lang errors....

EDIT: It all works now! I had a bad jar that makes these problems....

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Thank you for update, glad it works for you.

    (1-8/8)