如何正确的查看TongWeb日志?
当使用TongWeb时出现问题,第一处理方式为查看TongWeb logs目录下的server.log。
注意:千万不要在控制台查看日志,排序不规则,浏览行数少,不如直接看server.log。
查看server.log日志主要查看应用的报错的根本原因,找到Caused by关键字,例如如下内容。
Caused by: javax.naming.NameNotFoundException: Name "JDBC/DPORTAL" not found.
at com.tongweb.tongejb.core.ivm.naming.IvmContext.federate(IvmContext.java:199)
at com.tongweb.tongejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)
at com.tongweb.tongejb.core.ivm.naming.OpenejbDelegateContext.lookup(OpenejbDelegateContext.java:48)
at com.tongweb.tongejb.core.ivm.naming.ContextWrapper.lookup(ContextWrapper.java:137)
at com.tongweb.tongejb.core.OpenEJBInitialContextFactory$LocalFallbackContextWrapper.lookup(OpenEJBInitialContextFactory.java:53)
at com.tongweb.naming.SelectorContext.lookup(SelectorContext.java:163)
at com.tongweb.naming.ThanosSelectorContext.lookup(ThanosSelectorContext.java:54)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 145 more
[2020-11-16 14:41:11] [SEVERE] [core] [One or more listeners failed to start. Full details will be found in the appropriate container log file]
这里是已经失败在解部署,再看下面无意义。
[2020-11-16 14:41:11] [SEVERE] [core] [Context [dportal] startup failed due to previous errors]
[2020-11-16 14:41:11] [INFO] [core] [Closing Spring root WebApplicationContext]
[2020-11-16 14:41:11] [INFO] [deployment] [Undeploying app: /opt/TongWeb7.0/deployment/dportal]
[2020-11-16 14:41:12] [SEVERE] [web-container] [Error deploying web application directory /opt/TongWeb7.0/deployment/dportal]
java.lang.RuntimeException: Start context failed.
at com.tongweb.web.thanos.startup.ThanosHostConfig.deployWar(ThanosHostConfig.java:231)
at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.fireTomcatProcess(ThanosWebtierWebAppBuilder.java:416)
at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.deployApplication(ThanosWebtierWebAppBuilder.java:363)
at com.tongweb.deploy.TongWebDeployer.deploy0(TongWebDeployer.java:204)
at com.tongweb.deploy.TongWebDeployer.deploy(TongWebDeployer.java:164)
at com.tongweb.deploy.commands.DeployCommand.deploy(DeployCommand.java:269)
at com.tongweb.console.deployer.service.DeployerService.deploy(DeployerService.java:587)
at com.tongweb.console.deployer.controller.DeployerController.deploy(DeployerController.java:361)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)
at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.createModelAndView(ResteasyHandlerAdapter.java:96)
at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:82)
at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:26)