Error with JSP, Apache Tomcat and SQL

Hi,
I was trying to do some user suthentication script.
This was my code..
<html>
<body>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.util.*" %>
<%
String Username1 = "";
String Password1 = "";
String Username2 = "";
String Password2 = "";
String qry = "";
Username2 = request.getParameter("uname");
Password2 = request.getParameter("pass");
qry = "select * from tbl_Users where Username="+Username2;
ResultSet Rs;
PreparedStatement pstmt=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:BankDSN");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tbl_Users");
while (rs.next())
Username1 = rs.getString("Username");
     Password1 = rs.getString("Password");     
     if (Password1 == Password2)
     response.sendRedirect("home.jsp");
     else
     response.sendRedirect("sorry.jsp");
rs.close();
stmt.close();
con.close();
%>
</table>
</body>
</html>
When I tried to invoke the JSP page, I got the following error
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException
     at org.apache.catalina.connector.HttpResponseFacade.sendRedirect(HttpResponseFacade.java:173)
     at org.apache.jsp.validate$jsp._jspService(validate$jsp.java:99)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
     at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
     at java.lang.Thread.run(Thread.java:595)
Any help would be appreciated.....
Regards,
Ramprasad

Dear vraptor,
I had seen ur jsp page , can i tell u one thing , never write a connection in the jsp page, why becoz the code can be seen.
ok here the problem is ur getting the username and password and putting an if condition inside the while loop so this throws an error.
anyway ur getting the values like
while (rs.next())
Username1 = rs.getString("Username");
Password1 = rs.getString("Password");
now the username and password are already retrived from server side, just do the check now outside the loop.
if (Password1 == Password2)
response.sendRedirect("home.jsp");
else
response.sendRedirect("sorry.jsp");
one more thing is check whether the page forwarding to correct page like response.sendRedirect("home.jsp");
see for the "/<directory Name>"/home.jsp if u keep all the jsp at one directory.
i mean this response.sendRedirect("/jspdirectory/home.jsp");
try this
regards
haribabu

