NetBeans Tomcat构建失败 - 尚未部署该模块

时间:2014-11-24 22:47:29

标签: java apache tomcat netbeans

我正在使用NetBeans 8.0并使用Apache Tomcat 7.0.56来构建Web应用程序。

我正在尝试运行一个简单的HTML文件groceryPage.html并继续收到以下错误:

  

C:\ Users \ HP \ Documents \ CS3160_Lab3 \ build \ web上的就地部署   部署正在进行中......   部署配置=文件%3A%2FC%3A%2FUsers%2FHP%2FAppData%2FLocal%2FTemp%2Fcontext8713751033956149596.xml&安培;路径= / CS3160_Lab3   失败 - 无法创建目录[C:\ Program   文件\的Java \ Apache的Tomcat的7.0.56 \的conf \卡塔利娜\本地主机]   C:\ Users \ HP \ Documents \ CS3160_Lab3 \ nbproject \ build-impl.xml:1045:   模块尚未部署。有关详细信息,请参阅服建立   失败(总时间:1秒)

我是使用Tomcat和NetBeans的新手,所以我真的不知道它为什么不能成功构建和运行我的应用程序

任何帮助都将不胜感激。

修改

这是服务器日志,如果有帮助的话:

Using CATALINA_BASE:   "C:\Program Files\Java\apache-tomcat-7.0.56"
Using CATALINA_HOME:   "C:\Program Files\Java\apache-tomcat-7.0.56"
Using CATALINA_TMPDIR: "C:\Program Files\Java\apache-tomcat-7.0.56\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.7.0_40"
Using CLASSPATH:       "C:\Program Files\Java\apache-tomcat-7.0.56\bin\bootstrap.jar;C:\Program Files\Java\apache-tomcat-7.0.56\bin\tomcat-juli.jar"
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Java\apache-tomcat-7.0.56\logs\catalina.2014-11-24.log (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at org.apache.juli.FileHandler.openWriter(FileHandler.java:386)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:97)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:558)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:501)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:311)
    at java.util.logging.LogManager$2.run(LogManager.java:294)
    at java.util.logging.LogManager$2.run(LogManager.java:292)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
    at java.util.logging.LogManager.getLogManager(LogManager.java:274)
    at java.util.logging.Logger.<init>(Logger.java:264)
    at java.util.logging.Logger.<init>(Logger.java:260)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
    at java.util.logging.LogManager$1.run(LogManager.java:196)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(LogManager.java:173)
    at java.util.logging.Logger.demandLogger(Logger.java:336)
    at java.util.logging.Logger.getLogger(Logger.java:390)
    at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:169)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:241)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:292)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:59)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Java\apache-tomcat-7.0.56\logs\localhost.2014-11-24.log (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at org.apache.juli.FileHandler.openWriter(FileHandler.java:386)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:97)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:558)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:501)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:311)
    at java.util.logging.LogManager$2.run(LogManager.java:294)
    at java.util.logging.LogManager$2.run(LogManager.java:292)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
    at java.util.logging.LogManager.getLogManager(LogManager.java:274)
    at java.util.logging.Logger.<init>(Logger.java:264)
    at java.util.logging.Logger.<init>(Logger.java:260)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
    at java.util.logging.LogManager$1.run(LogManager.java:196)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(LogManager.java:173)
    at java.util.logging.Logger.demandLogger(Logger.java:336)
    at java.util.logging.Logger.getLogger(Logger.java:390)
    at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:169)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:241)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:292)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:59)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Java\apache-tomcat-7.0.56\logs\manager.2014-11-24.log (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at org.apache.juli.FileHandler.openWriter(FileHandler.java:386)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:97)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:558)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:501)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:311)
    at java.util.logging.LogManager$2.run(LogManager.java:294)
    at java.util.logging.LogManager$2.run(LogManager.java:292)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
    at java.util.logging.LogManager.getLogManager(LogManager.java:274)
    at java.util.logging.Logger.<init>(Logger.java:264)
    at java.util.logging.Logger.<init>(Logger.java:260)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
    at java.util.logging.LogManager$1.run(LogManager.java:196)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(LogManager.java:173)
    at java.util.logging.Logger.demandLogger(Logger.java:336)
    at java.util.logging.Logger.getLogger(Logger.java:390)
    at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:169)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:241)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:292)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:59)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Java\apache-tomcat-7.0.56\logs\host-manager.2014-11-24.log (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at org.apache.juli.FileHandler.openWriter(FileHandler.java:386)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:97)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:558)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:501)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:311)
    at java.util.logging.LogManager$2.run(LogManager.java:294)
    at java.util.logging.LogManager$2.run(LogManager.java:292)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
    at java.util.logging.LogManager.getLogManager(LogManager.java:274)
    at java.util.logging.Logger.<init>(Logger.java:264)
    at java.util.logging.Logger.<init>(Logger.java:260)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
    at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
    at java.util.logging.LogManager$1.run(LogManager.java:196)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(LogManager.java:173)
    at java.util.logging.Logger.demandLogger(Logger.java:336)
    at java.util.logging.Logger.getLogger(Logger.java:390)
    at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:169)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:241)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:292)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:59)
