DB access in JSP ignored

<p>Hi everybody</p><p>I created a report in Eclipse against a local MySQL, embedded it in a JSP and deployed it on a local Tomcat for testing. Evrything went smooth but when I reasign an identical remote DB to the report, copy the Web Archive onto a remote JBoss, the DB connection fails (MySQL 1045). </p><p>I assumed that the DB URL is kept inside the report (.rpt) file and that username and password have to be set in the JSP like so:</p><p>         IConnectionInfo connInfo1 = new ConnectionInfo();<br />        connInfo1.setUserName(Utilities.DB_USER);<br />        connInfo1.setPassword(Utilities.DB_PASSOWRD);<br />        connInfos.add(connInfo1);</p><p>       [...]<br />          //Create Viewer<br />        CrystalReportViewer viewer = new CrystalReportViewer();<br />        viewer.setReportSource(reportSource);<br />        viewer.setEnableLogonPrompt(false);  <br />        viewer.setDatabaseLogonInfos(connInfos);</p><p>If I use the remote DB from the local Tomcat it works too.<br /></p><p>Any help is highly appreciated.</p><p>Thanks in advance and regards from Zurich, Switzerland</p><p>Peter </p>

<p>ok, I found a code snippet that allows to change database access from within a JSP page:<br /></p><p>        //Create Report<br />        ReportClientDocument reportClientDoc = new ReportClientDocument();<br />        String report = gerlingUser.getReportName();<br />        reportClientDoc.open(report, 0);<br />        reportSource = reportClientDoc.getReportSource();<br />        session.setAttribute("reportSource", reportSource);<br />        <br />        <br />        // ****** BEGIN CHANGE DATASOURCE SNIPPET ****************  <br />            {<br />                String connectString = "jdbc:mysql://192.168.1.11:3306/DBNAME";<br />                String driverName = "com.mysql.jdbc.Driver";<br />                String JNDIName = "nameDS";<br />                String userName = "username";<br />                String password = "userpassword";            <br />                // Switch all tables on the main report and sub reports<br />                JRCHelperSample.changeDataSource(reportClientDoc, userName, password, connectString, driverName, JNDIName);<br />            }<br />            // ****** END CHANGE DATASOURCE SNIPPET ****************     <br />        <br /><br /></p>

