A complie error of my jsp

I met a complie error of my jsp, could you tell me what is the problem?
Here is a part of my jsp, I omit the html part.
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
java.sql.Connection conn1;
conn1=DriverManager.getConnection("jdbc:mysql://130.225.76.177/exwh?user=kun&password=some_pass");
Statement stmt1 = conn.createStatement ();
ResultSet rs1 = stmt1.executeQuery("select site_name from site, location, location_coountry, country where country.country="Algerina" and country.countryid = location.countryid and location_country.locationid = location.locationid and location.siteid =site.siteid");
if (rs1 !=null)
while(rs1.next())
String sn1=rs1.getString("site_name");
%>
<li><a href="DisplaySite?site_name=<%=sn2.replace( ','+') %">'><%= sn2%></a><li><br>
<%
stmt1.close();
conn1.close();
%>
The error comments is following:
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
/usr/local/tomcat/work/DEFAULT/projsp/jsp/allsites_3.java:68: ')' expected.
ResultSet rs1 = stmt1.executeQuery("select site_name from site, location, location_coountry, country where country.country="Algerina" and country.countryid = location.countryid and location_country.locationid = location.locationid and location.siteid =site.siteid");
^
1 error, 1 warning
at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)
What is the meaning of the error comment? I have checked my code, I have not found where need the ")".
Hopefully,, someone can give me a hint!

