Chetan Dodiya

Ranch Hand
+ Follow
since Jun 27, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chetan Dodiya

anyone knows this???
please do reply.....

Hurray!!! now its working thanks alot Vijitha
15 years ago
i changed my web.xml file to



and I am starting my tomcat with http://localhost:8080
tomcat starts successfully shows its index page accurately....

when i startup my tomcat through command prompt it displays like...

Jan 7, 2009 2:09:55 PM org.apache.catalina.core.AprLifecycleListener lifecycleEv
ent
INFO: The Apache Tomcat Native library which allows optimal performance in produ
ction environments was not found on the java.library.path: D:\Java\jdk1.5.0_06\b
in;.;D:\WINDOWS\system32;D:\WINDOWS;D:\Java\jdk1.5.0_06\bin;D:\Java\JSDK2.0\bin
Jan 7, 2009 2:09:55 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 7, 2009 2:09:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2172 ms
Jan 7, 2009 2:09:56 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 7, 2009 2:09:56 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Jan 7, 2009 2:09:56 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 7, 2009 2:09:59 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 7, 2009 2:10:00 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 7, 2009 2:10:00 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/484 config=null
Jan 7, 2009 2:10:00 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jan 7, 2009 2:10:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5281 ms



and in book it sugests that start as http://localhost/ch1/Serv1 and when i hit enter it shows


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class ch1Servlet
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)
root cause

java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class ch1Servlet with modifiers ""
sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
java.lang.Class.newInstance0(Class.java:344)
java.lang.Class.newInstance(Class.java:303)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
15 years ago
this the output of prompt which shows the many errors when i startup Tomcat..

Jan 7, 2009 1:44:52 PM org.apache.catalina.core.AprLifecycleListener lifecyc
ent
INFO: The Apache Tomcat Native library which allows optimal performance in p
ction environments was not found on the java.library.path: D:\Java\jdk1.5.0_
in;.;D:\WINDOWS\system32;D:\WINDOWS;D:\Java\jdk1.5.0_06\bin;D:\Java\JSDK2.0\
Jan 7, 2009 1:44:52 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 7, 2009 1:44:53 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2313 ms
Jan 7, 2009 1:44:53 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 7, 2009 1:44:53 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Jan 7, 2009 1:44:53 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 7, 2009 1:44:55 PM org.apache.catalina.startup.ContextConfig application
onfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/ch1/WEB-I
eb.xml
java.io.UnsupportedEncodingException: ISO-8851-1
at sun.io.Converters.getConverterClass(Converters.java:218)
at sun.io.Converters.newConverter(Converters.java:251)
at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:22
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:21
at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:
at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.createRe
(XMLEntityManager.java:2012)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$ScannedE
y.setReader(XMLEntityManager.java:2455)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.setEncod
XMLEntityScanner.java:188)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScanne
l.scanXMLDeclOrTextDecl(XMLDocumentFragmentScannerImpl.java:734)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$XM
lDispatcher.dispatch(XMLDocumentScannerImpl.java:721)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScanne
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.par
ML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.par
ML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLPar
java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.pars
stractSAXParser.java:1242)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(Co
tConfig.java:348)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.jav
48)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextC
g.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Life
eSupport.java:120)
at org.apache.catalina.core.StandardContext.start(StandardContext.ja
148)
at org.apache.catalina.core.ContainerBase.addChildInternal(Container
.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.jav
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig
a:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConf
ava:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Life
eSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1

at org.apache.catalina.core.StandardHost.start(StandardHost.java:736
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java
)
at org.apache.catalina.core.StandardService.start(StandardService.ja
48)
at org.apache.catalina.core.StandardServer.start(StandardServer.java
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Jan 7, 2009 1:44:56 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
Jan 7, 2009 1:44:56 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Jan 7, 2009 1:44:56 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/ch1] startup failed due to previous errors
Jan 7, 2009 1:44:57 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 7, 2009 1:44:58 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 7, 2009 1:45:01 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/3016 config=null
Jan 7, 2009 1:45:01 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jan 7, 2009 1:45:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8859 ms
15 years ago
Yes...
I am done the same thing as you suggested.....

starting with

<web-app 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/web-app_2_4.xsd"
version="2.4">



and ends with

</web-app>

but I am still facing the same problem...

15 years ago
yes....
I am able to access indiex page correctly...
I am accessing index page using http://localhost:8080
and i forget to tell you that my servlet-api.jar file is in the

tomcat/common/lib folder
and I am new to servlet so I am following as per the suggested in the book...
you can suggest me where should I put my files....
and one more thing....
when I starts tomcat through command prompt, tomcat starts with lots of error in the

command prompt stating that errors in the ch1 folder which is in the tomcat/webapps folder...
15 years ago
my ch1Servlet file is below and its .class file is in the tomcat/webapps/ch1/WEB-INF/classes folder...

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

class ch1Servlet extends HttpServlet{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException{
PrintWriter out=response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+
"<body>"+
"<h1 align=center>HF\'s Chapter1 Servlet</h1>"+
+ today +"</body>"+"</html>");
}
}

and its .xml file is below and it is in the tomcat/webapps/ch1/WEB-INF folder...

<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-apps 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/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>ch1Servlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-apps>



and my tomcat starts perfectly......
15 years ago
hi...
I am new to servlet....
when I am try to run servlet in my browser it gives error HTTP status 404

my setting is:

path=D:\Java\jdk1.5.0_06\bin;D:\Java\JSDK2.0\bin
classpath=D:\Java\jdk1.5.0_06\lib\tools.jar;D:\Java\JSDK2.0\lib\jsdk.jar
java_home=D:\Java\jdk1.5.0_06
tomcat_home=D:\Java\tomcat


and the problem I am trying to run is given in HF S&J pg. no.- 30...
I done as per stated in the book but while I am trying to run the servlet it gives the same problem again again...
my web.xml and ch1Servlet are correct....
please help me to sortout this problem....
15 years ago
this q is from ExamLab



OUTPUT IS
AGAADGBDAF

why in this program wrapper Byte is widen to Number
because Wrapper type cant widen...
so why this program works fine???
hey thanks...
i was little bit confused between volatile and transient modifier while doing practice....
No one knows the answer of this Question???
thanks for the explanation...
This q is from ExamLab


why the output is"45true+321"
because second argument is not of boolean type???
thank you very much....
[ November 14, 2008: Message edited by: Chetan dodiya ]
if



at line 1 2 & 3 which methods are called means Dog's class And Animal's class???