Simple servlet shoed error in tomcat server sql error
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class submit extends HttpServlet
//Connection con;
public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
String str1,str2;
str1=req.getParameter("emailid");
str2=req.getParameter("comment");
System.out.println(str1);
System.out.println(str2);
res.setContentType("text/html");
PrintWriter out=res.getWriter();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//connection object created using DriverManager class
//addtodatabase is the name of the database
Connection connect =DriverManager.getConnection("jdbc:odbc:booksrc");
//creating prepared statement object pstm so that query can be sent to database
PreparedStatement pstm=connect.prepareStatement("insert into gbook(emailid, comment) values(?,?)");
pstm.setString(1,str1);
pstm.setString(2,str2);
//execute method to execute the query
pstm.executeUpdate();
out.println("<html><h2>Guest Book is Successfully Updated</h2></html>");
//closing the prepared statement and connection object
pstm.close();
connect.close();
catch(SQLException sqe)
System.out.println("SQl error");
catch(ClassNotFoundException cnf)
System.out.println("Class not found error");
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException,IOException{
doGet(req,res);
}
How about a little effort and initiative on your part? Did you try Google[1]?
[1] http://www.google.com/search?q=%5BMicrosoft%5D%5Bodbc+manager%5Ddata+source+name+not+found+and+no+default+driver+specified
P.S. You've not specified your DB and I'm pretty sure you've not setup a system DSN
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
----------------------------------------------------------------
Similar Messages
-
Problem getting simple servlet to run in tomcat
i am trying to get a servlet to run that is explained in wrox Professional JSP second edition. i am using tomcat as the book explains.
1. i have created the ch03/WEB-INF/classes directory within the webapps folder in tomcat.
2. in the classes folder i created the directory
com/wrox/projsp/ch03/myfirstwebapp.
3. in the folder myfirstwebapp i have the compiled file
MyFirstServlet.class
4. i made sure the code is exactly as in the book.
5. it states that if i go to
http://localhost:8080/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet i should get the correct output.
6. the only way i can get this to work is if i create a web.xml
file and point it to
com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet and then in the
browser i type in
http://localhost:8080/ch03/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet thus leaving out /servlet in the URL
7. this seems fine but i would like to get it to work how the book shows which is without having to use the web.xml. am i missing something? do i need to set up anything (eg. a context tag for this app)within the server.xml.
any help would greatly be appreciated,
gary bushekI don't know how the book you're using instructed you to setup the server but my web.xml simply has the following in it:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
</web-app>
I'm using tomact 3.2 and am able to run my servlets using
http://localhost/servlet/package_name.servletName
you might want to checkout www.coreservlets.com for more help on setting up tomcat. -
Hi i am new to JAVA..
To practice JDBC concepts i have installed ORACLE 9i in my machine..
later to practice on Servlets i have installed TOMCAT server 5.0 ...
But the problem is with ORACLE 9i only oracle Http Server was installed in my machine..So after installing Apache tomcat server...when i run http://localhost:8080...
I am getting Oracle Http server....
Now there are two servers running on my machine one that came with the ORACLE 9i and one that i installed with apache....
How to disable the Apache tomcat server that has got installed in my machine...??????
please help me out from this..........If you need to know how to do this then I believe that you should edit the server.xml file in tomcat\conf. The part you are looking for is the http connector tag.
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 --> -
Getting error message in tomcat server
Have a look at the following programs:
AuthenticationFilter_
import javax.servlet.*;
import java.io.*;
import java.sql.*;
public class AuthenticationFilter implements Filter
ServletContext sc;
Connection con;
public void init(FilterConfig f) throws ServletException
System.out.println(f.getFilterName() + "Filter Initialized");
String d = f.getInitParameter("driver");
String url = f.getInitParameter("url");
String user = f.getInitParameter("user");
String pwd = f.getInitParameter("password");
try
Class.forName(d);
con = DriverManager.getConnection(url,user,pwd);
System.out.println("Connection Established");
catch (Exception e)
e.printStackTrace();
sc = f.getServletContext();
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain)throws ServletException,IOException
Statement st = null;
ResultSet rs = null;
String user = request.getParameter("user");
String pwd = request.getParameter("password");
try
st = con.createStatement();
String sql = "SELECT * FROM OURUSERS WHERE usr = " + user + " and password = " + pwd + " ";
rs = st.executeQuery(sql);
if(rs.next())
chain.doFilter(request,response);
else
sc.getRequestDispatcher("/error.html").forward(request,response);
catch (Exception e)
e.printStackTrace();
finally
try
if(rs!=null)
rs.close();
if(st!=null)
st.close();
catch (Exception e)
e.printStackTrace();
}//doFilter()
public void destroy()
try
if(con!=null)
con.close();
catch (Exception e)
e.printStackTrace();
*2)_HitCounterFilter__
import javax.servlet.*;
import java.io.*;
public class HitCounterFilter implements Filter
ServletContext sc;
int count;
public void init(FilterConfig f)throws ServletException
System.out.println(f.getFilterName() + "Filter Initialized");
sc = f.getServletContext();
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain)throws ServletException,IOException
chain.doFilter(request,response);
count++;
sc.log("Number of times request came to LoginServlet is " + count);
public void destroy()
*3) LoginServlet*
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class LoginServlet extends HttpServlet
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<HTML> <BODY BGCOLOR=yellow>");
pw.println("<H1> WELCOME TO OUR WEBSITE</H1>");
pw.println("</BODY>");
pw.println("</HTML>");
pw.close();
web.xml
<web-app>
<filter>
<filter-name>authenticate</filter-name>
<filter-class>AuthenticationFilter</filter-class>
<init-param>
<param-name>driver</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
<init-param>
<param-name>url</param-name>
<param-value>jdbc:oracle:thin:@localhost:1521:orcl</param-value>
</init-param>
<init-param>
<param-name>user</param-name>
<param-value>scott</param-value>
</init-param>
<init-param>
<param-name>password</param-name>
<param-value>tiger</param-value>
</init-param>
</filter>
<filter>
<filter-name>hitcount</filter-name>
<filter-class>HitCounterFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>authenticate</filter-name>
<url-pattern>/nit</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/nit</url-pattern>
</servlet-mapping>
</web-app>
Error_
java.sql.SQLException: ORA-00904: "SANDY": invalid identifier
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
677)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:2371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2660)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
777)
at AuthenticationFilter.doFilter(AuthenticationFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
at java.lang.Thread.run(Thread.java:619)
The above error message i am getting in Tomcat server,i am having Oracle 11g V1..My SQL prompt is open and i have a table named "ourusers"...Can anyone kindly gimme the solution for this problem+*
Edited by: sandy on Nov 9, 2010 8:59 AMjava.sql.SQLException: ORA-00904: "SANDY": invalid identifier
Looks like the sql you are submitting is invalid.
Print out a copy of the sql you are trying to run and you will probably get:
SELECT * FROM OURUSERS WHERE usr = Sandy and password = secretThat isn't valid sql. It is missing quotes around the values you are checking.
This is the corrected sql query:
SELECT * FROM OURUSERS WHERE usr = 'Sandy' and password = 'secret'so one solution would be:
String sql = "SELECT * FROM OURUSERS WHERE usr = '" + user + "' and password = '" + pwd + "' ";However that is not optimal. It exposes your code to sql injection attack.
The better way is to use a prepared statement:
String sql = "SELECT * FROM OURUSERS WHERE usr = ? and password =?";
st = con.prepareStatement(sql);
st.setString(1, user);
st.setString(2, password);
rs = st.executeQuery();cheers,
evnafets -
Problem running simple servlet on tomcat 4.0
hi,
i have setup tomcat4.0 on the server and i am trying to run a simple servlet but it is not working. here is what i have done:
1. setting the CATALINA_HOME variable to the directory where tomcat is installed
2. setting the classpath variable to servlet.jar
3. i am putting the .class fille in tomcat-home-directory/webapps/ROOTS/WEB-INF/classes
4. i am giving the url as http://localhost:8080/servlet/HelloServlet.class
but error is given...could you please tell where could i have probably made a mistake
regards
preetihi tnguyen1973
now my servlets are running on the server provided they are kept under /examples/WEB-INF/classes. But now i have my own folder at the same level of examples called Lm which also has WEB-INF/classes. but if i put my servlets here it is giving exception.hope u got me. please, tell me where should i make necessary modifications to get the servlets run from my own folder instead of examples
thank u -
Jsp + tomcat + MS SQL Server
Hi
I am developing a JSP app that need to access the SQl database.
I have set my computer's CLASSPATH to the the MS SQL Server JDBC Drivers.
Do I also need to set any classpath on the TOmcat server so that it can view the databases.
If so, how do you set the classpath on Tomcat
ThanxI am having the problem in connecting MSSQL in jsp and I have copies all MS type 4 ODBC jar files into the above folders, and error exists:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred between lines: 6 and 32 in the jsp file: /jsp/DW/DW.jsp
Generated servlet error:
C:\jdk\tomcat\work\localhost\try\jsp\DW\DW$jsp.java:25: Type expected.
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
^
1 error, 1 warning
while my code is :
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<%!
String url = "jdbc:odbc:;DRIVER=SQL Server;Integrated Security=SSPI;Persist Security Info=False;database=db;Server=server";
Connection con;
Statement stmt;
ResultSet rs;
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con=DriverManager.getConnection(url);
stmt=con.createStatement();
rs = stmt.executeQuery(querystring);
while (rs.next()) {
//do something
%>
</BODY>
</HTML> -
How to connect to MS Access from servlet uploaded in TOMCAT server
Hi,
I want to access MS Access from servlet .I use TOMCAT server.I want to know what should i do.How to get drivers and how to set class path for them.
Please help me in finding the solution
thanks and RegardsHI,
try this
<Code>
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
java.sql.DatabaseMetaData dm = null;
java.sql.ResultSet rs = null;
try
Class.forName("sun,jdbc.odbc.JdbcOdbcDriver");
Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:dsnName","","");
dm = con.getMetaData();
out.println("<html>");
out.println("<head><title>Servlet1</title></head>");
out.println("<body bgcolor=\"lightblue\">");
if(con!=null){
dm = con.getMetaData();
out.println("<B><br>Driver Information</B>");
out.println("\n\t<br><br>Driver Name: "+ dm.getDriverName());
out.println("\n\t<br>Driver Version: "+ dm.getDriverVersion ());
out.println("\n\t<br>Database Information ");
out.println("\n\t<br>Database Name: "+ dm.getDatabaseProductName());
out.println("\n\t<br>Database Version: "+ dm.getDatabaseProductVersion());
out.println("\n\t<br><br>Avalilable Catalogs ");
rs = dm.getCatalogs();
while(rs.next()){
out.println("<br>\tcatalog: "+ rs.getString(1));
out.println("\n\t<br><br>conURL =" + conURL);
out.println("\n\t<br><br>Title = Database");
rs.close();
rs = null;
con.close();
}else {
out.println("Error: No active Connection");
}catch(ClassNotFoundException e) {
out.println("Coudn't laod the database driver: " + e.getMessage());
} catch(SQLException e) {
out.println("SQLException caught: " + e.getMessage());
try {
if (con != null)
con.close();
if (rs != null)
rs.close();
catch (SQLException ignored) {}
finally {
try {
if (con != null)
con.close();
if (rs != null)
rs.close();
catch (SQLException ignored) {}
</Code>
Sachin -
Weblogic error while deplying a simple servlet program
Hi This is a very simple servlet program.
I am trying to deploy it on the weblogic server but i get this error as follow
Unable to access the selected application.
*javax.enterprise.deploy.spi.exceptions.InvalidModuleException: [J2EE Deployment SPI:260105]Failed to create*
DDBeanRoot for application, 'E:\AqanTech\WebApp1\myApp.war'.
I have checked everything, right from my code to my web.xml file. I have used a build.bat file to build my war file.
PLEASE HELP ME TO SOLVE THIS HUGE PROBLEM OF MINE ?
Thanks,
ShoebHi,
The J2EE Error code siply suggest that there is something wrong in your Deployment Descriptors...
Can u please post the XML files available inside your "WEB-INF" directory?
Thanks
Jay SenSharma
http://jaysensharma.wordpress.com (WebLogic Wonders Are Here) -
Data adaptor deployment error in tomcat server
Hi,
I have created a data-plugin where i am calling Siebel On demand webservice and deployed in tomcat server ( apache-tomcat-6.0.26\webapps\web-determinations\WEB-INF\classes\plugins).I have put all the related jars in plugin folders.Now problem is when I am starting the tomcat server there in no error in console but if i see localhost.log file error is coming
SEVERE: StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/exolab/castor/mapping/xml/descriptors/BindXmlDescriptor
at java.lang.Class.getEnclosingMethod0(Native Method)
at java.lang.Class.getEnclosingMethodInfo(Class.java:929)
at java.lang.Class.isLocalOrAnonymousClass(Class.java:1239)
at java.lang.Class.getCanonicalName(Class.java:1167)
at com.oracle.util.reflection.ClassWrapper.getCanonicalName(ClassWrapper.java:189)
at com.oracle.util.discovery.LocalPluginFinder.findPluginInClass(LocalPluginFinder.java:279)
at com.oracle.util.discovery.LocalPluginFinder.findPluginsInURLTarget(LocalPluginFinder.java:251)
at com.oracle.util.discovery.LocalPluginFinder.findPlugins(LocalPluginFinder.java:162)
at com.oracle.determinations.web.platform.servlet.WebDeterminationsServletContext.init(WebDeterminationsServletContext.java:154)
at com.oracle.determinations.web.platform.servlet.WebDeterminationsServletContext.<init>(WebDeterminationsServletContext.java:91)
at com.oracle.determinations.web.platform.servlet.WebDeterminationsServlet.init(WebDeterminationsServlet.java:51)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
I have put the castor-1.3.1.jar file in plugin folder .Then also same error.I can see the BindXmlDescripto.class file in the jar.
what could be the reason.You need to put any associated jar files in the WEB-INF/lib directory. That should fix your problem.
The Developers Guide section on "Create a Plugin" describes what goes in the WEB-INF/classes/plugins and what goes in WEB-INF/lib
Cheers
Frank
Edited by: frank.hampshire on Jun 15, 2010 10:55 AM -
Java servlets and Tomcat server
Hi friends
i am using Sun One forte Community edition . i am trying to make a hello world servlet .
there are 2 Files one is Index.html , HelloWorld.java (Servlet)
I call this servlet from the index.html file.
evertime i call it it gives me and error of Apache tomcat file not found .The tomcat server is inbuilt with the Sun One studio.
the directory structure is
-----HOME
-------WEB_FOLDER
----------Index.html
----------WEB-INF
-------------CLASSES
-----------------myServlet (package)
---------------------HelloWorld.java
-------------LIB
The problem is I am not getting how to write the path of servlet in index.html to call the helloWorld servlet.Make this entry in your server.xml file located in tomcat_dir\conf.
<Context path="/abc"
docBase="webapps/abc"
crossContext="true"
debug="0"
reloadable="true"
trusted="false">
</Context>
Suppose i want to develop my servlets in another folder Let it be "XYZ".Then your package statement must be, 'package xyz;'. Place all your servlets in webapps/abc/WEB_INF/classes/xyz dir.
Place all your Jsp(s) and Htmls in webapps/abc/pqrs dir.
Now they all come under one context 'abc'.
Sudha -
Error in re-creating RMI registry when reloading Tomcat server.
Hi,
I use LocateRegistry.createRegistry() in a servlet which is load-on-startup. I've unexport the registered remote object in the HttpServlet.destroy().
But when I reload the tomcat server, such an exception ocurrs:
java.rmi.server.ExportException: internal error: ObjID already in use
at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:168)
at sun.rmi.transport.Transport.exportObject(Transport.java:69)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:190)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:164)
at RmiUtils.rebindLocal(RmiUtils.java:86)Here is the binding code in RmiUtils.rebindLocal:
try {
Naming.rebind(url, rmiImpl);
} catch (RemoteException ce) {
if (!ru.isLocalhost()) {
ce.printStackTrace();
// cannot cache
return;
} else {
// try to create the registry in local machine if not created
try {
LocateRegistry.createRegistry(ru.getPort());
Naming.rebind(url, rmiImpl);
} catch (RemoteException e) {
System.err.println("Failure in create Registry on port "
+ ru.getPort() + ", maybe it's been created already!");
e.printStackTrace();// handle exception
}Can anybody help?
Thanks.Hi
I havent code for quite a while.
I would think that this wont work.
The registry is created on startup (possibly init method in ur servlet) but it is never destroyed.
You are better off starting the registry externally to ur servlet engine, and then use do a bind/rebind on startup, unbind on destroy.
Hope this helps. -
Tomcat server 6.0 with jdk1.6 Path error
Hi,
my tomcat server is through the error while i compaily servlet files. already path was setted. the path but also it through the error pls.... some body help me to solve this error.
Path are:
CATALINA_BASE=c:\Program Files\Apache Software Foundation\Tomcat 6.0
CLASSPATH=.;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\bootstrap.jar;d:\jdk1.6\lib\tools.jar;c:\Program Files\Apache Software Foundation\Tomcat 6.0\lib;c:\jdk1.6\lib\tools.jar;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%TOMCAT_HOME%\lib
JAVA_HOME=d:\jdk1.6
JRE_HOME=c:\j2sdk1.6
TOMCAT_HOME=c:\Program Files\Apache Software Foundation\Tomcat 6.0
Path=%Path%JAVA_HOME%\bin;;d:\jdk1.6\bin.Sorry but your question isn't related to Java. It's a pure Tomcat question and should be asked in a Tomcat forum. (And they probably wants to know how it fails, and what error messages you get)
Kaj
Edited by: kajbj on Feb 13, 2008 10:25 AM -
Servlet run in tomcat server 5.5
Hello
I am new in developing the struts project.Any one help for my questtion
My question is?
I have develop the struts project in struts using eclipse and I have uploaded the files into the server.The Servlet file not working
Thanks in advancehi,
Mention what error is comming or displaying in console or browser,
or
simply recompile in console mode and restart your tomcat server , try again.. -
Regarding Tomcat Server Error/Warnings
Hi there,
I am getting some errors/warnings on the Tomcat server screen...
Actually, I am using a Controller Servlet and every request is being passed thru this servlet. There are some images on the Home page (Home.jsp) but when the Home link is clicked, these images disappear....
What do these error/warnings mean?
2002-04-03 12:42:52 - Ctx( /9001 ): IllegalStateException in: R( /9001 + /Home.jsp + null) Cannot forward as OutputStream or Writer has already been obtained
2002-04-03 12:42:52 - Ctx( /9001 ): 404 R( /9001 + /servlet/getacro.gif + null)null
2002-04-03 12:42:52 - Ctx( /9001 ): 404 R( /9001 + /servlet/getie.gif + null) null
2002-04-03 12:43:04 - Ctx( /9001 ): IllegalStateException in: R( /9001 + /Contact.jsp + null) Cannot forward as OutputStream or Writer has already been obtained
Any help would be much appreciated
Thanks!!!I believe this means that the JSP has already committed to sending data to the output stream, so it can no longer do a redirect or forward. If you have redirect or forward logic in your page, you should execute it before you write any data to the output stream. This means it needs to be the first thing in the page before any html is written.
-
Hi Experts,
Initially my File Parser Application was working fine with Tomcat Server. But now it is throwing this error and application is not showing the desired results.
Apr 16, 2010 3:17:14 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_15\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jre1.5.0_15\bin\client;C:\Program Files\Java\jre1.5.0_15\bin;D:\Program Files\Documentum\Shared;C:\Program Files\Documentum\Shared;F:\Program Files\Documentum\Shared;F:\Documentum\fulltext\fast40;F:\Documentum\product\5.3\fusion;C:\Program Files\Oracle\jre\1.1.8\bin;F:\\bin;F:\\Apache\Perl\5.00503\bin\mswin32-x86;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\PuTTY\;C:\Program Files\QuickTime\QTSystem\
Apr 16, 2010 3:17:14 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Apr 16, 2010 3:17:14 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 594 ms
Apr 16, 2010 3:17:14 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 16, 2010 3:17:14 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Apr 16, 2010 3:17:14 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 16, 2010 3:17:14 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Apr 16, 2010 3:17:14 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 16, 2010 3:17:14 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=null
Apr 16, 2010 3:17:14 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 16, 2010 3:17:14 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 640 ms
Apr 16, 2010 3:17:50 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 7 in the generated java file
Only a type can be imported. com.sun.xml.internal.txw2.Document resolves to a package
An error occurred at line: 8 in the generated java file
Only a type can be imported. com.sun.xml.internal.ws.transport.http.server.EndpointDocInfo resolves to a package
An error occurred at line: 12 in the generated java file
Only a type can be imported. javax.xml.stream.events.EndElement resolves to a package
Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at ProcessServlets.doPost(ProcessServlets.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)/usr/java/apache-tomcat-6.0.16/./GoodLuck does not exist or is not a readable directoryRTFEM.
Maybe you are looking for
-
Z ALV with Default Setting in save layout option disabled
Hi friends! I need a little help. I have a Z ALV and we trying to save layout, but the option "Default Setting" is grey and I cannot use this. How can I enable this option in save layout? Thanks!!
-
Copy data customer PO and PO date field from quotation to sales order
Hi Friends, Can you please let me know what copy control settings I need to maintain in order to copy customer PO# and PO date field data in quotation to sales order. All the data is getting copied from quotation to sales order when I create sales or
-
Time Capsule external USB drive won't reconnect remotely over Back To My Mac
I'm running a Mac Mini at work, connected via ethernet to an enterprise network (I have no idea what routers they are using, or how they are set up). At home, I have a MBP laptop and a Time Capsule (hardwired to cable modem) with an external USB driv
-
How to auto refresh planning application -- using ABAP Class?
Hi I have written few planning functions and attached them in one single planning sequence. One of the planning function in this sequence is de-activate data slice checkmark in planning modeler. If I execute this planning function indiviually then it
-
Looking at purchasing Contribute CS3, but wanted to know the following Will Contribute work with Go Live cs2, hope so cause co-author sucks. Will Contribute work with Dreamweaver MX 2004 or do i need to upgrade How easy is it to use for the client, t