Similar Messages

  • Cannot get EL with JSP 2.0 and Tomcat 5 to work.

    I cannot seem to get the EL to work with Tomcat 5 to work. When I use <c:out value="${expr}"/>, I simply get printed out the content of the double quotes as though it is a string. I don't know if EL has to be enabled with JSP 2.0 and I cannot find any documentation on enabling EL with JSP 2.0. Please help.

    Check out [url http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0] this thread , reply #6.
    It covers the basics issues that people encounter installing JSTL.
    I cannot find any documentation on enabling EL with JSP 2.0I guess you haven't looked hard enough.Try the JSP2.0 specification section 3.3.2: Deactivating EL Evaluation

  • JSP Apache-Tomcat

    I have a problem running a JSP program in a second PC.
    In the first PC I am running Apache-Tomcat and I execute the program with this command in a browser:
    http://localhost:8080/jspexamples/myJSPs/almacen/Venta01.jsp
    It works OK.
    I also have the C:\jakarta-tomcat-5.0.28 as a shared folder and I turn off the firewalls.
    In the second PC I am trying to run the same program using this command in the browser:
    http://192.168.15.5/jspexamples/myJSPs/almacen/Venta01.jsp
    This 192.168.15.5 is the IP address of the server PC (first PC), which is running the Apache-Tomcat. The program does not run.
    P.D.: The program is in the first PC in the folder:
    C:\jakarta-tomcat-5.0.28\webapps\jspexamples\myJSPs\almacen
    Thanks, John

    Try http://192.168.15.5:8080/jspexamples/myJSPs/almacen/Venta01.jsp
    When you create web application, it should be placed in separate. The default place is ${CATALINA_BASE}\webapps. Do not add your jsps in existing application (jspexamples in this case).
    I also have the C:\jakarta-tomcat-5.0.28 as a shared folder and I turn off the firewalls.This folder can be (and should be) unshared. Tomcat listens port 8080 (by default configuation), you can turn on your firewall, allow connections for 8080 port and all will work! (at least, all can work in theory :) )

  • JSP & Apache Tomcat  &hsqldb

    HI every one,please be patient while reading this message.
    I installed apache tomcat and created a database by hsqldb.i want to work with this database from my JSP files.i read the documentation of hsqldb and they say that the best mode or the official one is to run the servlet server(as you know there are five modes of server).and they say that the servlet engine(Apache in this case) is responsible for lanching this servlet server.How can i run it and solve this problem.
    thanks very very much.

    thnx a lot for replying but what i want to know is how to
    1- create database with hsqldb
    2-add,delete ,insert ... to the database from jsp with apache running.
    Note:will this steps be the same if i put the files on my site and also the database.
    i mean ,will the same configurations be ok/
    thnx again and waiting for your reply.

  • GPL Licence, Apache Tomcat and J2EE5

    Hello !
    I'd like to know if it is possible for a company to sell a server with apache tomcat and J2EE 5 ?
    Does this company have to pay fees to Sun ?

    Hi,
    I have same problem with B1 9.1, Version for Hana, but I cannot apply the workaround of San Xu on linux server.
    I try a clean installation of 9.1 servertools on linux server, but on windows server, when I run the Upgrade.exe for the databases, the error appears: "Could not connect to licence server; enter valid password".
    I've the italian localization.
    Can someone help me?
    Thanks & Regards
    Valerio

  • I get a error when starting Apache Tomcat 6.0 service

    Hi Friends,
    I get a error when starting Apache Tomcat 6.0 service. Do you help me?
    Kind regards.
    Fatih Temiz
    First Step:
    Second Step:
    Thanks for helps...

    It seems like the JVM is pointing to incorrect .dll file.
    Goto Apache bin directory, and from there open Apache[version]W.exe
    Click the "Java" tab and ensure the first textbox "Java Virtual Machine" is pointed to the correct jvm.dll
    If it was pointed to the JDK then it is wrong. Repoint it to the jre jvm located at \jre6\bin\client\jvm.dll
    Let me know if it resolves the issue.

  • Installing BAM with Biztalk Server 2013 and SQL server 2012

    Hello All,
    I have to work on BAM with BizTalk Server 2013 and SQL server 2012 , is BAM already comes with BizTalk server installation ?
    Will I needs to explicitly install that ? from where I can get the installer for BAM ?
    What else I will needs to work on BAM ?
    Note : I want to handle Exceptions in BAM ....how to do that ?
    Thanks,
    Nitin.
    Thanks and Regards, Nilesh Thakur.

    Hi,
    BAM is available with BizTalk, all you need is to select it and install .
    Refer the
    Installation Guide available on MSDN or follow the blog: http://sandroaspbiztalkblog.wordpress.com/2013/05/05/biztalk-2013-installation-and-configuration-important-considerations-before-set-up-the-server-part-1/
    Maheshkumar S Tiwari|User
    Page|Blog|BizTalk
    Server : Scheduling Orchestration using Trigger Message

  • From where can we dowload Apache tomcat and how to install

    From where can we dowload Apache tomcat and how to install

    http://jakarta.apache.org/tomcat/tomcat-5.5-doc/index.html

  • Airport Utility `install failed' error with both 6.0 and 6.1

    Hi folks
    I am running Mac OS X Lion 10.7.4 (11E53) and cannot get the Airport Utility to run at all. [5.5.3] The application icon flickers as though it is about to launch and then nothing happens.
    I have tried other 5.x downloads and they all fail because I am running OS X Lion 10.7.4.
    Doing a standard Software Update or using a download of 6.x from the Apple Support site, the installer comes up with an `install failed' error with both 6.0 and 6.1, having gotten through the complete process and looking like they were `successful'.
    It's the only time in two years and many updates later that i have come across this issue, so I am unsure how to start to tackle it.
    Any ideas or suggestions please?
    Thanks in advance.

    Welcome to Apple Communities
    Backup your files and try this:
    1. Reboot from recovery partition (or as in my case USB recovery drive)
    2. Select Re-install Mac OS X
    3. Allow the process to run through multiple restarts
    4. When reinstall process is complete run software update (side note, my software update would not launch as long as my USB recovery stick was plugged in, weird)
    5. Run all updates saving the Airport Utility 6.0 until last.
    6. Install the airport utility from software update.

  • Error with Title i.d. and password in app builder

    Hi;
    Ive just subcribed to Pro edition DPS and am starting to build my viewer app, however im getting an error with Title i.d. and password in app builder
    It says niether the title id or password are valid, however they are the same as i've used to both log into app builder and to upload my folios to the folio producer.
    What am i missing here?
    Scott

    Yes, the account administration stuff is confusing when you jump from a "creative" account to a Pro account. As the Getting Started guide states, when you set up your Pro account, you should use dedicated Adobe IDs, such as [email protected] and [email protected], not [email protected] The Copy Folio command makes it easy to transfer folios from one account to another, especially if you do it on the same machine you used to create the folios. Everything moves over nicely.
    Again, don't use your "master" account for creating and publishing folios. Use it only for account administration.

  • Does Mountain Lion come with an Apache server and if so how do I access it?

    Does Mountain Lion come with an Apache server and if so how do I access it?
    On my previous Mac there was a check box for web sharing in the Sharing System Preferences. I used this to experiment with HTML website design. How do I do this on my new Mac?

    Thanks for the reply. Others have asked similar questions. I was directed to a user tip page 
    by etresoftThat gives step by step instructions which should solve my problem.

  • New error with upgrade jboss/tomcat: "Connection handle has been closed and is unusable"

    Hi,
    This error suddenly appeared when we upgraded from jboss3/tomcat5.0 to jboss4.2/tomcat5.5.
    here's the usecase:
    1) User clicks on report link
    2) Crystal reports web componnent displays screen to fill in report parameters.
    3) user enters parameters and clicks submit
    4) System throws Exception
    The same reports worked fine with jboss 3.2.6/tomcat 5.0. We haven't touched anything in this realm.
    Log Excerpt:
    09:42:18,842 INFO  [datasource] Openning rowset
    09:42:18,904 ERROR [reportdefinition] com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Connection handle has been closed and is unusable
    09:42:18,905 ERROR [datasource] Failed to open rowset: the query failed to open rowset
    com.crystaldecisions.reports.reportdefinition.datainterface.g: JDBC Error: Connection handle has been closed and is unusable
         at com.crystaldecisions.reports.reportdefinition.datainterface.d.a(Unknown Source)
    To try to narrow down the problem, I've updated the jdbc configuration to
         <track-statements>true</track-statements>   
    here's a recap:
    This Boolean element specifies whether to check for unclosed statements when a connection is returned to the pool. If it is true, a warning message is issued for each unclosed statement. If the log4j category org.jboss.resource.adapter.jdbc.WrappedConnection has trace level enabled, a stack trace of the connection close call is logged as well. This is a debug feature that can be turned off in production.
    Interestingly enough, this error appears slightly upstream:
    (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at
    org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown
    So the question arises:
    1) Is the jboss datasource overly/aggressively closing result sets?
    2) or is there a coding error in CRXIR2?
    thanks,
    bill
    Full stack trace:
    [2008-03-13 17:26:18,905] [INFO ] org.jboss.resource.connectionmanager.CachedConnectionManager (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
         at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.z.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ak.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ad.int(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bk.for(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(Unknown Source)
         at com.crystaldecisions.reports.sdk.DatabaseController.setTableLocation(Unknown Source)
         at org.apache.jsp.reports.processreport_jsp.switchTables(processreport_jsp.java:131)
         at org.apache.jsp.reports.processreport_jsp.loadReport(processreport_jsp.java:68)
         at org.apache.jsp.reports.processreport_jsp._jspService(processreport_jsp.java:227)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.shared.pagecache.client.PageCacheFilter.doFilter(PageCacheFilter.java:760)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.ExpiredPasswordFilter.doFilter(ExpiredPasswordFilter.java:92)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.processUrl(ChannelUrlFilter.java:168)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.doFilter(ChannelUrlFilter.java:100)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.BlockIpAddressFilter.doFilter(BlockIpAddressFilter.java:224)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.outstart.multiapp.filters.KeepOtherSessionsAliveFilter.doFilter(KeepOtherSessionsAliveFilter.java:88)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)

    <p>
    OK. I found the problem along with a workaround.
    </p>
    <p>
    <strong>The problem:</strong>
    </p>
    <p>
    a programming practice clashes with a new jboss 'safety check'.
    </p>
    <p>
    <strong>Programming practice:</strong>
    </p>
    <p>
    crystal reports gets a database connection in one jsp page, then tries to use it on another jsp/servlet
    </p>
    <p>
    <strong>Jboss safety check:</strong>
    Jboss/tomcat new comes configured out-of-the-box with a 'cached connection
    manager', which
    </p>
    <p>
    "Check[s] for unclosed connections and transaction terminated checks in servlets/jsps."
    </p>
    <p>
    <strong> Summary</strong>
    </p>
    <p>
    In short, if a servlet/jsp ends and it leaves a database connection open, Jboss will automatically close it.
    </p>
    <p>
    </p>
    <p>
    <strong>Workaround:</strong><br />
    Comment out two entries in these two files:
    </p>
    <p>
    1) conf/jboss4/pe/deploy/jboss-web.deployer/server.xml
    </p>
    <p>
    2) conf/jboss4/pe/deploy/jboss-web.deployer/META-INF/jboss-service.xml
    </p>
    <p>
    The two entries:
    </p>
    <p>
    </p>
    <p>
    1)
    </p>
    <p>
                 <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"<br />
                    cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"<br />
                    transactionManagerObjectName="jboss:service=TransactionManager" /><br />
    </p>
    <p>
    2)
    </p>
    <p>
          <depends>jboss.jca:service=CachedConnectionManager</depends><br />
    </p>
    <p>
    </p>
    <p>
    <strong>Comments on the workaround</strong>
    </p>
    <p>
    The 'cached connection manager' basically makes sure that the application cleans up after bad programmers. It seems most helpful in development, load testing, or trouble shooting.
    </p>
    <p>
    In production,  you can likely  comment them out with minimal
    impact on the application.
    </p>

  • Query Engine report error with Crystal Report 9 And MS SQL SErver 2000

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...
    Refer the above statement highlighted in BOLD. That statement is WRONG. Select what ???? Try any one of the below statement,
    select ''
    --or
    select 0
    --or
    select null
    Regards, RSingh

  • What  kind of classes I can use with JSP in tomcat? Please Help

    Hi people, I tried use the classes that I did for others application and it throw this exception :
    "org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\matriculaOnLine\valide_jsp.java:14: cannot access matriculaOnLine.Connect
    bad class file: D:\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\matriculaOnLine\Connect.class
    class file contains wrong class: Conexao
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    private Connect conn = new Connect(driver,url,login,password);
    ^
    1 error"
    I used the Connect class with java apps and it work but with JSP on TomCat4.1.27
    Can someone help me, please?
    Tiago - [email protected]

    Hi Tiago,
    I have some problems in my mind.
    Which databse you are using? and Which database driver you are using for connecting database?
    Also can you please give a code snapet that you written for connecting databse?
    ----------Milind

  • Unable to compile class for JSP. apache-tomcat-6. What could be wrong?

    Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
    Steps that I have done:
    javac ch06_01.java , placed the ch06_01.class under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
    Then grabbed the ch06_02.jsp and placed it under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
    When I run it (by placing this into Explorer or Firefox URL
    http://localhost:8080/ch06/ch06_02.jsp) I get the error further
    below. Things I have done and made sure they are in place are:
    set up JAVA_HOME to C:\Apps\jdk1.6.0_06
    Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
    Using JRE_HOME: C:\Apps\jre1.6.0_06
    I did a google on the error and I found people saying to place the
    tools.jar from the jsk into the lib directory under CATALINA_HOME. But
    the examples still don't work. What step could I be missing? Your help is greatly
    appreciated.
    This is the simple jsp file:
    <%@ page import="ch06_01" %>
    <HTML>
    <HEAD>
    <TITLE>Using a JavaBean</TITLE>
    </HEAD>
    <BODY>
    <H1>Using a JavaBean</H1>
    <% ch06_01 messager = new ch06_01(); %>
    The message is: <%= messager.msg() %>
    </BODY>
    </HTML>
    this is the simple ch6_01 java file:
    public class ch06_01
    public ch06_01()
    public String msg()
    return "Hello from JSP!";
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented
    it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    The import ch06_01 cannot be resolved
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Edited by: indikon1 on Jun 12, 2008 1:18 PM
    I just updated the directories of the variables to reflect the current status of my system.

    What is wrong is that you are using an "old" jsp tutorial :-)
    Since Java 1.4, JSPs have been unable to access classes in the "default" package.
    What you need to do:
    Put the java class ch06_01 in a package.
    Steps to do this
    - Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
    - create a folder "mypackage"
    - move ch06_01.java into that folder
    - compile that class (now in the mypackage package)
    - place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
    In your jsp:
    <%@ page import="mypackage.ch06_01" %>
    I would suggest using a more up-to-date tutorial that uses JSTL.
    Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html]

