Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Netbean 6.8 to create a Servlet app that queries a database

 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Netbean 6.8 to create a Servlet app that queries a database but fails with a

HTTP Status 404
The requested resource (/TechOpsTools/) is not available.

The code that I'm using is



I also attached the xml files that I'm using for the tomcat setup (I'm using Tomcat 6.0.20 that came with netbeans 6.8)




also the server.xml file



Please help me.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emmanuel Constant wrote:Using Netbean 6.8 to create a Servlet app that queries a database but fails with a

HTTP Status 404
The requested resource (/TechOpsTools/) is not available.


You didn't mention URL you are trying to access. Look at http://faq.javaranch.com/java/TellTheDetails
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THE url is http://localhost:8089/TechOpsTools/
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also this is what I get in the log when I start and restart:

Using CATALINA_BASE: C:\Documents and Settings\econsta\.netbeans\6.8\apache-tomcat-6.0.20_base
Using CATALINA_HOME: C:\Program Files\NetBeans 6.8\Apache Software Foundation\Apache Tomcat 6.0.20
Using CATALINA_TMPDIR: C:\Documents and Settings\econsta\.netbeans\6.8\apache-tomcat-6.0.20_base\temp
Using JRE_HOME: C:\Program Files\Java\jdk1.6.0_18
Apr 26, 2010 9:35:35 AM org.apache.catalina.core.AprLifecycleListener init
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.6.0_18\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_18\bin;.C:\OracleClient\product\11.1.0\client_2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5\;C:\Program Files\Admin Tools\;C:\Program Files\Sybase\Sybase Central\win32\;C:\Sybase\dll\;C:\Sybase\asep\;C:\Sybase\bin\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia AUX;C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia AUX/Support binaries;C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia Broker;C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia Client;C:\Program Files\IDM Computer Solutions\UltraEdit-32;C:\Program Files\QuickTime\QTSystem\;c:\python25\;C:\Program Files\IDM Computer Solutions\UltraCompare
Apr 26, 2010 9:35:36 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8089
Apr 26, 2010 9:35:36 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2883 ms
Apr 26, 2010 9:35:36 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 26, 2010 9:35:36 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Apr 26, 2010 9:35:38 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8089
Apr 26, 2010 9:35:39 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 26, 2010 9:35:39 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63 config=null
Apr 26, 2010 9:35:39 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2943 ms
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emmanuel Constant wrote:THE url is http://localhost:8089/TechOpsTools/


Why do you think your application would respond to this URL? What did you do for that?
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the port from being 8080 to 8089.

The TechOpsTools is the name a the war file when I deploy.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the log files once more time, perhaps there were an issues with deployment. The log file you have provided has no information about TechOpsTools.war deployment.
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I get when I do a clean and rebuild:



This is what I get when I deploy:



 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the context path in context.xml
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it to work cuz I was using the wrong url.

I'm using this URL now:

http://localhost:8089/TechOpsTools/SearchServlet?dsp=VEV&catKey=G010001916075F

but I get this error for the log4j:

log4j:WARN No appenders could be found for logger (com.techops.tools.SearchServlet).
log4j:WARN Please initialize the log4j system properly.
 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my log4j properties file is in the source directory under the package com.techops.tools and it looks like this:

 
Emmanuel Constant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok I got the server running but i get this error





can I get some assistance
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This means that you are missing a driver ocijdbc11.dll in the Java library path. In general it would be better to use Oracle thin driver instead of the oci driver
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic