我在我的1台计算机上用Intellij创建了我的webapp。我在Intellij的Tomcat 9上部署它,它正在工作。之后,我生成了war文件并从Tomcat级别(不使用Intellij)部署它,我的应用程序仍然有效。接下来我在2台计算机上复制了war文件,部署后出现错误:HTTP状态404 - 未找到。所有应用程序,如/ manger或/ host-manager都能正常运行。
如果重要的是我在我的1台计算机上安装了Windows 10,在第二台计算机上安装了Windows 7。
这是我的第一个webapp,我不知道应该在哪里搜索问题。
我将非常感谢任何解决方案或建议。
在Tomcat日志文件夹中,我有以下日志文件:
catalina.2018-02-25:
25-Feb-2018 10:28:12.392 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.5
25-Feb-2018 10:28:12.495 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 6 2018 21:42:23 UTC
25-Feb-2018 10:28:12.496 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.5.0
25-Feb-2018 10:28:12.497 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
25-Feb-2018 10:28:12.498 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1
25-Feb-2018 10:28:12.498 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
25-Feb-2018 10:28:12.498 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: D:\Java8
25-Feb-2018 10:28:12.499 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_162-b12
25-Feb-2018 10:28:12.499 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
25-Feb-2018 10:28:12.500 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: D:\Projekty\Tomcat9
25-Feb-2018 10:28:12.500 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Projekty\Tomcat9
25-Feb-2018 10:28:12.501 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Projekty\Tomcat9
25-Feb-2018 10:28:12.501 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=D:\Projekty\Tomcat9
25-Feb-2018 10:28:12.505 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Projekty\Tomcat9\temp
25-Feb-2018 10:28:12.506 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
25-Feb-2018 10:28:12.506 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=D:\Projekty\Tomcat9\conf\logging.properties
25-Feb-2018 10:28:12.506 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
25-Feb-2018 10:28:12.507 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: abort
25-Feb-2018 10:28:12.507 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
25-Feb-2018 10:28:12.507 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
25-Feb-2018 10:28:12.508 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\Projekty\Tomcat9\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\nodejs\;.]
25-Feb-2018 10:28:13.976 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8084"]
25-Feb-2018 10:28:14.475 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
25-Feb-2018 10:28:14.518 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
25-Feb-2018 10:28:14.522 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
25-Feb-2018 10:28:14.522 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 5503 ms
25-Feb-2018 10:28:14.660 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
25-Feb-2018 10:28:14.660 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.5
25-Feb-2018 10:28:14.922 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [D:\Projekty\Tomcat9\webapps\animalwebstore.war]
25-Feb-2018 10:28:21.993 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars 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.
25-Feb-2018 10:28:24.799 INFO [main] org.hibernate.jpa.internal.util.LogHelper.logPersistenceUnitInformation HHH000204: Processing PersistenceUnitInfo [
name: default
...]
25-Feb-2018 10:28:25.235 INFO [main] org.hibernate.Version.logVersion HHH000412: Hibernate Core {5.2.11.Final}
25-Feb-2018 10:28:25.239 INFO [main] org.hibernate.cfg.Environment.<clinit> HHH000205: Loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MySQL5Dialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.hbm2ddl.auto=create}
25-Feb-2018 10:28:25.569 INFO [main] org.hibernate.annotations.common.reflection.java.JavaReflectionManager.<clinit> HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
25-Feb-2018 10:28:26.875 INFO [main] org.hibernate.dialect.Dialect.<init> HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
25-Feb-2018 10:28:28.563 WARN [main] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions SQL Error: 1146, SQLState: 42S02
25-Feb-2018 10:28:28.564 ERROR [main] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions Table 'animalwebstoredb.animals' doesn't exist
25-Feb-2018 10:28:28.569 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
25-Feb-2018 10:28:28.599 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/animalwebstore] startup failed due to previous errors
25-Feb-2018 10:28:28.614 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [animalwebstore] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
25-Feb-2018 10:28:28.615 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [animalwebstore] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:41)
25-Feb-2018 10:28:28.615 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [animalwebstore] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)
25-Feb-2018 10:28:28.655 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [D:\Projekty\Tomcat9\webapps\animalwebstore.war] has finished in [13,733] ms
25-Feb-2018 10:28:28.656 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Projekty\Tomcat9\webapps\docs]
25-Feb-2018 10:28:28.817 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Projekty\Tomcat9\webapps\docs] has finished in [160] ms
25-Feb-2018 10:28:28.818 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Projekty\Tomcat9\webapps\examples]
25-Feb-2018 10:28:30.505 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Projekty\Tomcat9\webapps\examples] has finished in [1,688] ms
25-Feb-2018 10:28:30.506 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Projekty\Tomcat9\webapps\host-manager]
25-Feb-2018 10:28:30.594 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Projekty\Tomcat9\webapps\host-manager] has finished in [87] ms
25-Feb-2018 10:28:30.594 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Projekty\Tomcat9\webapps\manager]
25-Feb-2018 10:28:30.816 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Projekty\Tomcat9\webapps\manager] has finished in [222] ms
25-Feb-2018 10:28:30.816 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Projekty\Tomcat9\webapps\ROOT]
25-Feb-2018 10:28:30.861 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Projekty\Tomcat9\webapps\ROOT] has finished in [44] ms
25-Feb-2018 10:28:30.864 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8084"]
25-Feb-2018 10:28:30.874 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
25-Feb-2018 10:28:30.877 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 16353 ms
localhost.2018-02-25:
25-Feb-2018 10:28:22.069 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
25-Feb-2018 10:28:22.227 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
25-Feb-2018 10:28:28.569 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart 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 'entityManagerFactory' defined in com.tur.util.AppConfig: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1085)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:858)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4637)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:740)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1847)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:761)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:967)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:387)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:376)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)
... 53 more
Caused by: org.hibernate.exception.SQLGrammarException: Error accessing tables metadata
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:98)
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.populateTablesWithColumns(InformationExtractorJdbcDatabaseMetaDataImpl.java:383)
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTables(InformationExtractorJdbcDatabaseMetaDataImpl.java:337)
at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTablesInformation(DatabaseInformationImpl.java:120)
at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:65)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:313)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:452)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889)
... 60 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'animalwebstoredb.animals' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4208)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4140)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2597)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2758)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2769)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
at com.mysql.jdbc.DatabaseMetaData$2.forEach(DatabaseMetaData.java:2716)
at com.mysql.jdbc.DatabaseMetaData$2.forEach(DatabaseMetaData.java:2603)
at com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:50)
at com.mysql.jdbc.DatabaseMetaData.getColumns(DatabaseMetaData.java:2602)
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.populateTablesWithColumns(InformationExtractorJdbcDatabaseMetaDataImpl.java:350)
... 70 more
25-Feb-2018 10:28:28.604 INFO [main] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
25-Feb-2018 10:28:30.498 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
25-Feb-2018 10:28:30.498 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
25-Feb-2018 10:28:30.500 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@2053b761')
在tomcat9-stderr.2018-02-25中与catalina相同.2018-02-25