Similar Messages

  • 500 error while accessing a jsp using tiles tags

    Hi all,
    when im trying to access a jsp which makes use of tiles tags, im getting the following error.
    status 500:
    org.apache.jasper.JasperException: The absolute uri: http://struts.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
    what might be the problem?
    Thanks in advance.

    asp,
    1. this is a java forum, and that's a jsp/struts question... you'll do better on the jsp forum.... or maybe a struts forum.
    2. it can't find http://struts.apache.org/tags-tiles ... but you knew that already didn't you... and where in the wide world might that uri be? maybe in struts generated xml? maybe in the schema declatation?
    keith.

  • Error while accessing a jsp file

              hi all,
              i am working on weblogic5.1 under solaris platform.
              my folder hierarchy is as follows weblogic_home/classes/weblogic/sun1/sun2.
              i have an import statement as follows import sun1.sun2.* in my JSP file.
              when i access this jsp file from my browser i have an error.
              the error is import package sun1 not found.
              i have set my classpath correctly(i feel so)...
              can anybody help me with this problem.
              if there is some fault in my classpath please tell me where exactly i should set my classpath for jsp files.
              thanx in advance.
              Prasad.
              

              Hi,
              1) what is your "weblogic.httpd.documentRoot=????"
              2) if it is "public_html" put your jsp there.
              Joe
              "Prasad" <[email protected]> wrote:
              >
              >hi all,
              >
              >i am working on weblogic5.1 under solaris platform.
              >
              >my folder hierarchy is as follows weblogic_home/classes/weblogic/sun1/sun2.
              >
              >i have an import statement as follows import sun1.sun2.* in my JSP file.
              >
              >when i access this jsp file from my browser i have an error.
              >
              >the error is import package sun1 not found.
              >
              >i have set my classpath correctly(i feel so)...
              >
              >can anybody help me with this problem.
              >
              >if there is some fault in my classpath please tell me where exactly i should set my classpath for jsp files.
              >
              >thanx in advance.
              >Prasad.
              

  • 500 error while trying to access a jsp which makes use of tiles tags

    Hi all,
    when im trying to access a jsp which makes use of tiles tags, im getting the following error.
    status 500:
    org.apache.jasper.JasperException: The absolute uri: http://struts.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
    what might be the problem?
    Thanks in advance.

    Hi all,
    sorry...got the reason for the above error..missed to include the tld file in WEB-INF.

  • Database access in JSP?

    Can I easily access MS access using JSP? If it is, what kind of drive should be used to access the MS Access database?
    Thank you so much!

    <%!
    // define database parameters
    String host="localhost";
    String user="";
    String pass="";
    String db="";
    String conn;
    %>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
    pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    This is when accessing a database in a JSP, not a javabean... Try searching this forum, there are LOTS of topics about this.

  • Portal 3 Profile access through JSP on iws6

    Hi,
    I have portal 3 sp4 and iws6 installed on the same server. The portal basically has URL scrappers of the web server. I want to access the user profile from the JSP sitting on the iws6.
    For this i have added the following lines in the JSP
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="com.iplanet.portalserver.naming.*"%>
    <%@ page import="com.iplanet.portalserver.session.*"%>
    <%@ page import="com.iplanet.portalserver.profile.*"%>
    <%
    try{
    SessionID sid = null;
    Session sess = null;
    sid = new SessionID(request);
    sess = Session.getSession(sid);
    Profile profile = sess.getUserProfile();
    catch(Exception e)
    %>
    Exception Occured
    <%
    out.println(" Error Message "+e);
    When i try to access the JSP it is throwing the following exception.
    com.iplanet.portalserver.session.SessionException: Invalid service host name .
    What do i have to do to access the profile info of the user from the JSP.
    Any suggestion is welcome.
    Regards
    Giriraj

    you need to allow cookies through to your web server; the client component on the web server
    and try to determine your portal and its not
    being passed thru.

  • Error accessing my jsp page

    I have created a simple web application and using tomcat 5. when i try accessing my jsp page..it just gives an error message..HTTP Status 404...The requested resource (/carnhotel/date.jsp) is not available.
    however, it works fine when i deploy in default applications (servlet-examples, jsp-examples,root)...plz help..

    How are you deploying this web application? Just in the webapps >directory?iewebapps/carnhotel/date.jsp?i have deployed in the webapps directory with the same directory structure...and also WEB-INF/web.xml
    also, when i open tomcat admin console...click on host(localhost/context(/carnhotel))..displays an error ...
    HTTP Status 500 - Error retrieving attribute debug
    type Status report
    message Error retrieving attribute debug
    description The server encountered an internal error (Error retrieving attribute debug) that prevented it from fulfilling this request.
    thnx...
    .

  • Daniel or anyone else, Help on why I can't access certain jsp pages

    I have installed the Web Service Portlet Wizard to build my portlets. In particular,
    I have created a URL porlet jsp which receives its content from a URL.
    This URL that I retrive is an application that I have running on my Weblogic 6.1
    Server. I can access the login page, and can logon and do a few things but for
    some reason I Can't access certain pages. The pages I can't access are also jsp
    pages on the wlserver6.1 server(exactly the same as other ones I can access and
    interact with).
    The error I receive on the Portal Front end is attached in a word doc. I have
    also included in there, a snapshot of the access log for those pages, but I can't
    really make out what it is telling me (if anything!).
    For one of the pages, that I can't successfully access I get java.lang.ArrayIndexOutOfBoundsException
    This only happens with 1 of the pages. But trying to access the same page withouth
    going thru the portal I get NO errors what so ever.
    Please if anyone can give me any information on why I can't access certain pages
    via my portal It would be very helpful.
    Finally I have included the code of my Portlet which accesses the URL. This is
    also included in the word doc.
    Thanks
    Ramy
    [Portal.doc]

    Ramy,
    I don't know the Web Service Portlet Wizard too well, but I notice that
    login.htm never seems to be found (404 in logs). I would think that the two
    warnings below your JSP call (cookies, and portlet state) are your most
    likely culprits. If the Web Service Portlet Wizard does not handle cookies
    then the portal server will have to continiously reauthenticate. I will
    forward your email however and see if I can dig up a better diagnosis. Also,
    could you post the stack trace for the ArrayIndexOutOfBoundsException you
    are seeing.
    Sincerely,
    Daniel Selman
    "Ramy" <[email protected]> wrote in message
    news:[email protected]..
    >
    I have installed the Web Service Portlet Wizard to build my portlets. Inparticular,
    I have created a URL porlet jsp which receives its content from a URL.
    This URL that I retrive is an application that I have running on myWeblogic 6.1
    Server. I can access the login page, and can logon and do a few things butfor
    some reason I Can't access certain pages. The pages I can't access arealso jsp
    pages on the wlserver6.1 server(exactly the same as other ones I canaccess and
    interact with).
    The error I receive on the Portal Front end is attached in a word doc. Ihave
    also included in there, a snapshot of the access log for those pages, butI can't
    really make out what it is telling me (if anything!).
    For one of the pages, that I can't successfully access I getjava.lang.ArrayIndexOutOfBoundsException
    This only happens with 1 of the pages. But trying to access the same pagewithouth
    going thru the portal I get NO errors what so ever.
    Please if anyone can give me any information on why I can't access certainpages
    via my portal It would be very helpful.
    Finally I have included the code of my Portlet which accesses the URL.This is
    also included in the word doc.
    Thanks
    Ramy

  • Accessing a JSP file via context URL

    Hi experts ,
    i have a requirement to access a jsp file via context url i.e. /irj/... abc.jsp , can  any one please suggest how to access this , i have a jsp dynpage component in the pagelet folder i have a jsp page, that im not able to access via the context url , and the images that are there in the image folder are accessible via context path i.e /irj/.. abc.gif etc.
    can any one please suggest a solution .
    Regards
    Govardan Raj

              Hi,
              1) what is your "weblogic.httpd.documentRoot=????"
              2) if it is "public_html" put your jsp there.
              Joe
              "Prasad" <[email protected]> wrote:
              >
              >hi all,
              >
              >i am working on weblogic5.1 under solaris platform.
              >
              >my folder hierarchy is as follows weblogic_home/classes/weblogic/sun1/sun2.
              >
              >i have an import statement as follows import sun1.sun2.* in my JSP file.
              >
              >when i access this jsp file from my browser i have an error.
              >
              >the error is import package sun1 not found.
              >
              >i have set my classpath correctly(i feel so)...
              >
              >can anybody help me with this problem.
              >
              >if there is some fault in my classpath please tell me where exactly i should set my classpath for jsp files.
              >
              >thanx in advance.
              >Prasad.
              

  • Servlet failed with ServletException occurs the first time I try to access a jsp

    Can any one tell why this exception occurs the first time I try to
              access a jsp. After the first time it doesn't occur. This happens only
              on solaris platform.
              Thanks,
              Shankar.
              Fri Jul 28 15:02:51 PDT 2000:<I> <ListenThread> Adding address:
              192.168.0.36/192.168.0.36 to licensed client list
              Fri Jul 28 15:02:51 PDT 2000:<I> <ServletContext-General> file: init
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: init
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              verbose initialized to: true
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              packagePrefix initialized to: jsp_servlet
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              compileCommand initialized to: /usr/bin/javac
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              srcCompiler initialized to weblogic.jspc
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              superclass initialized to null
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              workingDir initialized to: /space/shankar/weblogic/myserver/classfiles
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp: param
              pageCheckSeconds initialized to: 1
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> *.jsp:
              initialization complete
              Fri Jul 28 15:02:55 PDT 2000:<E> <ServletContext-General> Servlet failed
              with ServletException
              [AddToMap: pattern=/login.jsp class=jsp_servlet.login]
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at
              javax.servlet.ServletException.<init>(ServletException.java:88)
              at
              weblogic.servlet.jsp.AddToMapException.<init>(AddToMapException.java:14)
              at weblogic.servlet.JSPServlet.service(JSPServlet.java:118)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(Compiled
              Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled
              Code)
              at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)
              Fri Jul 28 15:02:55 PDT 2000:<I> <ServletContext-General> servletimages:
              init
              

    Try a different brand of discs.  Try restarting your computer.

  • MIcrosoft Access in JSP

    Hi,
    I would like to use as demo version, a JSP page which can connect on Access DB.
    Is there some good tutorial how to do it thru JSP ?
    thanks a lot,
    Maileen

    Hi,
    I would like to use as demo version, a JSP page which
    can connect on Access DB.
    Is there some good tutorial how to do it thru JSP ?
    thanks a lot,
    MaileenThere are tutorials to show how to connect to a database, including Access. JSP is immaterial, since JSP is supposed to be a view technology.
    Figure out how to do it with a POJO and then have your JSP simply call it.
    If you're asking how to set up a JNDI connection pool (an excellent idea), that's specific to the servlet/JSP engine you deploy your JSP to. Tomcat has docs - check them out.
    %

  • Concurrent Access of JSP

    Hi ,
    I am facing a strange problem. i.e. when 2 or more than 2 peopl access a same JSP from the hosting server (Orcale 9IAS application server ).. the 1st person who has accessed the jsp gets a JSP error saying "IllegalMoniterStateException" this thread is not the owner.
    Cud any body please suggest me as to how to overcome this problem??
    Kris

    Hi
    Couple of suggestions:
    1. Try deploying the same sample application on another server such as Tomcat which is freely available. If the same problem occurs then we can safely assume that it is an application related problem. If not then it might be an Application Server specific problem.
    2. Try searching the Application Server Vendor specific website for information on Bugs and Bug fixes. This might be listed.
    3. Paste the full stack trace of the exception and also if possible a simple JSP which reproduces the problem. This way the community can better assist you.
    Keep us posted on your progress.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • I am trying to access my jsp pages through mod_ose

    When I enter the url to my context in my web browser it returns the error message:
    'Service Temporarily Unavailable'
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    I have increased my processes, java pool size and shared pool size but I still get this message.
    Can you tell me what I am doing wrong?

    This happens very frequently during development, I just do ctrl+F5 in IE to keep refreshing till I finally get a response back from the jsp or servlet... usually it takes about 2-4 refreshes to get the jsp to respond and after that its smooth till you change the jsp or restart Apache. Also this problem, in my experience, is associated with Apache forwarding requests to OSE via mod_ose and I dont see this problem if I access the jsp directly using the database listener http endpoint.
    Hope this helps.

  • Accessing a jsp from excel

    Hi,
    I have a jsp page in my weblogic server(version 9.2). It simply sets a session variable when the user visits the page for the first time. Now i am trying to access this jsp from a excel file(I am providing the URL of the page as a hyperlink). But the page is getting processed twice.
    For example in my jsp I have the following code:
    <%
    System.out.println("Initially "+session.getAttribute("var"));
    session.setAttribute("var","JAVA");
    System.out.println("After setting"+session.getAttribute("var"));
    %>
    When I access this page from excel it is printing the following in console:
    Initially null
    After settingJAVA
    Initially null
    After settingJAVA
    As you can see the statements are getting printed twice.
    Can any one explain the reason for such a behaviour?
    Edited by: gopi_3nath on Apr 3, 2008 4:35 AM

    Just the same as normal HTML
    In child window
    window.opener.parentfunctionname()

  • MS Access and JSP

    I"ll really appreciate if someone could help me here. I'm new to JSP's and am having some trouble with database connection. I have one html page which asks the user to enter three fields and then submit it by clicking on the submite button(which calls add.jsp).
    The add.jsp contains the following code:
    Connection con=null;
    Statement stmt = null;
    ResultSet rs = null;
    String queryText = "insert into networks2 values('";
    queryText = queryText.concat(request.getParameter("SenderName"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageTitle"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageText"));
    queryText = queryText.concat("')");
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:networks2");
    stmt = con.createStatement();
    rs = stmt.executeQuery(queryText);
    } catch (Exception e) {}
    %>
    My problem is that the above data is not being inserted in the database. I have added networks2.mdb driver in system DSn. Could anyone please help me as to why i am not able to add information in my database.
    Thanks.

    Go over to the JDBC forum (which would have been a better place for your question, actually). The question "When I add a record to MS Access, it doesn't show up, why?" is asked frequently there. I think the answer is that it does show up if you continue by doing a select query, but I may be wrong.

