0

I 'm getting this exception when I am trying to deploy the .war file in Tomcat

java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
        at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:142)
        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)

Please be aware that:

-The same .war file is already working on a different Server(Linux OpenSuse)

-I copied the Tomcat folder(all the server's) from the old server(OpenSuse) to the new server(Ubuntu 16.04). This way the files are the same.

-The JVM is the same in both of the servers.

-The exception does not happen during Development time(in Eclipse).

My questions are:

-Some people have suggested me to change my maven pom files. Does it make sense? Because as I said the .war is already working on the OpenSuse server.

-Should I be able to deploy the same.war without any change. Shouldn't I?

Rodrigo
  • 37
  • 5
  • Did you verify that the missing part is actually present in you war? A possible cause could be that it is configured to be available at runtime and your Tomcat installation does not provide it. – DennisV Apr 04 '18 at 13:47
  • It is present! As I said above I've copied all the Tomcat directory from the OpenSuse server to the new Ubuntu server. Both the Tomcat directories are the same on the different Linux servers. – Rodrigo Apr 04 '18 at 13:50
  • Are you sure there are no other libraries on the new tomcat server? It seems as if the class is on the classpath with a different (or multiple) versions. – DennisV Apr 04 '18 at 13:59
  • Yes, I am sure because I copied and pasted the tomcat directory from the old Linux server to the new one. If I had other libraries on the new Linux server it would not be working on the old one as well. – Rodrigo Apr 04 '18 at 14:04
  • It looks like you're using the wrong version of JBoss Logging with Hibernate. What versions of Hibernate and JBoss Logging are on your class path? – James R. Perkins Apr 05 '18 at 23:14

1 Answers1

0

There is at-least one of the libraries missing in the server you are getting the error.

Check all libraries in the $PATH variables you are using in the server its working.

Hope this Helps!

Regards, Eby

Eby Jacob
  • 1,418
  • 1
  • 10
  • 28
  • This is what I have on the box which is working: ip-10-2-1-9:~ # echo $PATH /sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin This is what I have on the new box root@ip-10-2-1-20:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games Are you talking about this? Are we on the same page? – Rodrigo Apr 06 '18 at 10:56