ZKTeco BioSecurity (Access Control web based application) running on java/Tomcat/Spring
is unable to launch.
$PATH = C:\Program Files\BioSecurity\MainResource\
From the log files located at $PATH/tomcat/logs/
, I see the following error:
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [applicationContext.xml]: Could not resolve placeholder 'datasource.driverClassName' in string value "${datasource.driverClassName}"
However, I'm a noob at java/Tomcat/Spring and I can't seem to find the "applicationContext.xml" file in question. I see "applicationcontext.xml" mentioned in the webapps web.xml file.
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
Please see the logs below:
- /tomcat/logs/localhost.2023-05-04.log
May 04, 2023 12:46:17 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
May 04, 2023 12:46:17 PM org.apache.catalina.core.ApplicationContext log
INFO: excute WebFilterInitializer...
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: do init shiroFilter in WebApplicationInitializer
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: do init langSessionFilter in WebApplicationInitializer
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: do init OAuth2Filter in WebApplicationInitializer
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: do init OAuth2Filter in WebApplicationInitializer
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: do init CheckFilter in WebApplicationInitializer
May 04, 2023 12:46:19 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
May 04, 2023 12:46:29 PM 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.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [applicationContext.xml]: Could not resolve placeholder 'datasource.driverClassName' in string value "${datasource.driverClassName}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'datasource.driverClassName' in string value "${datasource.driverClassName}"
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:223)
at com.zk.common.util.PropertiesUtil.processProperties(PropertiesUtil.java:88)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:162)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:611)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5157)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5680)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1017)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2039)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'datasource.driverClassName' in string value "${datasource.driverClassName}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:259)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:282)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:204)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:141)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82)
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:208)
... 23 more
May 04, 2023 12:46:29 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
- /tomcat/logs/commons-daemon.2023-05-04.log
[2023-05-04 12:42:05] [info] [ 6748] Stopping service...
[2023-05-04 12:42:06] [info] [ 6748] Service stop thread completed.
[2023-05-04 12:42:07] [info] [ 6008] Run service finished.
[2023-05-04 12:42:07] [info] [ 6008] Commons Daemon procrun finished
[2023-05-04 12:45:57] [info] [ 6688] Commons Daemon procrun (1.0.15.0 32-bit) started
[2023-05-04 12:45:57] [info] [ 6688] Running 'BioSecurityTomcat' Service...
[2023-05-04 12:45:57] [info] [ 2860] Starting service...
[2023-05-04 12:45:58] [info] [ 2860] Service started in 1356 ms.
- /tomcat/logs/biosecuritytomcat-stderr.2023-05-04.log
2023-05-04 12:45:57 Commons Daemon procrun stderr initialized
May 04, 2023 12:45:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library 1.2.16 using APR version 1.6.3.
May 04, 2023 12:45:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
May 04, 2023 12:45:59 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.2m 2 Nov 2017)
May 04, 2023 12:45:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8088"]
May 04, 2023 12:45:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8019"]
May 04, 2023 12:45:59 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1952 ms
May 04, 2023 12:45:59 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 04, 2023 12:45:59 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.88
May 04, 2023 12:45:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\BioSecurity\MainResource\tomcat\webapps\ROOT
May 04, 2023 12:46:17 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: urn:com:sun:jersey:api:view is already defined
May 04, 2023 12:46:17 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 04, 2023 12:46:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
May 04, 2023 12:46:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [DefaultQuartzScheduler_QuartzSchedulerThread] but has failed to stop it. This is very likely to create a memory leak.
May 04, 2023 12:46:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\BioSecurity\MainResource\tomcat\webapps\ROOT has finished in 30,018 ms
May 04, 2023 12:46:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8088"]
May 04, 2023 12:46:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8019"]
May 04, 2023 12:46:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 30121 ms
May 04, 2023 12:46:30 PM org.apache.tomcat.util.http.parser.HttpParser <clinit>
WARNING: Character [[] is not allowed and will continue to be rejected.
May 04, 2023 12:46:30 PM org.apache.tomcat.util.http.parser.HttpParser <clinit>
WARNING: Character []] is not allowed and will continue to be rejected.
- /tomcat/logs/biosecuritytomcat-stdout.2023-05-04.log Leaving out the contents of this log file as it's chatty. If required please let me know and I'll post it.
I tried restarting the application and capturing the logs. After that, I couldn't figure out how to resolve it.