Maybe you are looking for

  • Is it okay to use C++ new, delete in a plugin these days?

    Are C++'s new and delete operators totally kosher, not a time bomb that'll crash for some user two months from now?   The documentation I found says to ask Photoshop for memory through an awkward API, but then all documentation and sample plugin code

  • Out of Memory with LR 1.1 - yes, just point me to the FAQ or something

    Yes, I know this topic has been discussed ad nauseum, but I've yet to see an actual description of the problem and possible solutions that actually work. I run LR1.1 on Windows XP with 2gb ram. 1.1 is still slow, it's a super pig when you have >10k i

  • Bringing query parameters into output

    Hi All! We are creating a query using logical database ADA.  We need to bring one of the parameters from the LDB's selection screen - report key date - into the report output.  Does anyone have any idea how to do this? Thanks so much! Abby

  • Help me~ I need to know how --- IDOC interface syncho for ORDERS05 IDOC

    Dear Expert, Now I have Now I have already configuration interface of 2 systems ==frist one is system A and second one is system B== After Completed this setting. The system can authometic send IDOC after release PO in system A and auto generate SO i

  • Noob help pls.....  Sony DCR HC48

    i'm anxiously awaiting the new mbp's and i'm trying to do as much research as possible as i underderstand imovie08 comes 'standard' with ilife.... i've already searched for other sony mini dv cameras and i couldn't find what i was looking for.... the