Issues with OneBusAway v2.0.0

194 views
Skip to first unread message

Valerian Eftime

unread,
Feb 26, 2021, 3:31:05 PM2/26/21
to onebusaway-developers
Hello community,
I'm trying to upgrade our OBA servers from v.1.1.19 to v 2.0.0.

I have successfully deployed ( I think :)  ) the onebusaway-transit-data-federation-webapp but I cannot start the onebusaway-api-webapp . I would appreciate any guidance you can provide as I'm running out of ideas;  thank you for reviewing the mess below:

Tomcat API log :


2021-02-26 14:36:19,286 INFO  [ContextLoader.java:304] : Root WebApplicationContext: initialization started
2021-02-26 14:36:19,343 INFO  [AbstractApplicationContext.java:583] : Refreshing Root WebApplicationContext: startup date [Fri Feb 26 14:36:19 EST 2021]; root of context hierarchy
2021-02-26 14:36:19,406 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [data-sources.xml]
2021-02-26 14:36:19,445 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/api/application-context-webapp.xml]
2021-02-26 14:36:19,473 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/agency_metadata/application-context.xml]
2021-02-26 14:36:19,585 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/users/application-context.xml]
2021-02-26 14:36:19,595 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/container/application-context.xml]
2021-02-26 14:36:19,601 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/container/application-context-hibernate.xml]
2021-02-26 14:36:19,609 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/container/application-context-caching.xml]
2021-02-26 14:36:19,614 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/container/application-context-common.xml]
2021-02-26 14:36:19,703 INFO  [DefaultListableBeanFactory.java:828] : Overriding bean definition for bean 'userLastAccessTimeServiceImpl' with a different definition: replacing [Generic bean: class [org.onebusaway.users.impl.internal.UserLastAccessTimeServiceImpl]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/var/lib/tomcat8/webapps/onebusaway-api-webapp/WEB-INF/lib/onebusaway-users-2.0.0.jar!/org/onebusaway/users/impl/internal/UserLastAccessTimeServiceImpl.class]] with [Generic bean: class [org.onebusaway.users.impl.internal.UserLastAccessTimeServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [org/onebusaway/users/application-context.xml]]
2021-02-26 14:36:19,704 INFO  [XmlBeanDefinitionReader.java:317] : Loading XML bean definitions from class path resource [org/onebusaway/util/application-context.xml]
2021-02-26 14:36:19,748 INFO  [DefaultListableBeanFactory.java:828] : Overriding bean definition for bean 'apiKeyValidationService' with a different definition: replacing [Generic bean: class [org.onebusaway.users.impl.validation.KeyValidationServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [data-sources.xml]] with [Generic bean: class [org.onebusaway.users.impl.validation.KeyValidationServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [org/onebusaway/api/application-context-webapp.xml]]
2021-02-26 14:36:20,018 INFO  [AutowiredAnnotationBeanPostProcessor.java:155] : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2021-02-26 14:36:20,528 INFO  [DriverManagerDataSource.java:133] : Loaded JDBC driver: com.mysql.jdbc.Driver
2021-02-26 14:36:20,554 INFO  [DriverManagerDataSource.java:133] : Loaded JDBC driver: com.mysql.jdbc.Driver
2021-02-26 14:36:20,568 WARN  [AbstractApplicationContext.java:551] : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agencyMetadataSessionFactory': Failed to introspect bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition;
2021-02-26 14:36:20,573 ERROR [ContextLoader.java:350] : Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agencyMetadataSessionFactory': Failed to introspect bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition;
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:269)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1126)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4770)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5236)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1377)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:694)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:218)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)


 My data-sources.xml file  details:



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
  <!-- Specify our transit data source -->
  <bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
    <property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
    <property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
  </bean>
  <bean id="apiKeyValidationService" class="org.onebusaway.users.impl.validation.KeyValidationServiceImpl" />
  <!-- Database Configuration -->

 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://127.0.0.1/oba?characterEncoding=UTF-8" />
    <property name="username" value="oba" />
    <property name="password" value="xxx" />
  </bean>

<bean id="agencyMetadataDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://127.0.0.1/oba?characterEncoding=UTF-8" />
    <property name="username" value="oba" />
    <property name="password" value="xxx" />
  </bean>

 <bean id="agencyMetadataSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    
    <property name="dataSource" ref="agencyMetadataDataSource" />
    <property name="annotatedClasses">
      <list>
        <value>org.onebusaway.agency_metadata.model.AgencyMetadata</value>
        <value>org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl</value>
      </list>
    </property>
    <property name="hibernateProperties">
      <props>
        <prop key="hibernate.connection.pool_size">1</prop>
        <prop key="hibernate.current_session_context_class">thread</prop>
        <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
      </props>
    </property>
  </bean>

  <bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
    <property name="properties">
      <props>
        <prop key="cacheManager.cacheManagerName">org.onebusaway.api_webapp.cacheManager</prop>
      </props>
    </property>
  </bean>
  <bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
    <property name="properties">
      <props>
        <prop key="cacheManager.cacheManagerName">org.onebusaway.api_webapp.cacheManager</prop>
      </props>
    </property>
   </bean>

  <!-- Allows the TEST key for OBA API testing.  Should be removed in production -->
  <bean class="org.onebusaway.users.impl.CreateApiKeyAction">
    <property name="key" value="TEST"/>
  </bean>
</beans>

Thank you,
Val E.

 

Sheldon A. Brown

unread,
Feb 28, 2021, 10:26:28 AM2/28/21
to onebusaway...@googlegroups.com
Hibernate was upgraded from version 3.x to version 4.x when you move
to OBA 2.0. In doing so, the syntax of data-sources changed slightly.
Take a look at :

https://github.com/OneBusAway/onebusaway-application-modules/blob/master/onebusaway-api-webapp/src/main/resources/data-sources.xml


In short, you need to change references of

org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean

to

org.springframework.orm.hibernate4.LocalSessionFactoryBean

and remove this configuration:

<prop key="hibernate.current_session_context_class">thread</prop>

Sheldon
> --
> You received this message because you are subscribed to the Google Groups "onebusaway-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to onebusaway-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/onebusaway-developers/b802577e-b3f1-4b38-99fc-9070763f3062n%40googlegroups.com.

Valerian Eftime

unread,
Feb 28, 2021, 10:46:14 AM2/28/21
to onebusaway...@googlegroups.com
Thank you for your guidance Sheldon, I will make the changes and provide an update if I’ve succeeded.
Thanks,
Val

Valerian Eftime

unread,
Feb 28, 2021, 2:06:13 PM2/28/21
to onebusaway...@googlegroups.com
Thank you again for your guidance Sheldon, I’m able to run the API web app now. 
Have a great evening, mine is already better :) !
Val
Reply all
Reply to author
Forward
0 new messages