无法在 Netbeans 中的 Tomcat 服务器上部署 webapp
Unable to deploy webapp on Tomcat server in Netbeans
server.xml
<Connector URIEncoding="utf-8" connectionTimeout="20000" port="8084" protocol="HTTP/1.1"
redirectPort="8443"/>
每当我尝试 运行 我的项目时,它会将其重定向到我的局域网 IP 地址,导致部署失败。请看下面。
服务器日志
The system cannot find the file specified.
The system cannot find the file specified.
Using CATALINA_BASE: "C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15"
Using CATALINA_TMPDIR: "C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_45"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\bin\tomcat-juli.jar"
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 2 2014 19:25:20 UTC
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.15.0
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: C:\Program Files\Java\jdk1.8.0_45\jre
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_45-b15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\xxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.proxyHost=internet.xxx.xxx
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.proxyPort=80
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.nonProxyHosts=<local>
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttps.proxyHost=internet.xxxx.xxx
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttps.proxyPort=80
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\endorsed
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\xxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\temp
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\oraclexe\app\oracle\product.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program FilesE\NomadBranch\;C:\Program Files\Dell\Dell Data Protection\Encryption\;.
Jun 22, 2015 9:49:11 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-127.0.0.1-8084"]
Jun 22, 2015 9:49:11 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 22, 2015 9:49:11 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Jun 22, 2015 9:49:11 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 847 ms
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\xxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\manager.xml
Jun 22, 2015 9:49:12 AM org.apache.jasper.servlet.TldScanner scanJars
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.
Jun 22, 2015 9:49:12 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [203] milliseconds.
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\xxxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\manager.xml has finished in 702 ms
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\xxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\ROOT.xml
Jun 22, 2015 9:49:12 AM org.apache.jasper.servlet.TldScanner scanJars
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.
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\xxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\ROOT.xml has finished in 157 ms
Jun 22, 2015 9:49:12 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-127.0.0.1-8084"]
Jun 22, 2015 9:49:12 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 934 ms
出现此问题是因为我在无法访问的代理后面。要解决此问题,我们需要删除代理设置。要解决此问题,
Tools --> Options --> General
Select 没有代理,如果你不想使用。
禁用 Netbeans 中的代理设置并重新启动 Tomcat。
转到工具 --> 选项 --> 在常规下,select No Proxy
--> 应用 --> 确定。
server.xml
<Connector URIEncoding="utf-8" connectionTimeout="20000" port="8084" protocol="HTTP/1.1"
redirectPort="8443"/>
每当我尝试 运行 我的项目时,它会将其重定向到我的局域网 IP 地址,导致部署失败。请看下面。
服务器日志
The system cannot find the file specified.
The system cannot find the file specified.
Using CATALINA_BASE: "C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15"
Using CATALINA_TMPDIR: "C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_45"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\bin\tomcat-juli.jar"
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 2 2014 19:25:20 UTC
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.15.0
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: C:\Program Files\Java\jdk1.8.0_45\jre
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_45-b15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\xxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.proxyHost=internet.xxx.xxx
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.proxyPort=80
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttp.nonProxyHosts=<local>
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttps.proxyHost=internet.xxxx.xxx
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dhttps.proxyPort=80
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\endorsed
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\xxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=C:\Users\xxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\temp
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\oraclexe\app\oracle\product.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program FilesE\NomadBranch\;C:\Program Files\Dell\Dell Data Protection\Encryption\;.
Jun 22, 2015 9:49:11 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-127.0.0.1-8084"]
Jun 22, 2015 9:49:11 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 22, 2015 9:49:11 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Jun 22, 2015 9:49:11 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 847 ms
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 22, 2015 9:49:11 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.15
Jun 22, 2015 9:49:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\xxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\manager.xml
Jun 22, 2015 9:49:12 AM org.apache.jasper.servlet.TldScanner scanJars
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.
Jun 22, 2015 9:49:12 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [203] milliseconds.
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\xxxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\manager.xml has finished in 702 ms
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\xxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\ROOT.xml
Jun 22, 2015 9:49:12 AM org.apache.jasper.servlet.TldScanner scanJars
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.
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\xxxxxxxxxxx\AppData\Roaming\NetBeans.0.2\apache-tomcat-8.0.15.0_base\conf\Catalina\localhost\ROOT.xml has finished in 157 ms
Jun 22, 2015 9:49:12 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-127.0.0.1-8084"]
Jun 22, 2015 9:49:12 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jun 22, 2015 9:49:12 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 934 ms
出现此问题是因为我在无法访问的代理后面。要解决此问题,我们需要删除代理设置。要解决此问题,
Tools --> Options --> General
Select 没有代理,如果你不想使用。
禁用 Netbeans 中的代理设置并重新启动 Tomcat。
转到工具 --> 选项 --> 在常规下,select No Proxy
--> 应用 --> 确定。