Check this :-
java.sql.Connection conn1;
conn1=DriverManager.getConnection("jdbc:mysql://130.225.76.177/exwh?user=kun&password=some_pass");
Statement stmt1 = conn.createStatement ();
You have declared conn1 and using conn.
Check this too:-
ResultSet rs1 = stmt1.executeQuery("select site_name from site, location, location_coountry, country where country.country="Algerina" and country.countryid = location.countryid and location_country.locationid = location.locationid and location.siteid =site.siteid");
It expects a ")" after [country="] as the string ends there. Try using country.country='Algerina' instead of country.country="Algerina"

Similar Messages

  • Compling error

    HI, anyone konw why there is compling error? I have got a list of record from db and the following script is used to update one record when i click submit button on that record
    Thx a lot
    Chikkit
    error
    Update.java:23: incompatible types
    found : java.lang.String
    required: java.lang.String[]
    String name[] = req.getParameter("name");
    ^
    Update.java:24: incompatible types
    found : java.lang.String
    required: java.lang.String[]
    String email[] = req.getParameter("email");
    ^
    Update.java:25: incompatible types
    found : java.lang.String
    required: java.lang.String[]
    String message[] = req.getParameter("message");
    ^
    3 errors
    script
    package chikkit;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class Update extends HttpServlet {
    private Connection conn = null;
    private Statement stat = null;
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    PrintWriter out = res.getWriter();
    res.setContentType("text/html");
    //String name, email, message;
    //name = req.getParameter("name");
    //email = req.getParameter("email");
    //message = req.getParameter("message");
    String name[] = req.getParameter("name");
    String email[] = req.getParameter("email");
    String message[] = req.getParameter("message");
    //top html-tags here:
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Thanks</title>");
    out.println("</head>");
    try {
    String dbURL = "jdbc:HypersonicSQL:/members/aFomaSX4K3nMurOq8wdg4oKLfyWvjK6m/myDB/myDB";
    Class.forName("org.hsql.jdbcDriver");
    conn = DriverManager.getConnection(dbURL, "sa", "");
    stat = conn.createStatement();
    } catch (Exception e) {
    out.println("<br>ERROR: Could not connect to database<br>");
    out.print(e);
    for(int i=0;i<name.length;i++)
    String sql = "update guest set email =" + email[i] +
    "where name =" + name;
    try {
    int numRows = stat.executeUpdate(sql);
    stat.close();
    } catch (SQLException s) {
    out.println("<br>ERROR: Could not update database<br>");
    out.print(s);
    //try {
    //int numRows = stat.executeUpdate(sql);
    //stat.close();
    //} catch (SQLException s) {
    //out.println("<br>ERROR: Could not update database<br>");
    //out.print(s);
    out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
    out.println("<p> </p>");
    out.println("<h3>Thanks for your entry to my guestbook, " + name + "<br>");
    out.println("</h3>");
    out.println("Go to back to: <a href=\"http://www.mycgiserver.com/~chikkit/GuestBook.jsp\">Viewing the guestbook</a> | ");
    out.println("<a href=\"http://www.mycgiserver.com/~chikkit/input.html\">Writing the guestbook</a> | ");
    out.println("<a href=\"http://www.mycgiserver.com/~chikkit/tutorial.html\">Tutorial</a>");
    out.println("</body>");
    out.println("</html>");
    try {
    conn.close();
    } catch (SQLException s) {
    out.println("<br>ERROR: Unable to close database connection<br>");

    The getParameter method returns a String, so the correct way to use it is:
    String name = req.getParameter("name");
    String email = req.getParameter("email");
    ... and so on.
    i hope it works!!!

  • "No tag library could be found with this URI" error while compiling jsp

    I am using WebLogic Server 9.2 MP1, JDK 1.5.0_09, Struts 1.3.5
              I am pre-compiling jsp pages with wlappc ant task. However, I got following errors when a jsp page contains ant taglib:
              No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
              The jsp page looks like:
              <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
              wlappc complains taglib could not be retrieved from this uri. Actually, since Struts 1.3.5, those ".tld" files are contained in strust-taglib-1.3.5.jar, folder META-INF/tld/. And I don't need to set anything in web.xml <tag-lib> tab anymore.
              All the jsp pages can be successfully compiled while being deployed to Server. So what am I missing? My build.xml file looks like:
                   <target name="compile-jsp">
                        <wlappc source="${src.dir}" output="${out.dir}"
                             keepgenerated="true" optimize="true" classpathref="wl_classpath"/>
                   </target>
              where "wl_classpath" contains all the struts related jar files, e.g. struts-core-1.3.5.jar, struts-taglib-1.3.5.jar, ...., and weblogic related jars, e.g. weblogic.jar.....
              I checked "beehive" samples coming with weblogic92, and found it pretty much did the same thing regarding build script and jsp files. So I am totally lost!
              Please help me out. Many thanks.
              Edited by jqian at 02/02/2007 10:24 AM

    Yes sorry, you're correct. The uri I mentioned is just 1.0.
    Do you have the "Oracle WebLogic Web App Extension" Facet for your web project? If not, try adding that and making sure that there is a weblogic.xml file created in the WEB-INF dir. The weblogic.xml file allows you to deploy usig a shared lib for JSTL. It should contain a library-ref element something like the following, with a version of 1.1.
    <wls:library-ref>
    <wls:library-name>jstl</wls:library-name>
    <wls:specification-version>1.1</wls:specification-version>
    <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>

  • Error on deploying JSP web module

    Hi,
    I've created a JSP web module that consumes a web service. I'm following this tutorial
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0cf9e42-ccb0-2c10-d0a4-f5aa8a79e19a?quicklink=index&overridelayout=true|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0cf9e42-ccb0-2c10-d0a4-f5aa8a79e19a?quicklink=index&overridelayout=true]
    But when I deploy my ear project, I had this error
    Application error occurred during the request procession.
    Details:   com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException:
    Error compiling [/sample.jsp] of alias [LocalDevelopmentdc_webmodulesap.com] of J2EE application [sap.com/dc_webmoduleear].
    Exception id: [001CC43ABAC00086000056FB00006CEA0004A5A7E1A64FD3]
    Here's the java code in the JSP:
    InitialContext ctx = new InitialContext();
    WS_Preview obj = (WS_Preview).ctx.lookup("java:comp/env/newproxy");
    WS_PreviewViDocument port = (WS_PreviewViDocument)obj.getLogicalPort("Config1Port_Document",WS_PreviewViDocument.class);
    GetElementXHTMLValueResponse result = new GetElementXHTMLValueResponse();
    result = port.GetElementXHTMLValue("A","A","A");
    out.print(result);
    Does anyone know how to solve this error? Thanks

    Because you do not have an infrastructure database, you will not be able to deploy your web service from OEM as one of its steps is to register the service in the UDDI registy - the Web service deployment and UDDI registration are tied tightly together in OEM right now.
    All is not lost, however. You have two routes to deploy the Web Service on Oracle9iAS:
    1. Use DCM, which is the command line interface to deploy applications/webservices/wars/ears on Oracle9iAS. It does not have the dependency on UDDI.
    To deploy a Web service using DCM, say your Web service ear file were named test.ear your deployment command would look something like:
    c:\oracle\ora903\dcm\bin\dcmctl deployApplication -file test.ear
    See the doc for much more detail to let you tailor DCM to do all the stuff that is available through EM or specific to your application:
    http://download-west.oracle.com/docs/cd/A97329_03/core.902/a92171/dcm.htm#643834
    2. In JDeveloper 9.0.3, there is a DCM Servlet that lets you do remote deployment to Oracle9iAS:
    http://otn.oracle.com/products/jdev/htdocs/readme_9031.html#viadcm
    I suspect your deployment problem from Oracle9i JDeveloper may be (this may be an incorrect assumption) due to trying to use a connection that is setup as if Oracle9iAS is a standalone OC4J.
    Mike.

  • Error in precompiling JSPs using OJSPC

    Hi,
    I am precompiling JSPs in war file using ojspc as specified below.
         ojspc -output myapp.war app.war
    However I am getting following error:
    Detected archive, now processing contents of app.war...
    Setting up temp area...
    Expanding archive in temp area...
    WARNING: IGNORED file: /WEB-INF/lib/jsf-impl.jar
    WARNING: IGNORED file: /WEB-INF/lib/jsf-ri.jar
    Parse error in AddNewAttachment.jsp:
    oracle.jsp.parse.JspParseException: /AddNewAttachment.jsp: Line # 48,
    actionListener="#{addAttachmentBackingBean.cancel}"/>
    Error: A String literal value, "#{addAttachmentBackingBean.cancel}", has been pr
    ovided for attribute actionListener which has an associated deferred method with
    void signature
    Removing temp area...
    Can anbody help me to solve this problem?
    Thanks.
    Regards,
    Umesh

    Hi,
    If I create a method via the binding editor in JDev it creates a managed bean method with a void return type as default.
    eg.
        public void cmdlink_actionListener(ActionEvent actionEvent) {
            // Add event code here...
        }could it have anything to do with the two OJSPC warnings? jsf-impl.jar should be included in your war file. I haven't seen this warning when OJSPC is compiling.
    Brenden

  • Syntax error when using jsp:include...

    @ all
    I get a syntax error at the jsp:include line, character "";
    Can anybody help me with that issue?
    Jürgen

    select coalesce(col1,col2) joined_col, col3, sum(col4), col5 from data group by joined_col,col5You cannot use a column alias like this directly inside the group-by clause. You will have to rewrite this to:
    select coalesce(col1,col2) joined_col, col3, sum(col4), col5 from data group by coalesce(col1,col2),col5Furthermore I assume that the 'col5' in the group by should be 'col3', not?
    Or vice-verse the 'col3' inside the select-list should be 'col5'...

  • Generating error page(in jsp) when session expires....

    hello,
    i want to generate error page(in jsp) when session get expires...
    plz help me out.............

    You could do it according to the line BalusC supplied in another topic:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">The only thing you gotta change, is the URL, make it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">Create 'error.jsp' and have the message 'Session expired, sorry!' or something printed. If you want to use error.jsp for more than just the session expiration, add a parameter to it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp?error=sessionexpired"> Place the following lines in your error.jsp:
    String errormessage = request.getParameter("error");
    if(errormessage.equals("sessionexpired")){
    out.println("Your session has expired, sorry!");
    }else if(errormessage.equals("whatever")){
    // To do code here.
    }

  • Error managment in jsps

    hi,
    in my jsp
    i have some code like this..
    <%@page --------------------------%>
    <html>
    file://header part of page using html goes here
    -------------so on
    <%
    try{
    file://som functionalites
    }catch(SQLException e)
    %>
    </html>
    here if any error occures in jsp page functionalites
    i should display the error page..but unfortunately
    in my browser its displaying the header parth
    and then displaying the erorpage in belows making the page ugly..
    how can i avoid this..if any error occurs its should display only errorpage.jsp with exception
    Regards,

    i resolved in this way..
    <%@page buffer="96kb" autoFlush="true" %>
    is this correct way..when we are dealing with huge amount of data..lets say while search i got 10k records..any way i will display only10 perpage..for next 10 it will hit server again.
    this buffer will create any problem.
    Regards,

  • 9.0.3 Preview - Class not found error after including jsp:useBean

    Hi,
    I got a Java.lang.NoClassDefFoundError while compiling a JSP Page, after including a simple web bean as follows:
    <jsp:useBean id="catviews" scope="request" class="CategoryView" />
    <jsp:setProperty name="catviews" property="*" />
    somewhere within the HTML page...
    <%= catviews.getCategory() %>
    The JSP page without the bean compiles fine and the Javabean itself compiles without error. The bean class is where JDev automatically puts it (i.e in a sub-directory of the classes directory within the project) and JDev does not raise any error on that JSP Page before compiling.
    The error seems to point to the first line of the page, to the directive of the JSP page:
    <%@ contentType="text/html" ... %> which is apparently harmless. What can be wrong ?
    Thanks for your reply.

    'Class not found' means 'Class not found' , the class you are referencing is not in your project's classpath. You should make sure your project's classpath point to the location where this class is deployed to. This could be a directory or a .jar file. You should also include the package name as part fo the class.

  • Complie Error for menus (Swing)

    I'm receiving the following complie error. Also, listed is the area for code that is getting the error.
    Thank you for any help that you can provide.
    Error Message:
    P5AWT should be declared abstract; it does not define menuSelected(javax.swing.event.MenuEvent) in P5AWT
    public class P5AWT extends JFrame
    Program:
    public class P5AWT extends JFrame
         implements ActionListener, MenuListener
    private JTextField inputfile;
    private JTextField outputfile;
    private JTextArea ta;
    private JMenuItem newMT, openMT, saveAsMT, exitMT;
    String curFile, filename = "";
    int numstaff;
    Employee[] staff;
    public P5AWT()
    super ("P5AWT Starter Program");
    addWindowListener(new WindowAdapter()
    { public void windowClosing(WindowEvent e) { System.exit(0); }} );
    JMenuBar mb = new JMenuBar ();
    setMenuBar(mb);
    JMenu fileMenu = new JMenu ("File");
    mb.add(fileMenu);
    fileMenu.add (newMT = new JMenuItem ("New", new MenuShortcut(KeyEvent.VK_N)));
    newMT.addMenuListener( new NewCommand());
    fileMenu.add (openMT = new JMenuItem ("Open", new MenuShortcut(KeyEvent.VK_O)));
    openMT.addMenuListener( new LoadFileCommand());
    fileMenu.add (saveAsMT = new JMenuItem ("Save As"));
    saveAsMT.addMenuListener( new SaveAsFileCommand());
    fileMenu.add (exitMT = new JMenuItem ("Exit"));
    exitMT.addMenuListener( new CloseCommand());
    JPanel p3 = new JPanel();
    p3.setLayout(new FlowLayout(FlowLayout.CENTER));
    ta = new JTextArea(20, 60);
    p3.add(ta);
    setLayout(new FlowLayout(FlowLayout.CENTER)); // this overides everything, why?
    add(p3);
    }

    menuSelected is a Abstract method. That means if you implement the MenuListener Class you SHOULD define the menuSelected() event.
    I am not correct with the Method names but logically it seems that tis is the problem.
    Another thing, use setJMenuBar() instead setMenuBar()
    Regards ,
    Karan

  • Error in portlet JSP

    while trying to run JSP, its giving me following error.Pls hep me the approach i need to follow.
    "Error 500: /helloworld/jsp/edit.jsp(1,0) Unable to load class com.ibm.wps.pe.pc.legacy.tags.InitTag "
    i have already included the following code in JSP.But then also i m getting the same
    <%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portletAPI'%>
    <portletAPI:init/>

    Sounds like something's missing from your CLASSPATH.
    Gotta put the JAR with the missing class in your WEB-INF/lib OR the .class file in your WEB-INF/classes.

  • Error Page in JSP Having Problems.

    Hi all,
    I am having some issues with error pages in JSP.
    I am trying to display one simple error image when my JSP is having any kind of error, let’s say when it throws any exception. Here goes the code…
    throwError.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ page errorPage="errorPage.jsp"  %>
    <html>
    <body>
    Hello All,
    <%! int x = 12/0; %>
    </body>
    </html>errorPage.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ page isErrorPage="true" %>
    <html>
    <body>
    <img src="error.jpg" height="100" width="100">
    </body>
    </html>web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
         <error-page>
         <error-code>500</error-code>
         <location>/errorPage.jsp</location>
         </error-page>
         <error-page>
         <exception-type>java.lang.ArithmeticException</exception-type>
         <location>/errorPage.jsp</location>
         </error-page>
    </web-app>Please see if you can help…
    Currently when I run the throwError.jsp in Eclipse, nothing happens. It shows "500 Internal server error". But the error.jpg doesn't appear on browser. I have copied the error.jpg properly in the WebContent folder of the Web App root.
    Thanks much...
    Goldest

    Raghu,
    You need to fix your syntax:
    <%=someObje.getNo()>
    not
    <=someObje.getNo()>
    Your concept of how to use error.jsp seems correct.
    --BobC                                                                                                                                                                                                                                                                                                   

  • Prompt error message in JSP

    May I know how to prompt an error message in JSP?? can I use alert() as in javascript? what's the proper syntax to do it???

    Just to simplify what is already said: All JSP code, without exception, is executed on the server side, and when the JSP page is shown to the user (client) there is no execution of any JSP CODE, you can only use the information supplied by the JSP code.
    /R

  • Getting compilation errors in seeded jsps in R12

    Hi,
    We already had iStore 11i implemented since 8 years.
    Now we are implementing iStore R12.
    We have a custom jsp 'xxibeCCkpExpCheckout.jsp' in 11i, which we are migrating to R12.
    However in R12 we are getting following compilation errors in this jsp:
    ibeCCkpBHdrShipIncl.jsp:
    Error(841,1): PrintWriter not found
    Error(841,1): Writer not found
    ibeCCkpValBillPay.jsp
    Error(40,2): field optNewCreditCard not found
    Error(48,2): field optNewCreditCard not found
    Error(54,2): identifier errMap not found
    Error(64,2): identifier errMap not found
    Error(73,2): field errMap not found
    Please note that above seeded jsps are included in the custom jsp.
    Since the errors are coming through seeded jsps, we are not sure how to fix them.
    Any prompt help/suggestion in this regard is appreciated.
    Thanks

    Hello,
    Please review your custom jsp and note that the following are obsoleted packages for Release 12 -
    ibeCCkpCHdrShipIncl.jsp, ibeCCkpHdrShip.jsp, ibeCCkpHdrBillPay.jsp
    Confirm the ibeCCkpBHdrShipIncl.jsp is Release 12.1 version (ie version 120.6).
    Also, there are changes in ibeCCkpValBillPay.jsp for Release 12 as compared to 11i. Confirm your ibeCCkpValBillPay.jsp is Release 12.1 version (ie version 120.1.12010000.2 or higher).
    Confirm no errors for manual compile of the seeded jsp's and Confirm datestamp is current for class files in $COMMON_TOP/_pages
    References:
    Where Are The iStore Cached Java Classes In R12 ? (Doc ID:1149243.1)
    How to Enable Automatic Compilation of JSP pages in R12 Environment (Doc ID:458338.1)
    Please advise on any additional questions or issues.
    Thank You,
    Deborah Bourgeois, Oracle Customer Support

  • Error:the prefix "jsp"  for element "jsp:scriptlet" is not bound

    i got this error:
    the prefix "jsp"  for element "jsp:scriptlet" is not bound.how can i remove this error.

    Add this to the jsp:root tag
    xmlns:jsp="http://java.sun.com/JSP/Page"
    How did it get removed from your JSP?
    (assuming you are using Sun Java Studio Creator)

Maybe you are looking for

  • Regarding Purchase order fetching

    Hi All, I have retrived Sales order items in my program. <b>Based on Sales orders Data[VBELN,VBELP etc] i need to fetch Purchase Order Data [EBELN, EBELP etc].</b>. How we can achieve this. What will be the logic! Thanks in advance. Thanks & Regards,

  • Mail will not stay as default email reader

    I have the mysterious problem facing a computer newly installed MacBook Air 2012 with 10.8.2. It has Parallels, MS Office 2011, but no MS Mail Application. I have another account on this computer that is not affected by this issue. The issue is that

  • How to create Drill through's from BPC to ECC and BEX

    Hi Experts, @Greetings@ Am new to BPC can any one help me on Drill trough's. I want to create a drill through to ECC system and BEX Query. Thanks for support in advance. Regards, Harini.

  • Security guide for PI 7.1

    Hi all, Can anybody tell me if there is a security guide available for PI 7.1 ? regards, Loveena .

  • Problem calling SAP webservice ECC_SRVCREQCRTRC1

    Hi, I want to call an SAP webservice to create a service notification from an Adobe Flex application. For this I use a standard SAP enterprise web service "ECC_SRVCREQCRTRC1". The web servce call is working and the notification is created. Now I also