Nov 24, 2014 11:34:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.4.8.
Nov 24, 2014 11:34:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Nov 24, 2014 11:34:25 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1h 5 Jun 2014)
Nov 24, 2014 11:34:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Nov 24, 2014 11:34:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Nov 24, 2014 11:34:25 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2194 ms
Nov 24, 2014 11:34:25 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 24, 2014 11:34:25 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.56
Nov 24, 2014 11:34:25 PM org.apache.catalina.valves.AccessLogValve open
SEVERE: Failed to open access log file [C:\Program Files\Java\apache-tomcat-7.0.56\logs\localhost_access_log.2014-11-24.txt]
java.io.FileNotFoundException: C:\Program Files\Java\apache-tomcat-7.0.56\logs\localhost_access_log.2014-11-24.txt (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:1200)
    at org.apache.catalina.valves.AccessLogValve.startInternal(AccessLogValve.java:1261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:185)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1137)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    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:724)

Nov 24, 2014 11:34:25 PM org.apache.catalina.startup.HostConfig start
SEVERE: Unable to create directory for deployment: C:\Program Files\Java\apache-tomcat-7.0.56\conf\Catalina\localhost
Nov 24, 2014 11:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\docs
Nov 24, 2014 11:34:25 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\docs] for context [/docs]
Nov 24, 2014 11:34:26 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\docs is unusable.
Nov 24, 2014 11:34:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\docs has finished in 773 ms
Nov 24, 2014 11:34:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\examples
Nov 24, 2014 11:34:26 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\examples] for context [/examples]
Nov 24, 2014 11:34:27 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\examples is unusable.
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\examples has finished in 707 ms
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\host-manager
Nov 24, 2014 11:34:27 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\host-manager] for context [/host-manager]
Nov 24, 2014 11:34:27 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\host-manager is unusable.
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\host-manager has finished in 113 ms
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\manager
Nov 24, 2014 11:34:27 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\manager] for context [/manager]
Nov 24, 2014 11:34:27 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\manager is unusable.
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\manager has finished in 104 ms
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\ROOT
Nov 24, 2014 11:34:27 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\_] for context []
Nov 24, 2014 11:34:27 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Java\apache-tomcat-7.0.56\work\Catalina\localhost\_ is unusable.
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Java\apache-tomcat-7.0.56\webapps\ROOT has finished in 109 ms
Nov 24, 2014 11:34:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Nov 24, 2014 11:34:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Nov 24, 2014 11:34:27 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1926 ms

7 个答案:

答案 0 :(得分:1)

它清楚地说,Access is denied

确保运行Tomcat的用户可以写入目录和文件C:\Program Files\Java\apache-tomcat-7.0.56\logs\catalina.2014-11-24.log

答案 1 :(得分:1)

由于您的proxy设置,可能会出现此问题。如果您在计算机上设置了手动proxy,请确保netbeans也使用相同 代理设置进行设置。(工具&gt;选项&gt;代理设置)

答案 2 :(得分:1)

如果您在Windows计算机上运行,​​请确保右键单击菜单选项以启动Netbeans并选择“以管理员身份运行”。这应该可以解决您的访问问题。

答案 3 :(得分:0)

您可以尝试搜索我的溶剂here。 基本上只是给glassfish文件夹写入权限并重启你的电脑,可选择恢复web.xml文件中的更改

答案 4 :(得分:0)

更改Tomcat目录的所有者。在Linux或BSD上执行此操作:

chown -R username /usr/local/apache-tomcat-8.0 /

*检查发行版中的Tomcat是哪个目录。

答案 5 :(得分:0)

我解决了这个问题,因此从apache安装路径更改了文件夹的属性。 1.右键单击apache tomcat中的文件夹 2.选择属性 3.在选项卡中完全控制将要发布战争或使用NetBeans进行开发的所有用户或我的用户。

答案 6 :(得分:0)

我通过仔细阅读“ Apache Tomcat服务器日志”解决了类似的错误。 您的IDE应该能够为您干净地显示它。 它教我在寻找罪魁祸首时总是先阅读日志。

对我来说,它是同时使用@WebServlet批注和 web.xml 部署描述符针对同一Servlet进行部署的。但是我必须选择两个选项之一。

无论您遇到什么情况,始终不要害怕阅读服务器日志。这就是所有线索所在的地方。