Atul Kumar Verma
Atul Kumar Verma

Reputation: 369

Unable to run WebApplication in Netbeans

I am using NetBeans 8.0.1 in Ubuntu 14.04, I have following setup. I have installed tomcat7 from apt-get and able to run simple servlet by manually creating servlet files, putting them /webapps folder.

Now I want to create a WebApplication in netbeans, so I added tomcat7 as server in netbeans and created an Hello world project with default template that netbeans provides.Now when I run that, I get following Errors. I used /usr/share/tomcat7 as my Catalina home, and Catalina base. however I also tried /etc/tomcat7 as my Catalina base but then it was giving errors like base folder should be emplty or contain conf/tomcat-users.xml only.

the build error is:

The module has not been deployed. See the server log for details.

Now I checked server log,it is empty. my server output file looks like this:

Nov 28, 2014 5:17:33 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Nov 28, 2014 5:17:33 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]

Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp
Nov 28, 2014 5:17:34 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 705 ms
Nov 28, 2014 5:17:34 PM org.apache.catalina.users.MemoryUserDatabase open
SEVERE: The specified user database [/usr/share/tomcat7/conf/tomcat-users.xml] could not be found
Nov 28, 2014 5:17:34 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 28, 2014 5:17:34 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Nov 28, 2014 5:17:34 PM org.apache.catalina.valves.AccessLogValve getLogFile
SEVERE: Failed to create directory [/usr/share/tomcat7/logs] for access logs
Nov 28, 2014 5:17:34 PM org.apache.catalina.valves.AccessLogValve getLogFile
SEVERE: Failed to create directory [/usr/share/tomcat7/logs] for access logs
Nov 28, 2014 5:17:34 PM org.apache.catalina.valves.AccessLogValve open
SEVERE: Failed to open access log file [/usr/share/tomcat7/logs/localhost_access_log.2014-11-28.txt]
java.io.FileNotFoundException: /usr/share/tomcat7/logs/localhost_access_log.2014-11-28.txt (No such file or directory)
    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:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    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:745)

Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.HostConfig start
SEVERE: Unable to create directory for deployment: /usr/share/tomcat7/webapps
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.HostConfig start
SEVERE: Unable to create directory for deployment: /usr/share/tomcat7/conf/Catalina/localhost
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.HostConfig start
SEVERE: Application base [/usr/share/tomcat7/webapps] for host [localhost] does not exist or is not a directory. deployOnStartUp and autoDeploy have been set to false to prevent deployment errors. Other errors may still occur.
Nov 28, 2014 5:17:34 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 28, 2014 5:17:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 67 ms

While creating server I used following:

Can Anyone help me getting started with this?

Upvotes: 0

Views: 932

Answers (1)

Kamiel
Kamiel

Reputation: 1225

Try to make a symbolic link to tomcat log folder:

sudo ln -s /var/log/tomcat7

and change its access too:

sudo chmod -Rf 777 /var/log/tomcat7

Hope it can help!

Upvotes: 1

Related Questions