error deploying admin-webapp: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session]

786 views
Skip to first unread message

Vel Ats

unread,
Jul 16, 2018, 8:11:24 AM7/16/18
to onebusaway-developers
i have deployed the oba-api-webapp, oba-transit-data-federation-weapp and the oba-admin-webapp.
everything seems to be fine with the api-webapp and with the transit-data-federation-webapp but the admin webapp shows an error:

this is my admin-webapp.log:

2018-07-16 13:37:08,717 ERROR [ContextLoader.java:220] : Context initialization failed
org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailSender' defined in class path resource [data-sources.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'javax.mail.Session' to required type 'javax.mail.Session' for property 'session'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session': no matching editors or conversion strategy found
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
[...]
    at java
.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'javax.mail.Session' to required type 'javax.mail.Session' for property 'session'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session': no matching editors or conversion strategy found
[...]
   
... 24 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session': no matching editors or conversion strategy found
[...]
   
... 30 more
2018-07-16 13:37:08,724 INFO  [LocalizationListener.java:48] : did not find resource override, using default localization of onebusaway-nyc


data-sources.xml of oba-admin-webapp:

<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2011 Metropolitan Transportation Authority

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   
xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
   
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
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>


 
<!-- Transit Data Service -->
   
<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>

   
<!-- Database Configuration
    <bean id="dataSource"
          class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName"
                value="java:comp/env/jdbc/appDB"/>  
      <property name="lookupOnStartup"
                value="true"/>  
      <property name="cache"
                value="true"/>  
      <property name="proxyInterface"
                value="javax.sql.DataSource"/>  
      <property name="resourceRef"
                value="true" />
    </bean>-->

   
<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="root" />
       
<property name="password" value="root" />
   
</bean>

   
<alias name="dataSource" alias="mutableDataSource" />
 
   
<!-- Database Connection Configuration for Agency Metadata -->
   
<bean id="agencyMetadataDataSource"
         
class="org.springframework.jndi.JndiObjectFactoryBean">
     
<property name="jndiName"
               
value="java:comp/env/jdbc/agencyMetadataDB"/>  
     
<property name="lookupOnStartup"
               
value="true"/>  
     
<property name="cache"
               
value="true"/>  
     
<property name="proxyInterface"
               
value="javax.sql.DataSource"/>  
     
<property name="resourceRef"
               
value="true" />
   
</bean>
     
<!-- Database Connection Configuration for Bundle Build Response -->
   
<bean id="bundleBuildResponseDataSource"
         
class="org.springframework.jndi.JndiObjectFactoryBean">
     
<property name="jndiName"
               
value="java:comp/env/jdbc/appDB"/>
     
<property name="lookupOnStartup"
               
value="true"/>
     
<property name="cache"
               
value="true"/>
     
<property name="proxyInterface"
               
value="javax.sql.DataSource"/>
     
<property name="resourceRef"
               
value="true" />
   
</bean>
   
   
   
<!--  Email connection -->
     
<bean id="mailSession"
         
class="org.springframework.jndi.JndiObjectFactoryBean">
     
<property name="jndiName"
               
value="java:comp/env/mail/Session"/>
     
<property name="lookupOnStartup"
               
value="true"/>  
     
<property name="cache"
               
value="true"/>  
   
</bean>
   
   
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
       
<property name="session" ref="mailSession"/>
   
</bean>

   
   
<!-- Database Connection Configuration for retrieving archived data -->
   
<bean id="gtfsRealtimeArchiveDataSource"
         
class="org.springframework.jndi.JndiObjectFactoryBean">
     
<property name="jndiName"
               
value="java:comp/env/jdbc/archiveDB"/>
     
<property name="lookupOnStartup"
               
value="true"/>
     
<property name="cache"
               
value="true"/>
     
<property name="proxyInterface"
               
value="javax.sql.DataSource"/>
     
<property name="resourceRef"
               
value="true" />
   
</bean>

<!-- Other Stuff: -->

   
<bean id="externalGeocoderImpl" class="org.onebusaway.geocoder.enterprise.impl.EnterpriseGoogleGeocoderImpl">
       
