- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 .war 文件导入到 tomcat8。
到目前为止,即使启动了 Tomcat,我也无法访问我的 Web 应用程序的页面。我从这个命令 (systemctl status tomcat8.service
) 得到这个错误:
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.postgresql.Driver.makeConnection(Driver.java:404)
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.postgresql.Driver.connect(Driver.java:272)
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnect
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectio
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSou
Mar 11 11:34:25 osboxes tomcat8[48213]: at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicD
Mar 11 11:34:25 osboxes tomcat8[48213]: ... 27 more
Mar 11 11:34:25 osboxes tomcat8[48213]: Starting service [Catalina]
Mar 11 11:34:25 osboxes tomcat8[48213]: Starting Servlet Engine: Apache Tomcat/8.5.34 (Ubuntu)
Mar 11 11:34:25 osboxes tomcat8[48213]: Deploying web application archive [/var/lib/tomcat8/webapps/slb.war]
几秒钟后:
Mar 11 11:25:02 osboxes tomcat8[47998]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Mar 11 11:25:02 osboxes tomcat8[47998]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Mar 11 11:25:02 osboxes tomcat8[47998]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Mar 11 11:25:02 osboxes tomcat8[47998]: at java.lang.Thread.run(Thread.java:748)
Mar 11 11:25:02 osboxes tomcat8[47998]: Deployment of web application archive [/var/lib/tomcat8/webapps/slb.war] has finished in [
Mar 11 11:25:02 osboxes tomcat8[47998]: Deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
Mar 11 11:25:02 osboxes tomcat8[47998]: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this
Mar 11 11:25:02 osboxes tomcat8[47998]: Deployment of web application directory [/var/lib/tomcat8/webapps/ROOT] has finished in [3
Mar 11 11:25:02 osboxes tomcat8[47998]: Starting ProtocolHandler ["http-nio-8080"]
Mar 11 11:25:02 osboxes tomcat8[47998]: Server startup in 7238 ms
顺便说一句,驱动程序所在的行以红色突出显示。
tomcat 库的内容:
osboxes@osboxes:~/hds-api-master$
ls /var/lib/tomcat8/lib/
–p postgresql-9.4.1212.jar
我来自哪里:
我将一个 java spring boot 应用程序导出到 .war 扩展名,没有错误,得到一个 .war 并将它移动到 tomcat 的 web 应用程序文件夹。我用于 maven 的命令:
mvn clean install
mvn package
它应该做什么:使用 URL 在端口 8080 上打开 Web 服务器:
localhost:8080/slb
编辑:我更改了 conf 文件中的密码,现在我的 tomcat 服务器显然运行良好,但显然我无法访问我的 webapp 或者我做错了,这是日志:
Systemctl;
tomcat8.service - Apache Tomcat 8.5 Web Application Server
Loaded: loaded (/lib/systemd/system/tomcat8.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-03-12 04:57:57 EDT; 2min 33s ago
Docs: https://tomcat.apache.org/tomcat-8.5-doc/index.html
Process: 59566 ExecStartPre=/usr/libexec/tomcat8/tomcat-update-policy.sh (code=exited, status=0/SUCCESS)
Main PID: 59582 (java)
Tasks: 34 (limit: 4653)
Memory: 363.9M
CGroup: /system.slice/tomcat8.service
└─59582 /usr/lib/jvm/java-8-openjdk-amd64//bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat8 -Dcatalina.home=/usr/share/tomcat8 -Djava.io.tmpdir=/tmp org.apache.catalina.startup.Bootstrap start
Mar 12 04:58:07 osboxes tomcat8[59582]: 2019-03-12 04:58:07 [localhost-startStop-1] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
Mar 12 04:58:08 osboxes tomcat8[59582]: 2019-03-12 04:58:08 [localhost-startStop-1] INFO o.h.h.i.QueryTranslatorFactoryInitiator - HHH000397: Using ASTQueryTranslatorFactory
Mar 12 04:58:10 osboxes tomcat8[59582]: 2019-03-12 04:58:10 [localhost-startStop-1] INFO o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
Mar 12 04:58:10 osboxes tomcat8[59582]: 2019-03-12 04:58:10 [localhost-startStop-1] INFO fr.thuasne.slb.hds.api.Application - Started Application in 8.473 seconds (JVM running for 12.378)
Mar 12 04:58:10 osboxes tomcat8[59582]: Deployment of web application archive [/var/lib/tomcat8/webapps/slb.war] has finished in [11,978] ms
Mar 12 04:58:10 osboxes tomcat8[59582]: Deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
Mar 12 04:58:11 osboxes tomcat8[59582]: 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.
Mar 12 04:58:11 osboxes tomcat8[59582]: Deployment of web application directory [/var/lib/tomcat8/webapps/ROOT] has finished in [398] ms
Mar 12 04:58:11 osboxes tomcat8[59582]: Starting ProtocolHandler ["http-nio-8080"]
Mar 12 04:58:11 osboxes tomcat8[59582]: Server startup in 12692 ms
和 tomcat 日志文件:
12-Mar-2019 04:57:57.874 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.878 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.878 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.879 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.880 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/server/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.881 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/server], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.881 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/server/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.881 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/server], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.881 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.882 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/var/lib/tomcat8/shared], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.882 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:57.882 WARNING [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [/usr/share/tomcat8/shared], exists: [false], isDirectory: [false], canRead: [false]
12-Mar-2019 04:57:58.451 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.34 (Ubuntu)
12-Mar-2019 04:57:58.453 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 20 2018 08:12:50 UTC
12-Mar-2019 04:57:58.454 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.34.0
12-Mar-2019 04:57:58.455 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
12-Mar-2019 04:57:58.455 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.18.0-10-generic
12-Mar-2019 04:57:58.456 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
12-Mar-2019 04:57:58.457 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
12-Mar-2019 04:57:58.458 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_191-8u191-b12-2ubuntu0.18.10.1-b12
12-Mar-2019 04:57:58.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
12-Mar-2019 04:57:58.461 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /var/lib/tomcat8
12-Mar-2019 04:57:58.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat8
12-Mar-2019 04:57:58.463 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties
12-Mar-2019 04:57:58.465 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Mar-2019 04:57:58.466 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
12-Mar-2019 04:57:58.466 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024m
12-Mar-2019 04:57:58.467 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseConcMarkSweepGC
12-Mar-2019 04:57:58.468 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
12-Mar-2019 04:57:58.469 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
12-Mar-2019 04:57:58.469 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
12-Mar-2019 04:57:58.470 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
12-Mar-2019 04:57:58.471 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/var/lib/tomcat8
12-Mar-2019 04:57:58.471 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat8
12-Mar-2019 04:57:58.473 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/tmp
12-Mar-2019 04:57:58.473 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.17] using APR version [1.6.3].
12-Mar-2019 04:57:58.474 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
12-Mar-2019 04:57:58.475 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
12-Mar-2019 04:57:58.480 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1 11 Sep 2018]
12-Mar-2019 04:57:58.649 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
12-Mar-2019 04:57:58.668 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Mar-2019 04:57:58.683 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 774 ms
12-Mar-2019 04:57:58.938 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
12-Mar-2019 04:57:58.940 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.34 (Ubuntu)
12-Mar-2019 04:57:58.976 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/var/lib/tomcat8/webapps/slb.war]
12-Mar-2019 04:58:01.308 INFO [localhost-startStop-1] 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.
12-Mar-2019 04:58:10.956 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/var/lib/tomcat8/webapps/slb.war] has finished in [11,978] ms
12-Mar-2019 04:58:10.957 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
12-Mar-2019 04:58:11.351 INFO [localhost-startStop-1] 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.
12-Mar-2019 04:58:11.355 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat8/webapps/ROOT] has finished in [398] ms
12-Mar-2019 04:58:11.364 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Mar-2019 04:58:11.376 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 12692 ms
已解决:
对于最后一个问题,我需要使用 http://127.0.0.1:8080/ 而不是本地主机访问 tomcat
感谢您的帮助和时间。
最佳答案
从您的帖子中不清楚到底是什么问题,因为您只发布了部分异常。您发布的日志条目来自 Systemd,其中仅包含部分 Tomcat 日志。查找 Tomcat 日志,默认情况下在 $CATALINA_BASE/logs
中。
如果问题确实是缺少驱动程序,您可以通过将驱动程序复制到 $CATALINA_BASE/lib
目录来确认 - 重新启动 Tomcat 以使更改生效。
如果确实是这种情况,并且您想使用您的应用程序部署 PG-JDBC jar,那么使用 Maven 可以通过不同的方式来实现,例如maven-dependency-plugin , 或将其添加到资源目录并使用 Maven maven-resources-plugin .
关于java - 将 Maven 项目部署到 Tomcat 无法连接到 Postgres,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55105477/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!