1

This is the error I get when I launch tomcat w/ my webapp. Im sure it has something to do w/ the hibernate plugin.

I had the web application running on version 12.04 LTS ubuntu and now have upgraded to 18.04 LTS. I have the grails web-app compiled as a .war and have not recompiled the war. I figured it would continue to work from one version of ubuntu to another.

15-Jun-2018 12:22:32.580 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
15-Jun-2018 12:22:33.287 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
15-Jun-2018 12:22:38.637 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener]
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    ... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    ... 5 more
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    ... 5 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    ... 5 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
    ... 8 more

15-Jun-2018 12:22:38.647 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
15-Jun-2018 12:22:38.955 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
15-Jun-2018 12:22:38.955 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
15-Jun-2018 12:22:38.956 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@306acdc')

Thanks for any help or tips!!

1 Answers1

2

The key line is this one Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

It appears that the Java runtime you are running this under on your new version of Ubuntu is different. Is it by chance Java 9? If so you probably have the problem described here How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

You could fix the problem as described in that answer, or install a previous version of Java and use that to run your Grails application

Peter
  • 29,498
  • 21
  • 89
  • 122
  • On the old Ubuntu version I have java version 8u161 and on the new Ubuntu I have 8u171. Do you think that version difference could cause the problem? I could also try to install java9 and then use the suggestions in the link you posted? – JuicyJuggles Jun 18 '18 at 19:40