<property name="wktFilterPolygon" value="POLYGON((-73.911209 40.934265,-73.779716 40.889639,-73.794823 40.841606,-73.779373 40.817707,-73.778 40.806793,-73.762207 40.783661,-73.734055 40.75818,-73.721008 40.73321,-73.723068 40.710833,-73.724442 40.682721,-73.729935 40.661889,-73.721008 40.631672,-73.718948 40.606133,-73.716202 40.568589,-73.732681 40.544591,-73.777313 40.525283,-73.924942 40.504402,-74.052658 40.493437,-74.166641 40.486126,-74.242859 40.489782,-74.258652 40.498659,-74.258652 40.510667,-74.250412 40.520585,-74.250412 40.535199,-74.250412 40.548244,-74.236679 40.555026,-74.225006 40.558156,-74.217453 40.558156,-74.21196 40.565981,-74.207153 40.585799,-74.200287 40.599356,-74.205093 40.610304,-74.205093 40.621249,-74.205093 40.63063,-74.200287 40.636883,-74.192047 40.640009,-74.184494 40.64522,-74.171448 40.645741,-74.152908 40.648346,-74.148102 40.642094,-74.132996 40.643657,-74.114456 40.647825,-74.08905 40.650429,-74.069824 40.655118,-74.045792 40.669702,-74.034805 40.696258,-74.024506 40.724885,-74.014893 40.748818,-74.007339 40.773782,-73.985367 40.794578,-73.972321 40.820565,-73.953094 40.848619,-73.927002 40.900539,-73.918076 40.92389,-73.913956 40.93219,-73.911209 40.934265))"/>        
       
<property name="resultBiasingBounds">
           
<bean class="org.onebusaway.geospatial.model.CoordinateBounds">
               
<property name="minLat" value="40.57963926492829" />
               
<property name="minLon" value="-74.19498680838014" />
               
<property name="maxLat" value="40.94577345952476" />
               
<property name="maxLon" value="-73.69785546072389" />
           
</bean>
       
</property>
   
</bean>
   
   
<bean id="serviceAreaServiceImpl" class="org.onebusaway.presentation.impl.ServiceAreaServiceImpl">
       
<property name="defaultBounds">
           
<bean class="org.onebusaway.geospatial.model.CoordinateBounds">
               
<property name="minLat" value="38.792627" />
               
<property name="minLon" value="-76.069336" />
               
<property name="maxLat" value="40.93634" />
               
<property name="maxLon" value="-73.607025" />
           
</bean>
       
</property>
       
<property name="calculateDefaultBoundsFromAgencyCoverage" value="false" />
   
</bean>
   
   
<!--  workaround for ehcache issues, requires unique name to not conflict bundle building -->
   
<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
   
<property name="properties">
     
<props>
       
<prop key="cacheManager.cacheManagerName">org.onebusaway.nyc.admin.cacheManager</prop>
<!--         <prop key="rssServiceAlertsService.defaultAgencyId">1</prop> -->
<!--         <prop key="rssServiceAlertsService.alertSource">WMATA</prop> -->
<!--         <prop key="rssServiceAlertsService.serviceStatusUrlString">http://www.metroalerts.info/rss.aspx?bus</prop> -->
<!--         <prop key="rssServiceAlertsService.serviceAdvisoryUrlString">http://www.wmata.com/rider_tools/metro_service_status/feeds/bus_Advisories.xml</prop> -->
     
</props>
   
</property>
   
</bean>
   
   
<bean id="webappHibernateProperties" class="org.onebusaway.container.spring.PropertiesBeanPostProcessor">
       
<property name="target" value="hibernateProperties" />
       
<property name="properties">
           
<props>
             
<prop key="hibernate.show_sql">false</prop>
               
<prop key="hibernate.hbm2ddl.auto">update</prop>
           
</props>
       
</property>
   
</bean>
   
   
<bean id="agencyMetadataSessionFactory"
       
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
       
<property name="dataSource" ref="dataSource" />
       
<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.dialect">org.hibernate.dialect.MySQLDialect</prop>
               
<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>
               
<prop key="hibernate.show_sql">false</prop>
               
<prop key="hibernate.hbm2ddl.auto">update</prop>
               
<prop key="hibernate.jdbc.batch_size">1000</prop>
           
</props>
       
</property>
   
</bean>
     
<bean id="bundleBuildResponseSessionFactory"
   
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
   
<property name="dataSource" ref="bundleBuildResponseDataSource" />
   
<property name="annotatedClasses">
     
<list>
       
<value>org.onebusaway.admin.model.BundleBuildResponse</value>
       
<value>org.onebusaway.admin.service.bundle.impl.BundleBuildResponseDaoImpl</value>
     
</list>
   
</property>
   
<property name="hibernateProperties">
     
<props>
       
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
       
<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>
       
<prop key="hibernate.show_sql">false</prop>
       
<prop key="hibernate.hbm2ddl.auto">update</prop>
       
<prop key="hibernate.jdbc.batch_size">1000</prop>
     
</props>
   
</property>
 
</bean>
 
 
<bean id="gtfsRealtimeArchiveSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
   
<property name="dataSource" ref="gtfsRealtimeArchiveDataSource" />
   
<property name="annotatedClasses">
     
<list>
       
<value>org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo</value>
       
<value>org.onebusaway.admin.service.bundle.impl.GtfsArchiveDaoImpl</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>
       
<prop key="hibernate.show_sql">false</prop>
       
<prop key="hibernate.hbm2ddl.auto">none</prop>
       
