obiba / onyx-demo

Onyx demo project that can be used as a starting point to build your own Onyx project.
GNU General Public License v3.0
1 stars 3 forks source link

Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/datasource.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'testOnBorrow' #1

Closed VitorSantos1 closed 5 years ago

VitorSantos1 commented 5 years ago

Hello,

I'm trying to deploy the onyx-demo using a separate MySQL DB instance and I'm having trouble with the testOnBorrow property value, even though I'm using the default value provided in the documentation.

The onyx-config.properties file:

###############################################################################
##
## Onyx Configuration
##
## Note: values can be encrypted using jasypt tools 
##       http://www.jasypt.org/cli.html with your master password.
##       key=value becomes key=ENC(encrypted_value)
##
###############################################################################

##
## Onyx engine
##

# A comma separated list of stage names that define their ordering within an Interview.
org.obiba.onyx.engine.staticStageOrder=Consent,HealthQuestionnaireSelfAdministered,QuartzDemoQuestionnaire,CIPreliminaryQuestionnaire,StandingHeight,BloodPressure,Impedance310,Weight,Spirometry,BloodUrineSamplesCollection,UrineSamplesCollection,Conclusion

# A comma separated list of supported recruitment types
org.obiba.onyx.supportedRecruitmentTypes=ENROLLED,VOLUNTEER

# Must be true in order for the "Update Appointment List" button to be present. (org.obiba.onyx.supportedRecruitmentTypes must also include ENROLLED.)
org.obiba.onyx.appointments.enabled=true

# Must be true in order for the "Participant Registry" button to be present.
org.obiba.onyx.participant.registry.enabled=true
# The type of "Participant Registry". Values include "fixed" for development and "restful" for deployment.
org.obiba.onyx.participant.registry.type=fixed
# The url use by the RestfulParticipantRegistry to lookup Participants from a remote service.
#org.obiba.onyx.participant.registry.uriTemplate=http://localhost/participant/{identifier}

# Name of printer for PDF printing.
# Use 'default' to use system default printer. Leave blank to not use PDF printer.
org.obiba.onyx.pdfPrinterName=

# Keystore
org.obiba.onyx.keystore.file=file:${java.io.tmpdir}/onyxKeyStore.jks
org.obiba.onyx.keystore.password=youshouldchangethispassword

##
## Variables and Data export
##

# Example Opal URL
org.obiba.onyx.opal.url=https://my-opal:8443/
org.obiba.onyx.opal.username=administrator
org.obiba.onyx.opal.password=password

# System path where to export Onyx Data
org.obiba.onyx.export.path=target

##
## Participants
## 

# Participant Id validation pattern
org.obiba.onyx.participantId.pattern=.*

# Participant Id generation
# Flag indicating whether to use generated identifiers (true or false).
org.obiba.onyx.participantId.generated=true
# Max increment (i.e., between identifiers).
org.obiba.onyx.participantId.maxIncrement=5

## Participant reader
org.obiba.onyx.participantReader.sheetNumber=1
org.obiba.onyx.participantReader.headerRowNumber=2
org.obiba.onyx.participantReader.firstDataRowNumber=3
# List of key/value pairs separated by a comma. For example, "param1=foo,param2=bar".
org.obiba.onyx.participantReader.columnToAttribute=Participant ID=Enrollment ID,Collection Site Id=Assessment Center ID,Sex=Gender,Appointment date/time=Appointment Time

# Appointment management
# Directory that contains the appointment list files to process dropped by external process
org.obiba.onyx.appointments.inputDirectory=WEB-INF/appointments/in
# Optional directory that contains the successfully processed files
org.obiba.onyx.appointments.outputDirectory=WEB-INF/appointments/out
# Schedule for automatic appointment list updates (4am every day)
org.obiba.onyx.appointments.schedule=0 0 4 * * ?

# Number of days used to select data for purging (data older than this number of days will be purged)
org.obiba.onyx.participant.purge=0

# Allow multiple interviews for a participant (after participant data has being purged). Participants will be 
# identified by their enrollment ID. Multiple interviews will require different participant interview ID to be assigned. 
org.obiba.onyx.participant.purge.multipleInterview=false

##
## Users
##

# Algorithm used to hash user passwords.
org.obiba.onyx.password.hash.algorithm=SHA

# Password Validation Strategy
org.obiba.onyx.password.validation.allowedCharacterGroups="A-Z","a-z","0-9","[.!@#$%&*()]"
org.obiba.onyx.password.validation.minimumCharacterGroupsUsage=3
org.obiba.onyx.password.validation.preventUserAttributeUsage=true
org.obiba.onyx.password.validation.minimumSize=8
org.obiba.onyx.password.validation.maximumSize=14

