• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

trying to run my first project

 
Ranch Hand
Posts: 68
MyEclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

This is my first web project and first post in this forum.
I am using MyEclipse 6 for my programs.

I opened a new project and tried to run it.
But the tomcat server of MyEclipse was not able to find a library.


This thing i always sees in the console..


12-Feb-2011 20:56:48 org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\MyEclipse 6.0\bin;C:\Program Files\MyEclipse 6.0\myeclipse\eclipse\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_6.0.0.zmyeclipse60020070820\tomcat\bin
12-Feb-2011 20:56:50 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
12-Feb-2011 20:56:50 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3351 ms
12-Feb-2011 20:56:50 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
12-Feb-2011 20:56:50 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
12-Feb-2011 20:56:52 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
12-Feb-2011 20:56:52 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
12-Feb-2011 20:56:52 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/125 config=null
12-Feb-2011 20:56:53 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2840 ms

I thing the problem is with this bold line....

And now i have 1 index.JSP file and 1 Web.xml which was automatically produced by MyEclipse 6.
so,i don't think that there would be a problem with these files..

I wrote this line on the browser...

http://localhost:8080/HelloWorld

i have also run this project on another system but on that it was running fine.

I don't know what to do.
please help!!

Thank you,

Sumit
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using Eclipse? Are you following some book that instructs you to do that?
I am not using any IDE and I am following the Head First book.
 
Sumit Khurana
Ranch Hand
Posts: 68
MyEclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No Darren,My friend suggested me to start with the Eclipse...
n I have just started to read the Head First Servlet and Jsp.

i am confused about how to run the programs of servlet and JSP through Tomcat directly thats why i am using eclipse...
 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Sumit!

Head First tries to encourage you to start developing applications directly using tomcat instead of Eclipse or any other IDE. The reason is the same as with the SCJP - sometimes the IDE does something for you without even bothering telling you about it. It might be frustrating for the newcomers, as well as when you need to type something by yourself you're remembering it better.

I doubt the warning shown by you is the reason of your problem.

Could you please prepare the structure of your web application (you know - main directory, WEB-INF directory, web.xml in it etc.) along with your files in the directories and show it to us?

After this, we can together try -- step by step -- solve your problem :-)

Cheers!
 
Sumit Khurana
Ranch Hand
Posts: 68
MyEclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy! pedro,

thanks for reading n replying to my post,

Main structure of my web app is:


Helloworld
@@|
@@|-Webroot
@@@@|
@@@@|-META-INF
@@@@| @@ |-MANIFEST.MF
@@@@|
@@@@|-WEB-INF
@@@@|@@ |-lib(folder)
@@@@|@@ |-Web.xml
@@@@|
@@@@|-index.jsp


The content of index.jsp is:


<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>

<body>
This is my first ever JSP page. <br>
<p>This design is basically nothing</p>
</body>
</html>

The content of web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

n there is nothing in the lib folder..and this is my small helloworld web app
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Sumit, so:
- is your web.xml file called web.xml or with capitalized W like on your diagram (Web.xml)?
- What is the result of starting the server with so defined application? 404 Error, cannot load page, ...?

You can try to prepare this application all by yourself (which is preferred for SCWCD candidates), by creating a simplified web application structure:


HelloWorld
|-- WEB-INF
| `-- web.xml
`-- index.jsp



That's all you need for this simple application.

Now put the code you posted into the index.jsp and web.xml files (or just copy the ones you already have).

I guess you have a Apache Tomcat installed already (what version?) if so, than copy this whole HelloWorld directory (application) into the TOMCAT_HOME/webapps/ directory and execute TOMCAT_HOME/bin/startup.sh.

You can also take a look at tomcat logs at TOMCAT_HOME/logs/catalina.out if it shows something gone wrong. After this - try opening:
http://localhost:8080/HelloWorld in your browser and tell us what you'll see.

PS. You need to be sure that no other Tomcat instance is running on the specified port. You can do that using netstat command if you're on Linux or i.e. windows system manager to see what processes are currently running. You can also test it by going to http://localhost:8080 and seeing if it will show 'cannot establish connection' type of error (Tomcat is off) or 404 Tomcat-style layout (tomcat is on).
PS2. You can use the "code" tag for the code you show, as it will increase the readability of your post

Cheers!
 
Sumit Khurana
Ranch Hand
Posts: 68
MyEclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks pedro for helping me and giving your precious time

Now,I have understood completely!!
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem Rancher. Hope it worked.

Cheers!
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic