Error: cannot be resolved to type

Hi Guys,
I downloaded an application to launch an RTP client/server but I cannot compile it, yhe error message is below:
vmplanet@vmplanet-desktop:~/JavaRTP/playerv1$ make
javac Client.java
1. ERROR in Client.java (at line 306)
     RTPpacket rtp_packet = new RTPpacket(rcvdp.getData(), rcvdp.getLength());
     ^^^^^^^^^
RTPpacket cannot be resolved to a type
2. ERROR in Client.java (at line 306)
     RTPpacket rtp_packet = new RTPpacket(rcvdp.getData(), rcvdp.getLength());
     ^^^^^^^^^
RTPpacket cannot be resolved to a type
2 problems (2 errors)make: *** [Client.class] Error 255
Can anyone help me with this error.
Thanks alot..

Thanks for the response jverd, I got it from "http://www.mobilelife.eu/OSU/classes/multimedia-networking-streaming.php" and the instructions just say to type make and it will compile all, I then tried to compile all of the files separately but that did not work either. On the website they say that it will work under RedHat and Solaris but I am using Ubuntu, this shouldn't make a difference with Java should it?
Also in the tar file I downloaded there is an RTPpacket.java file, I tried to compile it first but that did not help..
Thanks

Similar Messages

  • Error "Cannot be resolved to a type" on OwnerPIN, APDU, ISO7816

    The error I'm reffering to might clearify the fact that I'm new at Java/javaCard-development.
    To learn how it all works I've downloaded an example and try to understand what happens.
    I opened the source in Eclipse and get errors "Cannot be resolved to a type" on OwnerPIN, ADPU and ISO7816 classes. I have an Import javacard.framework statement and expected these types to be part of this library.
    I guess I'm forgetting something somewhere but couldn't find the soluiton on internet.
    import javacard.framework.*; // import all neccessary packages for java card*
    import java.applet.;
    import java.lang.Object;
    public class classpgdata extends Applet {
    final static byte PROP_CLASS = (byte) 0x80; // Class of the proprietary APDU commands
    static {color:#ff0000}OwnerPIN{color} pin; // the PIN object
    public void process({color:#ff0000}APDU{color} apdu) {
    byte[] cmd_apdu = apdu.getBuffer();
    if (cmd_apdu[{color:#ff0000}ISO7816{color}.OFFSET_CLA] == {color:#ff0000}ISO7816{color}.CLA_ISO7816) {
    //----- it is the ISO/IEC 7816 class
    switch(cmd_apdu[{color:#ff0000}ISO7816{color}.OFFSET_INS]) { // check the instruction byte
    case INS_SELECT: // it is a SELECT FILE instruction
    ...

    Hi,
    What you need to do update your Java build path fr the project in your Eclipse project.
    Project -> Properties then find Java Build Path.
    In the Libraries tab add the {JCDK Home}/lib/javacardframework.jar by clicking the add external JARs button. You may also want to remove the standard Java Runtime (JRE) libraries as you do not build against these.
    If you want to use the JC 2.2.1 CAP file converter, you may also want to ensure that the Eclipse compiler is set to compile as Java 1.3 in the Java Compiler section of the project properties.
    KeesdeVink wrote:
    import javacard.framework.*; // import all neccessary packages for java card
    import java.applet.*;
    import java.lang.Object;
    It also looks like you have added two imports you don't actually want. You only need the javacard.framework.* import.
    Cheers,
    Shane
    Edited by: safarmer on 23/09/2009 08:00

  • Errors Cannot process authentication server type *invalid_group_handle

    Any idea what is these errors is about?
    My wireless A.P is giving me these errors?

    “errors Cannot process authentication server type *invalid_group_handle” This kind of error due to the method list function encountered a server type that was unknown, or could not be handled. This may be due to a server misconfiguration.

  • Include JSP in JSP - Error:  cannot be resolved to a type

    Hello,
    Several of my jsp pages include other jsp pages. The project has many errors: "x cannot be resolved to a type". Is there a way to resolve these errors? Below is a small example of the issue:
    JSP #1:
    <%@ page import="com.testing.Introduction" %>
    <html>
    <head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Hello</title>
    </head>
    <body>
    <%
         Introduction intro = new Introduction();
         String speak = intro.sayHello();
    %>
    <p><%=speak %></p>
    <%@ include file="Name.jsp" %>
    </body>
    </html>  JSP #2:
    <html>
    <head>
    <title>Name</title>
    </head>
    <body>
    <%
         String speak2 = intro.sayName();
    %>
    <p>
    <%=speak2 %>
    </p>
    </body>
    </html>Class:
    package com.testing;
    public class Introduction
         public static void main(String[] args) {
         public Introduction() {
              super();
         public String sayHello() {
              return "Hello";          
         public String sayName()     {
              return "My name is Sam";
    }The error shows up in Name.jsp; the issue is with "intro". Any ideas how to resolve this issue?
    Thank you in advance for your help!

    The jsp page Name.jsp appears to be missing the import statement that appears in the first page.
    <%@ page import="com.testing.Introduction" %>The included file is included character for character into the main page which is then treated as a single jsp page for the response. The include directive is invoked at the time of page translation. Given this, I don't see the purpose of using the <html> <head> and <title> tags in the second and included page. I don't think that this suggests the proper purpose of the include directive.
    Note too that if the included file changes, all of the jsp files that call this file need to be updated as well. Servers can handle the alteration of the main jsp, but may not serve the altered content if the included file changes.
    For more information see here. http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro8.html

  • Error: "cannot be resolved or is not a type" of webservice proxy class

    Hello I'm novice in Web Dyn Pro, could you please assist me.
    I have project that was developed before by others, now I encountered with errors during compilation of web service project based on ejb. If more concretely, problems occured in one auto-generated proxy class that refer to another proxy class that I don't know why was absent.
    Problems occures in lines like this
    com.accenture.mdp.company.model.companybasic.proxies.DefaultServiceImpl service = com.accenture.mdp.company.model.companybasic.CompanyBasic. getServiceImpl ();
    Error com.accenture.mdp.company.model.companybasic.proxies.DefaultServiceImpl cannot be resolved or is not a type     Request_CompanyServiceViDocument_addCompany.java
    I suppose that exists the way to generate absented proxies automaticaly, may be by using wizards, but I don't know how.
    Could anybody help me ?

    Hi Sergy,
    Welcome to SDN!
    Did you try Repair, Reload and Rebuild options?
    (Right click on the project, you will get the options)
    If still the problem exists, Close and Open the project.
    Check the versions of your NWDS and the project developed NWDS are same?
    Regards,
    Siva

  • ERROR  cannot drop or replace type

    i have this code

    i have this code
    CREATE OR REPLACE TYPE PREMIER."SYS_PLSQL_63035_9_1"           
    You may have that code but you did NOT create that TYPE. When an object has a name like that it usually means that it was created by Oracle.
    One use case when Oracle does that is when you create a PIPELINED function in a package and the function uses PL/SQL types. Behind the scenes Oracle will create two or three SQL types so support that function properly. When it does it gives them names like the one you posted.
    See Solomon's answer in this thread for a discussion of the object types Oracle will create behind-the-schenes for PIPELINED functions
    https://forums.oracle.com/message/10425909?
    A PIPELINED function needs to return a collection and the collection is typically based on a scalar object type.
    So your problem is likely that the type whose code you posted is the SQL scalar object type that Oracle created and there is another type with a name like 'SYS%' that is defined as:
    CREATE OR REPLACE TYPE SYS_PLSQL_nnn as TABLE OF SYS_PLSQL_63035_9_1;
    Since that collection type depends on the scalar type you cannot modify the scalar type unless you drop the collection type and then rebuild it.
    Which begs the question: why are you MUCKING with object types that were implicitly created by Oracle?
    DON'T DO THAT unless you know EXACTLY what you are doing. You will likely break something that you should not be messing with.

  • Cannot process accounting server type *invalid_group_handle*

    Dear all
       I   deploy ACS 5.2  for my network devices. everything is work,but some devices had a log ,could you explain this log?
    <%AAA-3-BADSERVERTYPEERROR: Cannot process accounting server type *invalid_group_handle*>

    “errors Cannot process authentication server type *invalid_group_handle” This kind of error due to the method list function encountered a server type that was unknown, or could not be handled. This may be due to a server misconfiguration.

  • I am getting this error - JspFormsSession cannot be resolved to a type

    Hi
    I am getting following error when I try to open a jsp file.
    Any solution?
    JSP line details are -
    JspFormsSession openrules_session = (JspFormsSession) session.getAttribute(s_attr);
    Error is -
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    Now I am confident that the problem is with library including, as the same thing happens with other libraries.
    I found that such a warning appears every time:
    Classpath entry /jspbook/src/lib/mail.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.Unfortunately, I've no idea how to include this in a proper way. I think that setting it in "Add External JARs" in "Java Build Path" is enough... or not?
    Seems we're close to solve the problem. May be this screen shot will be helpful to determine the problem?
    http://img257.imageshack.us/img257/3967/screenshotjavaeejspbook.png
    You can see that libraries are included in the Project Explorer

  • What is cannot be resolved to a type error?

    When i run jsp programs, am getting :
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 6 in the jsp file: /dbcoffee.jsp
    Generated servlet error:
    CoffeeQBean cannot be resolved to a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    what does cannot be resolved to a type mean?

    I am getting the same error but while creating a Web Service.
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         _service cannot be resolved
         _serviceClient cannot be resolved
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         _serviceClient cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         The constructor TemperatureConverterStub(null, String) is undefined
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         _operations cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         at ws.example.TemperatureConverterStub.<init>(TemperatureConverterStub.java:17)
         at ws.example.TemperatureConverterServiceClient.main(TemperatureConverterServiceClient.java:8)If you want I can post the files too.

  • Runtime error - Session cannot be resolved to a type

    Hello! I try to get JavaMail working, but all in vain.
    The problem is I get such an error every time.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved to a type
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)I'm using Eclipse, so I've added external JARs there (activation.jar, mail.jar, mailapi.jar, pop3.jar, smtp.jar). In addition to this, the same libraries are in +/opt/jdk1.6.0_13/jre/lib/+.
    I've imported javax.mail.*, java.util.*, javax.mail.internet.* in my JSP file. I tried to do a lot of manipulations. Also I tried to use different code examples, but the error in the line "Session.getInstance(props, null)" remains the same.
       Properties prop = new Properties();
       prop.put("mail.smtp.host",hostMail);
       prop.put("mail.smtp.user",fromEmail);
       prop.put("mail.smtp.auth","true");
       Session ses =  Session.getInstance(prop,null);The same problem remains when I do this as a Servlet. Class compilation with javac occurs without errors.
    Might the problem be in version compatibility? I use: ArchLinux, Tomcat 5.5, JavaMail 1.4.2.
    Thanks in advance.
    Edited by: Pavel_Z on May 7, 2009 4:55 PM

    Now I am confident that the problem is with library including, as the same thing happens with other libraries.
    I found that such a warning appears every time:
    Classpath entry /jspbook/src/lib/mail.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.Unfortunately, I've no idea how to include this in a proper way. I think that setting it in "Add External JARs" in "Java Build Path" is enough... or not?
    Seems we're close to solve the problem. May be this screen shot will be helpful to determine the problem?
    http://img257.imageshack.us/img257/3967/screenshotjavaeejspbook.png
    You can see that libraries are included in the Project Explorer

  • 'Jpanel' cannot be resolved to a type error

    Hi all,
    I need to pass a Jpanel to an object. I have added my code below.
    public void createFrame(Object panel){
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.getContentPane().add( (Jpanel)panel);
              frame.pack();
              frame.setVisible(true);
         }In this
    frame.getContentPane().add( (Jpanel)panel);shows error as 'Jpanel' cannot be resolved to a type.
    What is the correct approach for this?
    Please help.
    Rony

    Also, why is your method parameter an Object? Why not a JPanel or at least a JComponent?

  • GEF4 Setup Error - FXCanvas cannot be resolved to a type

    Hallo,
    I tried to setup the development environment for GEF4, as specified in the GEF Contributor guide, and I found the following error:
    FXCanvas cannot be resolved to a type.
    (se attached file)
    This error is persistent, and it seems i am not able to find a solution despite I tried multiple times to setup the environment, as specified in the GEF/GEF4 contributor guide .
    This is the list of steps I followed for the setup
    Check Java 8 (oracle) is installed, that is required by the e(fx)clipse plugin.
    Download Eclipse IDE for Eclipse Committers. In my case: eclipse-committers-mars-R-win32.zip
    Install plugins needed by GEF4, in my case:
    e(fx)clipse - IDE, from http://download.eclipse.org/efxclipse/simrel-contrib/mars/m7/tools/site
    e(fx)clipse - IDE - PDE, from http://download.eclipse.org/efxclipse/simrel-contrib/mars/m7/tools/site
    API Tools Execution Environment Descriptions, from: http://download.eclipse.org/eclipse/updates/4.5-I-builds
    Oomph Version Management, from: http://download.eclipse.org/releases/mars'
    Maven Integration for Eclipse (includes Incubating components), from: http://download.eclipse.org/releases/mars
    Clone the GEF4 Git repository and import the projects in the workspace
    Set MARS.target: from org.eclipse.gef4.target project, double click the target definition, wait for the target is fully resolved, and click on "set as target platform".
    Adjust preferences. select Menu > Window > Preferences:
    Java > Compiler > Errors/Warnings: ignore the "Deprecated and restricted API"
    Plug-in Development > Compilers: Ignore the "References to discouraged classes"
    At the end of the setup, I can not compile the GEF4 project, because "FXCanvas cannot be resolved to a type. "
    See image.
    Does anyone has an idea on how to fix this ?
    Kind Regards.
    Patrik

    I updated the respective section of the contributor guide to make it even more explicit, why the "Specify Execution Environment for J2SE-1.7 (and optionally J2SE-1.8)" is important. I also saw that the guide still listed the e(fx)clipse 2.0.0 Mars M7 contribution. I updated it to refer to the e(fx)clipse 2.0.0 Mars release. You might want to update your IDE accordingly.

  • Cannot be resolved to a type

    Hello everybody,
    An error occurred while executing these codes
    <%@page import="examples.simple.ActiveClass" %>
    try
    String userId=request.getParameter("userID");
    String activateCode=request.getParameter("activationCode");
    ActiveClass object=new ActiveClass();
    String status=object.Activate(userId);
    if(status.equals("success"))
    ok
    catch(Exception e)
    The error displayed was:
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 25 in the jsp file: /simple/activeAccount.jsp
    ActiveClass cannot be resolved to a type
    22: String userId=request.getParameter("userID");
    23: String activateCode=request.getParameter("activationCode");
    24:
    25: ActiveClass object=new ActiveClass();
    26: String status=object.Activate(userId);
    27:
    28: if(status.equals("success"))
    Can anyone help me out please?

    * ActiveClass.java
    * Created on August 31, 2007, 3:04 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package examples.simple;
    import javax.sql.DataSource;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import examples.sql.connect;
    * @author Administrator
    public class ActiveClass {
    int userId;
    Connection con=null;
    /** Creates a new instance of ActiveClass */
    public ActiveClass() {
    public String Activate(String userId)
    this.userId=Integer.parseInt(userId);
    try
    connect conn=new connect();
    con=conn.createConnection();
    Statement stmt=con.createStatement();
    String sql="UPDATE registered_user SET user_privileges='Y' WHERE user_id = "+this.userId;
    if(stmt.executeUpdate(sql)==1)
    return "success";
    else
    return "failure";
    catch (SQLException ex)
    ex.printStackTrace();
    return "failure";
    }

  • JspWriter cannot be resolved to a type

    The following is CheckAddress.jsp page which checks if the form has the name and phone fields filled in or not. If not then it must print the errors. But the problem I am having is that the Eclipse is showing me the error "JspWriter cannot be resolved to a type".
    If I ignore this error and run the page in the j2ee preview server in eclipse than I get the following error:
    >
    Unable to compile class for JSP
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    Caused by:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    >
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <%--Provide Directives to inform JSP of packages needed--%>
    <%@page language="java" import="java.util.*"%>
    <%@page language="java" import="java.io.*"%>
    <%--Specify JSTL tag library for use --%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <meta http-equiv="Content-Type" content="text/html; charaset=ISO-8859-1">
    <title>Check Address</title>
    </head>
    <body>
    <%--Declare the java bean for the addresslist to be queried --%>
         <jsp:useBean id="dbab" class="addressBean.DBAddressBean" />
    <%--Use JSP scripting elements to define two methods --%>
    <%!
         List<String> checkAddress(String Name, String Phone){
          List<String> errors = new ArrayList<String>();
          if((Name == null) || (Name.equals(""))){
               errors.add("Name must not be blank");
          if((Phone == null)||(Phone.equals(""))){
               errors.add("Phone must not be blank");
          return errors;
         void printErrors(JspWriter out, List<String> errors) throws IOException{
              //Report the errors
              out.prinln("<p class=\"error1\">The following errors occured: <br />");
              out.prinln("<ul>");
              Iterator<String> i = errors.iterator();
              while(i.hasNext()){
                   out.println("<li type=\"disc\">"+i.next()+"</li>");
              out.prinln("</ul></p><p><b>please try again</b></p><br />");
    %>     
    <%--Use the internal Scriptlet to call an internal method and get the request parameters with the form info--%>
    <%
         List<String> errors = checkAddress(request.getParameter("Name"), request.getParameter("Phone"));
    %>
    <%--Use JSTL tags to get the values of the parameters for all of the form info --%>
         <c:set var="aid" value="${param.aid}"/>
         <c:set var="Name" value="${param.Name}"/>
         <c:set var="Street" value="${param.Street}"/>
         <c:set var="City" value="${param.City}"/>
         <c:set var="State" value="${param.State}"/>
         <c:set var="Zip" value="${param.Zip}"/>
         <c:set var="Phone" value="${param.Phone}"/>
    <%--Use JSP elements to set the values in the Java Beans--%>
         <jsp:setProperty name="dbab" property="id" value="${aid}"/>
         <jsp:setProperty name="dbab" property="name" value="${Name}"/>
         <jsp:setProperty name="dbab" property="street" value="${Street}"/>
         <jsp:setProperty name="dbab" property="city" value="${City}"/>
         <jsp:setProperty name="dbab" property="state" value="${State}"/>
         <jsp:setProperty name="dbab" property="zip" value="${Zip}"/>
         <jsp:setProperty name="dbab" property="phone" value="${Phone}"/>
    <%--Use the scriptlet to determine where to go now --%>
    <%--Notice how the JSP element tag is used within the scriptlet, the scriptlet needs to be "closed" and "reopened"--%>
    <%
         if(errors.size()==0){
              dbab.saveChanges();
              response.sendRedirect("AddressList.jsp");
         }else{
              //print errors
              printErrors(out, errors);
    %>          
         <jsp:include page="EditAddress.jsp"/>
    <%
    %>     
    </body>
    Edited by: blinkaj on Apr 18, 2010 2:15 AM

    Thanks elOpalo, even though eclipse is still showing the error, things are running fine after I rectified my typing mistake about the prinln. :)

  • Table error - Context Path Cannot Be Resolved (Last Node Is Empty)

    Hi All,
    I am dynamically building up a context node called PoList which is used to hold the contents of a table.
    My BAPI is called and a routine transfers the contents of the BAPI context node across into the POList context node. This is rendered correctly on the screen. There is a routine which filters the results based on a vendor. The code works fine when some records are found but when no records are found, I get the error "Context Path POLIST.EBELN Cannot Be Resolved (Last Node Is Empty) ".
    The cardinality of the PoList node is 0..N. This should mean that 0 records is valid.
    The ABAP which fills the context is pasted below :
    data:
        Node_Z_Bapi_Po_Combined             type ref to If_Wd_Context_Node,
        Node_Changing_Po                    type ref to If_Wd_Context_Node,
        Node_T_Header                       type ref to If_Wd_Context_Node,
        Elem_T_Header                       type ref to If_Wd_Context_Element,
        itab_C_T_Header    type If_Componentcontroller=>Elements_Polist,
       stru_C_T_Header    like line of itab_C_T_Header,
        Stru_T_Header                       type If_Componentcontroller=>Element_T_Header .
      data:
        Node_Polist                         type ref to If_Wd_Context_Node,
        Elem_Polist                         type ref to If_Wd_Context_Element,
        Stru_Polist                         type If_Componentcontroller=>Element_Polist.
      data:
    lri_Element    type ref to if_Wd_Context_Element,
    loa_Elements   type Wdr_Context_Element_Set.
    navigate from <CONTEXT> to <Z_BAPI_PO_COMBINED> via lead selection
      Node_Z_Bapi_Po_Combined = wd_Context->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Z_Bapi_Po_Combined ).
    navigate from <Z_BAPI_PO_COMBINED> to <CHANGING_PO> via lead selection
      Node_Changing_Po = Node_Z_Bapi_Po_Combined->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Changing_Po ).
    navigate from <CHANGING_PO> to <T_HEADER> via lead selection
      Node_T_Header = Node_Changing_Po->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_T_Header ).
    navigate from <CONTEXT> to <POLIST> via lead selection
      Node_Polist = wd_Context->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Polist ).
      loa_Elements = node_T_Header->get_Elements( ).
      loop at loa_Elements[] into lri_Element.
        lri_Element->get_Static_Attributes(
          importing Static_Attributes = stru_C_T_Header ).
    Get the vendor number
        if i_lifnr is initial.
          insert  stru_C_T_Header into table itab_C_T_Header[].
        elseif i_lifnr = stru_c_t_header-lifnr.
          insert stru_C_T_Header into table itab_C_T_Header[].
        endif.
      endloop.
      data : W_LINES TYPE I.
      describe table itab_c_t_header lines w_lines.
      if w_lines eq 0.
        node_Polist->set_lead_selection_index( 0 ).
        CALL METHOD NODE_POLIST->INVALIDATE.
      else.
        node_Polist->bind_Table( itab_C_T_Header ).
        clear itab_C_T_Header[].
      endif.
    I would have though that invalidating the node would blank the context node and mean that the table is empty but instead I get an error.
    Please help.
    Richard

    Hi Richard,
    The problem here is that some UI element tries to bind against a node where the parent node is empty. You have to make sure that the last but one node has at least 1 element, otherwise you should hide the UI element (visibility = NONE).
    If the lead selection were empty, the corresponding error message would tell you this, but it explicitely says: "Last Node is Empty", and you can trust it.
    One possibility to have at least one element in the node is to change the cardinality to 1..n. If you have a supply function for this node, you have to make sure that there is at least 1 element (bind empty structure to the node), otherwise the framework creates the first element for you.
    Ciao, Regina

Maybe you are looking for