<prop key="hibernate.jdbc.batch_size">1000</prop>
       
<prop key="hibernate.order_inserts">false</prop>
       
<prop key="hibernate.order_updates">false</prop>
     
</props>
   
</property>
   
<property name="mappingResources">
     
<list>
       
<value>org/onebusaway/gtfs/model/GtfsArchiveMapping.hibernate.xml</value>
     
</list>
   
</property>
 
</bean>

   
<!-- quartz scheduling for PingJob -->
   
<bean name="pingJob" class="org.springframework.scheduling.quartz.JobDetailBean">
       
<property name="jobClass" value="org.onebusaway.admin.job.PingJob" />
       
<property name="jobDataAsMap">
           
<map>
                 
<entry key="userManagementService" value-ref="userManagementServiceImpl"/>
             
</map>
       
</property>
       
   
</bean>
   
   
<bean id="pingTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
       
<property name="jobDetail" ref="pingJob" />
       
<property name="cronExpression" value="0 * * * * ?" /><!--  every minute -->
   
</bean>
   
   
<bean id="gsonTool" class="org.onebusaway.admin.json.LowerCaseWDashesGsonJsonTool">
   
<property name="prettyPrintOutput" value="false" />
 
</bean>
   
   
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
       
<property name="triggers">
           
<list>
               
<ref bean="pingTrigger" />
           
</list>
       
</property>
   
</bean>
   
   
</beans>


Sheldon A. Brown

unread,
Jul 16, 2018, 8:16:48 AM7/16/18
to onebusaway...@googlegroups.com
Two things:

1) the admin webapp is a visual bundle building tool. Documentation
is light for this module, and its not intended to be deployed in the
same container as the transit-data-federation-webapp. If you've used
the federated-transit-data-builder you do not need to run this webapp.
2) If you still intend to use the admin webapp, comment out this
portion of your data-sources.xml:
<bean id="mailSession"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/mail/Session"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
</bean>

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 post to this group, send email to onebusaway...@googlegroups.com.
> Visit this group at https://groups.google.com/group/onebusaway-developers.
> For more options, visit https://groups.google.com/d/optout.

Vel Ats

unread,
Jul 16, 2018, 8:44:04 AM7/16/18
to onebusaway-developers
i removed the admin-webapp but now i get this error (i also had this error before deploying the admin webapp) (catalina.out):

2018-07-16 14:29:52,176 INFO  [BundleConfigDao.java:59] : looking for metadata file metadata.json
2018-07-16 14:29:52,176 ERROR [BundleConfigDao.java:74] :  did not find metadata file metadata.json
2018-07-16 14:29:52,214 INFO  [HttpBundleStoreImpl.java:72] : Getting current bundle list from Server...
2018-07-16 14:29:52,215 INFO  [HttpServiceClientImpl.java:88] : Requesting http://localhost:8080/onebusaway-admin-webapp/api/bundle/list
2018-07-16 14:30:52,276 ERROR [RestApiLibrary.java:119] : Error getting contents of url: http://localhost:8080/onebusaway-admin-webapp/api/bundle/list
2018-07-16 14:30:52,278 INFO  [HttpBundleStoreImpl.java:78] : Error executing apiLibrary.getItemsForRequest
java
.net.SocketTimeoutException: Read timed out
    at java
.net.SocketInputStream.socketRead0(Native Method)
[...]
    at java
.lang.Thread.run(Thread.java:748)
2018-07-16 14:30:52,281 ERROR [BundleManagementServiceImpl.java:201] : No valid and active bundles found!

is the metadata.json required? and why is it trying to request something from onebusaway-admin-webapp?

Sheldon A. Brown

unread,
Jul 16, 2018, 8:51:12 AM7/16/18
to onebusaway...@googlegroups.com
in your onebusaway-transit-data-federation-webapp/WEB-INF/classes/data-sources.xml

Change bundleManagementService to look like this:

<bean id="bundleManagementService"
class="org.onebusaway.transit_data_federation.impl.bundle.BundleManagementServiceImpl">
<property name="bundleStoreRoot" value="/var/lib/oba/tds/bundle" />
<!-- any directory that exists an is writeable -->
<property name="standaloneMode" value="true" />
</bean>

Sheldon
>> > email to onebusaway-devel...@googlegroups.com.
>> > To post to this group, send email to onebusaway...@googlegroups.com.
>> > Visit this group at
>> > https://groups.google.com/group/onebusaway-developers.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.

Vel Ats

unread,
Jul 16, 2018, 9:11:24 AM7/16/18
to onebusaway-developers
great thank you!
>> > To post to this group, send email to onebusaway...@googlegroups.com.
>> > Visit this group at
>> > https://groups.google.com/group/onebusaway-developers.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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
Reply all
Reply to author
Forward
0 new messages