• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • Unable to deploy OS V2.3 when running the CATALINA for a fresh installation

    The issue comes from this function: com.krishagni.catissueplus.core.init.DeInitializer.class

    public void afterPropertiesSet()
    throws Exception
    {
    InputStream in;
    Map localeSettings = cfgSvc.getLocaleSettings();
    String dateFormat = (String)localeSettings.get(“deBeDateFmt”);
    String timeFormat = (String)localeSettings.get(“timeFmt”);
    String dataDir = cfgSvc.getDataDir();
    String dir = (new StringBuilder(dataDir)).append(File.separator).append(“de-file-data”).append(File.separator).toString();
    File dirFile = new File(dir);
    if(!dirFile.exists() && !dirFile.mkdirs())
    throw new RuntimeException(“Error couldn’t create directory for storing de file data”);

    ////////////////////////////////////////////////////////

    now on the last version I was using 2.0 the function looks like this and it is working fine:

    public void afterPropertiesSet()
    throws Exception
    {
    InputStream in;
    Map localeSettings = cfgSvc.getLocaleSettings();
    String dateFormat = (String)localeSettings.get(“deBeDateFmt”);
    String timeFormat = (String)localeSettings.get(“timeFmt”);
    String dataDir = cfgSvc.getStrSetting(“common”, “data_dir”, new String[] {
    “.”
    });
    String dir = (new StringBuilder(dataDir)).append(File.separator).append(“de-file-data”).append(File.separator).toString();
    File dirFile = new File(dir);
    if(!dirFile.exists() && !dirFile.mkdirs())
    throw new RuntimeException(“Error couldn’t create directory for storing de file data”);


    Nov 06, 2015 10:54:14 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘deInitializer’ defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Error couldn’t create directory for storing de file data
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1090)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1900)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: Error couldn’t create directory for storing de file data
    at com.krishagni.catissueplus.core.init.DeInitializer.afterPropertiesSet(DeInitializer.java:83)

    Hello @Rolando_Ramirez

    I don’t think there is a problem with change in code. From my analysis, it seems deployment didn’t go through fine. Can you please share following with us so that we can help you proceed forward?

    1. $TOMCAT_HOME/webapps/openspecimen/WEB-INF/classes/application.properties.
      In this file, ensure property app.data_dir is assigned a value that represents valid directory on file system where OpenSpecimen is running

    2. Ensure below query returns either empty/blank value or value representing a valid directory on file system

      select 
        s.value 
      from 
        os_cfg_settings s 
        inner join os_cfg_props p on s.property_id = p.identifier 
        inner join os_modules m on m.identifier = p.module_id 
      where 
        s.activity_status = 'Active' and 
        m.name = 'common' and 
        p.name = 'data_dir';
      

    Thanks.

    Here’s the APPLICATION FILE

    app.data_dir=“C:/websites/openspecimen-os_v24/os-data”
    datasource.jndi=java:/comp/env/jdbc/openspecimen
    datasource.type=fresh
    datasource.dialect=org.hibernate.dialect.MySQLDialect
    database.type=mysql
    plugin.dir=
    buildinfo.version=v2.4.RC2
    buildinfo.date=1446816535053
    buildinfo.commit_revision=014fa07


    and the QUERY RETURN an empty cell.

    the directory already exist before I launch the fresh installation -
    The server is a windows server 2008 R2 - do I need to add any permission to the folder ?

    Thanks
    -Rolando

    Hi @Rolando_Ramirez,

    The value specified for app.data_dir property is incorrect. This should not be enclosed in the double quotes. Please remove the double quotes from the value. After updating it will look like below:

    app.data_dir=C:/websites/openspecimen-os_v24/os-data
    

    Once you are done with the changes, please restart the tomcat.

    ~Nitesh

    The truth is that without the quotes - the folder is not created when executing the INSTALL.bat file nor it can create the nested folder for the consent - thus the installation needs to be done twice - one with quotes so it can create the folders (data dir) - delete everything and leave the folders that the first installation created (for the data dir and consent)- and execute the next installation without quotes - so the application.properties file has the correct folder path format -

    and then lunch tomcat.

    … there you have it. Issue fixed -

    I hope this helps for new people using windows.