Maybe you are looking for

  • Podcast skipping a few seconds at a time

    When playing Tiesto's Clublife Podcast (I don't really play much else), the Podcast starts out OK with a small static-y type noise in the backround. As the podcast progresses (just checked in this instance ~12min in) it starts to rapidly play 3-4 sec

  • Why did icloud or match make a duplicates of every song in my library? how do I stop this?

    really struggling with itunes since I signed on to "match" and "Icloud" All of a sudden I have dupes of every song on my windows laptop, one with a cloud with slash throug it, and one without. Now my laptop seems to have twice the memory takne up and

  • Active X bringing a graph from excel to LV

    Is there a way to display an excel graph in labview. not just data but actual graph with functionality like rollover display.  I feel like this could be done with active x but im not sure how to get it done. Thanks, Triff

  • Error in Global Conversion rule for InfoObject

    Hi Gurus,               I am working on SAP NetWeaver 2004s BW 7.0, I have extracted the SD cube 0SD_C03(sales overview) content from the business content and noticed the infoobject's transfer rules are not active and when i tried to active them i am

  • Airport card for a Powerbook G4 and DVD hardware upgrade

    Hi all, my sister has Powerbook G4 titanium onyx model # 48407 and needs to find an airport card and have it installed. Can you advise us where she can look to purchase one. Apparently apple nolonger makes them. Also, our second question is: Can a DV