# Optional Shiro Ini file path to load additional authentication realms
# See http://shiro.apache.org/configuration.html#Configuration-INISections
#org.obiba.onyx.authentication.shiro.ini=file:/etc/onyx/shiro.ini

# Define mapping between roles from other realms to Onyx roles
# Valid Onyx roles are: SYSTEM_ADMINISTRATOR, PARTICIPANT_MANAGER, PARTICIPANT_RECEPTIONIST, DATA_COLLECTION_OPERATOR
#org.obiba.onyx.authentication.rolesMap=role1=DATA_COLLECTION_OPERATOR,role2=DATA_COLLECTION_OPERATOR,role3=PARTICIPANT_MANAGER,role4=PARTICIPANT_RECEPTIONIST

##
## Formatting
##

# A default value for a reusable date format
org.obiba.onyx.dateFormat=yyyy-MM-dd

# A default value for a reusable date/time format
org.obiba.onyx.dateTimeFormat=yyyy-MM-dd HH:mm

##
## System configuration
##

# Onyx Web application mode: deployment or development
org.obiba.onyx.webapp.configurationType=deployment

# Database configuration (if applicable)
# HSQL
# org.obiba.onyx.datasource.driver=org.hsqldb.jdbcDriver
# org.obiba.onyx.datasource.url=jdbc:hsqldb:file:target/onyx-demo.db;shutdown=true
# org.obiba.onyx.datasource.url=jdbc:hsqldb:mem:onyx-demo
# org.obiba.onyx.datasource.username=sa
# org.obiba.onyx.datasource.password=
# org.obiba.onyx.datasource.dialect=org.hibernate.dialect.HSQLDialect
# org.obiba.onyx.datasource.validationQuery=
# org.obiba.onyx.datasource.testOnBorrow=false
# MySQL
org.obiba.onyx.datasource.driver=com.mysql.jdbc.Driver
org.obiba.onyx.datasource.url=jdbc:mysql://my-onyx-data:3306/onyx
org.obiba.onyx.datasource.username=onyx
org.obiba.onyx.datasource.password=onyx-demo
org.obiba.onyx.datasource.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
org.obiba.onyx.datasource.validationQuery=SELECT 1;
org.obiba.onyx.datasource.testOnBorrow=true

The error, presented in its stdout:

my-default_my-onyx.1.tyj4qeui5yl8@my-default    | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/datasource.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'testOnBorrow'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${org.obiba.onyx.datasource.testOnBorrow}]
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.doCreateBean(AbstractAutowimyableBeanFactory.java:562)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.createBean(AbstractAutowimyableBeanFactory.java:481)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.obiba.onyx.runtime.upgrade.support.UpgradeContextServletContextListener.loadUpgradeContext(UpgradeContextServletContextListener.java:56)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.obiba.onyx.runtime.upgrade.support.UpgradeContextServletContextListener.contextInitialized(UpgradeContextServletContextListener.java:28)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:835)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:808)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)my-default_my-onyx.1.tyj4qeui5yl8@my-default    |
                                                                at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1368)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:320)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1335)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:511)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:403)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.Server.start(Server.java:405)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.server.Server.doStart(Server.java:372)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:457)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:328)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.eclipse.jetty.maven.plugin.JettyRunWarMojo.execute(JettyRunWarMojo.java:64)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at java.lang.reflect.Method.invoke(Method.java:498)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    | Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'testOnBorrow'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${org.obiba.onyx.datasource.testOnBorrow}]
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:608)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:615)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:216)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.convertForProperty(AbstractAutowimyableBeanFactory.java:1580)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.applyPropertyValues(AbstractAutowimyableBeanFactory.java:1539)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.populateBean(AbstractAutowimyableBeanFactory.java:1281)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.factory.support.AbstractAutowimyableBeanFactory.doCreateBean(AbstractAutowimyableBeanFactory.java:551)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      ... 62 more
my-default_my-onyx.1.tyj4qeui5yl8@my-default    | Caused by: java.lang.IllegalArgumentException: Invalid boolean value [${org.obiba.onyx.datasource.testOnBorrow}]
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.propertyeditors.CustomBooleanEditor.setAsText(CustomBooleanEditor.java:123)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:470)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:443)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:200)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:588)
my-default_my-onyx.1.tyj4qeui5yl8@my-default    |      ... 68 more
ymarcon commented 5 years ago

I cannot reproduce and I just un-commented the MYSQL section. Do you have in your config a trailing char? (space or other invisible char). Valid values could be true or 1 or on or yes (any case).

VitorSantos1 commented 5 years ago

I delved into my problem further and it turned out I had problems with the content of onyx-config.properties, being empty.

You can close the issue and thank you for your support.