Servlet cannot access bean

Hi all,
I am having some problems accessing JavaBeans from my servlets, but I can access them from my JSP page(i used the import command, <%@ page import="servlets.myBeans.login.User" %>, and it works).
I have placed my User bean in the following package
\webapps\ROOT\WEB-INF\classes\servlets\myBeans\login
Here's the java code for User Bean
package servlets.myBeans.login;
* A simple Java Bean for users.
public class User implements java.io.Serializable{
private String username = null;
private String password = null;
public User() {}
public User (String u, String p) {
     username = u;
     password = p;
public String getUsername() {
     return username;
public void setUsername(String username) {
     this.username = username;
public String getPassword() {
     return password;
public void setPassword(String password) {
     this.password = password;
public String toString() {
     return username + ":" + password;
This compiles and creates a class file.
My servlet LoginControlServlet is in the following path
\webapps\ROOT\WEB-INF\classes\servlets
when I try to compile this servlet i get the following errors
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk14\webapps\ROOT\
WEB-INF\classes\servlets\LoginControlServlet.java:18:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
User up = (User)session.getAttribute("up");
^
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
\WEB-INF\classes\servlets\LoginControlServlet.java:18:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
User up = (User)session.getAttribute("up");
^
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
\WEB-INF\classes\servlets\LoginControlServlet.java:27:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
up = new User(user,pass);
^
3 errors
I have already included the \webapps\ROOT\WEB-INF\classes in my class path
infact, I have even included \webapps\ROOT\WEB-INF\classes\servlets and
\webapps\ROOT\WEB-INF\classes\servlets\myBeans\login in my classpath.
Any ideas, as to why I am having the above errors.
thanks,
manish

I think it's pretty much got to be a compile time classpath problem. Either your bean is compiling to a funny place, or you classpath is wrong when you compile the servlet. Probably the latter if your jsp picks it up OK.
The entry in the classpath should be
<tomcat directory>/webapps/ROOT/WEB-INF/classes
Check the syntax carefully.
putting package directories on your classpath can only confuse things.
Make sure that ...../webapps/servlets/myBeans/login/User.class exists.

Similar Messages

  • Portal runtime error: Cannot access bean property

    Dear all,
    Does anybody have a clue what problem might couse the <b>Portal Runtime Error</b> described below?
    It does seem to occur when a second user wants to access the <b>Component</b>.
    <b>Portal Runtime Error</b>
    An exception occurred while processing a request for :
    iView : pcd:portal_content/com.xxxxx.luminaires/com.xxxx.iviews/Quotations/EasyQuote
    <b>Component</b> Name : EasyQuoteDemo.EasyQuoteComponent
    Tag tableView attribute model: Cannot access bean property quotationHeader.CurrentTableModel in page context.
    Exception id: 04:50_21/09/04_0070
    See the details for the exception ID in the log file
    Thxs in advance
    Joost

    Hi Dominik,
    Having a closer look at the problem, we found it is not the number of users.
    It seems our JAVA components keeps the conenctions with SAP open and reopens a new one every time we start the component.
    If we finished solving the problem, I will publish the solution.
    Greetings,
    Joost

  • Servlet cannot find Bean

    I am trying to access a java bean through a servlet..
    the bean is defined in the package com.mycomp
    when i use this bean using test.jsp it works fine it finds the package com.mycomp.. but when i am using the Servlet it cannot find the package...when i am trying to compile the servlet it says it cannot resolve the symbol class ConnectionBean
    it cannot find the package com.mycomp
    your help will be appreciatied....
    here is the structure of files:
    tomcat
    webapps
    myapp
    jsp
    -test.jsp
    WEB-INF
    classes
    -PropertyServlet.java
    -PropertyServlet.class
    -ConnectionBean.java
    com
    mycomp
    -ConnectionBean.class
    I have tried importing in the servlet import com.mycomp.*; but i still get an error com.mycomp not found...
    I have also tried importing the class itself by import com.mycomp.ConnectionBean;
    I still get the package com.mycomp not found;
    is there any xml file or anything that i need to edit so servlets can read the packages located in classes folder?

    me also same problem...
    this class path is included in server itself..
    or we can set during compiling time...
    then this is my compile.bat file please check
    set classpath=%CLASSPATH%; ./WEB-INF/classes;
    @echo off
    javac -d ./WEB-INF/classes/ ./dev/beans/*.java
    javac -d ./WEB-INF/classes/ ./dev/ContentManagement/beans/*.java
    javac -d ./WEB-INF/classes/ ./dev/servlets/*.java
    and my servlet file like this below..
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.deploy.servlet.*;
    public class ControlServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("Testing");
    /*          if (request.getParameter("pageName")=="CEOSpeak")
                   CEOBean CB = new CEOBean();
                   if (request.getParameter("actionType")=="add")
                   else if (request.getParameter("actionType")=="edit")
                   else if (request.getParameter("actionType")=="delete")
                        if(CB.deleteCEO(request.getParameter("CEOId")))
                             response.sendRedirect("CEO_Speaks.jsp");

  • Servlet- JSP- Servlet - cannot access parameters.

    I have a login.html page which then sends it's data to a LoginServlet. This in turn generates HTML which is stored as a string and passed to the session by:
    session.setAttribute("html", menuGenerator.generateLoginMenu());
    I then do:
    request.getRequestDispatcher("Common/LoginPortal.jsp").forward(request, responsePassed);
    And in the LoginPortal.jsp I have the lines:
    <% String html = (String)session.getAttribute("html"); %>
    <%=html%>
    The page displays fine (it's another Form). However when that form posts to PageServlet, when doing request.getParameter("blah"); OR request.getAttribute("blah");I get null as the return. I have tried doing:
    <% session.setAttribute("userID", "1234"); %> and
    <% request.setAttribute("userID", "1234"); %>
    Both times I still get null as the return.
    Any ideas?
    -Note: Both forms are using the "post" method, and both servlets are correctly defined w/ doPost(....)

    Excuse the formatting on the HTML page - I spaced it out a little bit, but since it goes to the page as a long string, there isn't any formatting when viewing the source...
    (all spacing got messed up by posting here... if you can't read it, lemme know and I'll post a file somewhere)
    LoginPortal.JSP (actual file):
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <% String html = (String)session.getAttribute("html"); %>
    <html>
    <style><!--
    input { width : 23ex; }
    --></style>
    <script language="JavaScript" type="text/javascript">
         <!--
    function SelectPage(pageName, Param0, Param1, Param2, Param3)
    //loads the parameter information into the form.
    //PageLocation, Param0, Param1, Param2, Param3
    document.getElementById("PageToLoad").value = pageName;
    document.getElementById("Parameter0").value = Param0;
    document.getElementById("Parameter1").value = Param1;
    document.getElementById("Parameter2").value = Param2;
    document.getElementById("Parameter3").value = Param3;
    //disables all the buttons on the page.
    for(var i = 0; i < document.TestForm.elements.length; i++)
    document.TestForm.elements.disabled = true;
    //All the information is loaded... submit it.
    document.TestForm.submit();
    -->
         </script>
    <head>
         <title>Login Portal</title>
    <link rel=stylesheet type="text/css" href="Common/CSS_main.css">
    <% String sessionID = (String)session.getAttribute("sessionID"); %>
    <% String mainPageName = (String)session.getAttribute("mainPageName"); %>
    <% String userId = (String)session.getAttribute("userId"); %>
    </head>
    <body>
         <H2>Welcome <%=userId%>, Please choose from the following: </H2><br>
    <%=html%>
    </body>
    </html>
    ACTUAL PAGE DISPLAYED:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <style><!--
    input { width : 23ex; }
    --></style>
    <script language="JavaScript" type="text/javascript">
         <!--
    function SelectPage(pageName, Param0, Param1, Param2, Param3)
    //loads the parameter information into the form.
    //PageLocation, Param0, Param1, Param2, Param3
    document.getElementById("PageToLoad").value = pageName;
    document.getElementById("Parameter0").value = Param0;
    document.getElementById("Parameter1").value = Param1;
    document.getElementById("Parameter2").value = Param2;
    document.getElementById("Parameter3").value = Param3;
    //disables all the buttons on the page.
    for(var i = 0; i < document.TestForm.elements.length; i++)
    document.TestForm.elements[i].disabled = true;
    //All the information is loaded... submit it.
    document.TestForm.submit();
    -->
         </script>
    <head>
         <title>Login Portal</title>
    <link rel=stylesheet type="text/css" href="Common/CSS_main.css">
    </head>
    <body>
         <H2>Welcome all, Please choose from the following: </H2><br>
    <table > <form name="TestForm" method="post" action="PageServlet" >
    <TR><TD><B><U>ACR Document:</B></U></TD></TR><TR></TR>
    <TR><TD>��������<input type="submit" id="ACRDocument" name="ACRDocument" value="ACR Document" onclick="SelectPage('ACRDocument','#','#','#','#')"> </TR></TD>
    <TR><TD><B><U>Damage Reporting:</B></U></TD></TR><TR></TR>
    <TR><TD>��������<input type="submit" id="DamageReportingWeb" name="DamageReportingWeb" value="Damage Reporting Web" onclick="SelectPage('DamageReportingWeb','#','#','#','#')"> </TR></TD>
    <TR><TD><B><U>Police:</B></U></TD></TR><TR></TR>
    <TR><TD>��������<input type="submit" id="PoliceArea" name="PoliceArea" value="Police Area 1" onclick="SelectPage('PoliceArea','1','#','#','#')"> </TR></TD>
    <TR><TD>��������<input type="submit" id="PoliceFreightClaims" name="PoliceFreightClaims" value="Police Freight Claims" onclick="SelectPage('PoliceFreightClaims','#','#','#','#')"> </TR></TD>
    <TR><TD>��������<input type="submit" id="PoliceMilitaryShipments" name="PoliceMilitaryShipments" value="Police Military Shipments" onclick="SelectPage('PoliceMilitaryShipments','#','#','#','#')"> </TR></TD>
    <tr ><td><input type="text" size="30" name="PageToLoad" id="PageToLoad" value="#"/></td><td><input type="text" size="30" name="Parameter0" id="Parameter0" value="#"/></td>
    <td><input type="text" size="30" name="Parameter1" id="Parameter1" value="#"/></td><td><input type="text" size="30" name="Parameter2" id="Parameter2" value="#"/></td>
    <td><input type="text" size="30" name="Parameter3" id="Parameter3" value="#"/></td>
    </tr></table> <center>
    <input type="button" id="button2" name="button2" value="Log Out" onclick="this.disabled=true;window.location='changePassword.html'">
    ��������
    <input type="button" id="button2" name="button2" value="SET THESE" onclick="this.disabled=true;window.location='changePassword.html'"></form>
    </body>
    </html>
    PageServlet:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class PageServlet extends HttpServlet
         private int count = 1;
         private int id = 0;
         private boolean logInitialized = false;
         private Logger myLogger;
         private String myPageToLoad;
         public void init() throws ServletException
         public void doPost(HttpServletRequest request, HttpServletResponse responsePassed) throws ServletException, IOException
              System.out.println("Within PageServlet");
              HttpSession session;
              RequestDispatcher dispatch;
              String userID;
              session = request.getSession(true);
              String PageToLoad;
              //System.out.println("***TEST**** " + getUserID());
              try
                   //userID = request.getParameter("userId");
                   userID = (String) request.getAttribute("userID");
                   PageToLoad = request.getParameter("PageToLoad");
                   System.out.println("UserID: " + userID);
                   System.out.println("Param Names: " + request.getParameterNames());
                   myPageToLoad = request.getParameter("PageToLoad");
                   System.out.println("Parameter: " + request.getParameter("PageToLoad"));
                   myPageToLoad = myPageToLoad + "/" + myPageToLoad + ".jsp";
                   System.out.println("Page To Load: " + myPageToLoad);
                   System.out.println("Current Dir PageServlet: " + System.getProperty("user.dir"));
                   session = request.getSession(true);
                   session.setAttribute("userId", request.getParameter("userId"));
                   session.setAttribute("PageToLoad", PageToLoad);
                   session.setAttribute("Parameter0", request.getParameter("Parameter0"));
                   session.setAttribute("Parameter1", request.getParameter("Parameter1"));
                   session.setAttribute("Parameter2", request.getParameter("Parameter2"));
                   session.setAttribute("Parameter3", request.getParameter("Parameter3"));
                   System.out.println("To Load: " + myPageToLoad);
                   doLogging("successful", userID);
                   dispatch = request.getRequestDispatcher(myPageToLoad);
                   dispatch.forward(request, responsePassed);               
              catch(Exception e)
                   //myLogger.LogUserAction("Log In", "UNSUCCESSFUL", e.getMessage());
                   System.out.println("login failed " + e.getMessage());
                   //myLogger.writeToErrorLog("UploadServlet", "buildResultsPage()", "Error forwarding to results page. " + e.getMessage());
              char [] blah = new char[9999];
              AuthenticationInterface LDAP3 = new AuthenticationInterface();
              System.out.println("Done!!!" + count + " " + id);
              //CurrentPageInfo.blah();
         private boolean authorizeUser(String userID, String Password)//, String systemName)
         {return false;
              //return myLDAP.isAuthorized(userID, Password);
         public void destroy()
         public void doLogging(String LogArea, String userID)
              try
                   myLogger = new Logger();
                   Settings settings;
                   // now create the Settings class
                   settings = new Settings();
                   settings.setlogFilePath(settings.getBaseDir()+"Logs\\PageServlet.txt");
                   myLogger.setSettingsClass(settings);
                   myLogger.setUserdID(userID);
                   //myLogger.LogUserAction("PageServlet", "SUCCESSFUL", myPageSelected);
                   // and now that the settings have been read, set the logger's settings class
              myLogger.setSettingsClass(settings);
              catch(Exception e)
              System.out.println("Exception Logging in PageServlet" + e);
              if(LogArea == "successful")
                   myLogger.LogUserAction("PageServlet", "SUCCESSFUL", myPageToLoad);
              else if(LogArea == "unsuccessful")
                   myLogger.LogUserAction("PageServlet", "UNSUCCESSFUL", myPageToLoad);

  • Javax.servlet.ServletException: Cannot create bean of class

    People,
    HELP!! I am getting desperate!!!
    I am a newbie when it comes to TOMCAT, but i have been using Blazix before.
    My current system is using APACHE/TOMCAT on a Solaris machine and I keep hitting the same problem. I have gone through the archives but the only thing it states is to check the directory which i have done.
    I keep getting:
    Error 500
    Internal Error
    javax.servlet.ServletException: Cannot create bean of class MyClass
    The code used to work on the Blazix server so i am assuming it is something to do with a config parameter somewhere - but i do not know where. I have checked the directory/package structure and they seem to work. It even serves it when they are html pages not jsp, but obviously wont use the bean. :(
    I can post code if necessary.
    Please help
    Steve

    The FormData.class file is in examples/WEB-INF/classes/ directory.
    Is this wrong? then should it be in a package called examples.steve???
    <TITLE> Poc </TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Generator" CONTENT="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
    <META NAME="Author" CONTENT="Steve Brodie">
    <META NAME="Proof of Concept order entry system" CONTENT="">
    <META NAME="PROOF OF CONCEPT ORDER ENTRY SYSTEM " CONTENT="">
    </HEAD>
    <%@ page import="steve.FormData" %>
    <jsp:useBean id="user" class="steve.FormData"/>
    <jsp:setProperty name="user" property="*"/>
    <FORM METHOD=POST ACTION="SaveDetails.jsp">
    <CENTER>
    <H1>     
    POC CNS demo <BR>
    POC Order Entry System <BR></H1>
    <H2><CENTER>PROOF OF CONCEPT ORDER ENTRY SYSTEM <BR>
    in order to illustrate the use of an new product<BR></H1>
    </CENTER>
    <BODY>
    Please enter the following details: <BR>
    Second name <INPUT TYPE=TEXT NAME=secondName SIZE=20><BR>
    First name <INPUT TYPE=TEXT NAME=firstName SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address1 SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address2 SIZE=20><BR>
    Post Code <INPUT TYPE=TEXT NAME=postCode SIZE=10><BR>
    Phone NO. <INPUT TYPE=TEXT NAME=phone SIZE=10><BR>
    <BR>
    Credit Card<INPUT TYPE=TEXT NAME=credit SIZE=15><BR>
    <BR>
    Quality of Service:
    <SELECT TYPE=TEXT NAME="QoS">
    <OPTION SELECTED TYPE=TEXT NAME=Gold>Gold <BR>
    <OPTION TYPE=TEXT NAME=Silver>Silver <BR>
    <OPTION TYPE=TEXT NAME=Bronze>Bronze <BR>
    </SELECT>
    <BR>
    <BR>
    <INPUT TYPE=RESET>
    <P><INPUT TYPE=SUBMIT>
    <BR>
    <BR>
    <IMG SRC=../images/Cisco.gif>
    </FORM>
    </BODY>
    </HTML>
    package steve;
    * @author Steven Brodie
    * @date
    * @version 0.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FormData {
         String secondName = null;
         String firstName = null;
         String address1 = null;
         String address2 = null;
         String postCode = null;
         int credit = 0;
         int phone = 0;
         String qos = null;
         String file = "out";
         String filex = "xout";
         PrintWriter pout = null;
         PrintWriter xout = null;
         FormData() {
              try {
                   pout = new PrintWriter(new BufferedWriter(new FileWriter(file + ".txt")));
                   xout = new PrintWriter(new BufferedWriter(new FileWriter(filex + ".xml")));
              xout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              xout.println("<OrderEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              xout.println("xsi:noNamespaceSchemaLocation=\"http://machine2.com:8080/xml/xsd/OrderEntry.xsd\">");
              } catch (IOException ioe) {
                   System.err.println("DataFileWriter error ioe on init");
                   ioe.printStackTrace();
                   System.exit(1);
    public void setFirstName( String value ) {
    firstName = value;
              System.out.println(firstName);
              pout.println(firstName);
              xout.println("<firstname value= \"" + firstName + "\"/>");
    public void setSecondName( String value ) {
    secondName = value;
              System.out.println(secondName);
              pout.println(secondName);
              xout.println("<secondname value= \"" + secondName + "\"/>");
    public void setAddress1( String value ) {
    address1 = value;
              System.out.println(address1);
         pout.println(address1);
              xout.println("<address1 value= \"" + address1 + "\"/>");
    public void setAddress2( String value ) {
    address2 = value;
              System.out.println(address2);
              pout.println(address2);
              xout.println("<address2 value= \"" + address2 + "\"/>");
    public void setPostCode( String value ) {
    postCode = value;
              System.out.println(postCode);
              pout.println(postCode);
              xout.println("<postCode value= \"" + postCode + "\"/>");
    public void setCredit( int value ) {
    credit = value;
              System.out.println(credit);
              pout.println(credit);
              xout.println("<creditCard value= \"" + credit + "\"/>");
         public void setPhone( int value) {
              phone = value;
              System.out.println("0" + phone);
              pout.println("0" + phone);
              xout.println("<phoneNo value= \"0" + phone + "\"/>");
    public void setQoS( String value ) {
    qos = value;
              System.out.println(qos);
              pout.println(qos);
              xout.println("<QoS value= \"" + qos + "\"/>");
              xout.println("</OrderEntry>");
              pout.flush();
              pout.close();
              xout.flush();
              xout.close();
    public String getFirstName() {
              return firstName;
    public String getSecondName() {
              return secondName;
    public String getAddress1() {
              return address1;
    public String getAddress2() {
              return address2;
    public String getPostCode() {
              return postCode;
    public int getCredit() {
              return credit;
         public int getPhone() {
              return phone;
         public String getQoS() {
              return qos;

  • Javax.servlet.ServletException: Cannot find bean CustForm in any scope

    while i m running my struts application.. i m getting this error.. can any one pointout wat error is this...
    javax.servlet.ServletException: Cannot find bean CustForm in any scope
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
         at org.apache.jsp.Result_jsp._jspService(Result_jsp.java:100)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         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:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:534)

    hi shanu
    getting in jsp call..
    ERROR [Engine] ApplicationDispatcher[customTag] Servlet.service() for servlet jsp threw exception.
    n this is the action
    <action-mappings >
         <action path="/select" type="customTld.CustAction" name="custform" scope="request">
              <forward name="ok" path="/Result.jsp"/>
         </action>
         </action-mappings >

  • Cannot access directory javax/servlet

    I am having a problem getting started here with Borland JBuilder 8 SE.
    I have Tomcat installed and it runs fine with the servlets/jsp pages I ran from the index page when you first install Tomcat.
    I am running windows 2000. When I installed JBuilder the Java 2 SDK v1.4.1 was installed with it. I have run applets... java.exe is located in the jbuilder folder, don't know if this is a problem. I have set my JAVA_HOME environment variable to point to the bin folder in the 1.4.1 java.exe location.
    I am following a book that works with servlets and jsp primarily. When I typed in my first servlet that I copied from the book, JBuilder gives me a document location error:
    cannot access directory: javax/servlet at line...
    it is pointing to my import statement: "import javax.servlet.*;" and "import javax.servlet.http.*;".
    I have tried to add the servlet.jar file to my project but the results are the same.
    Can anybody give me a hand?
    thanks,
    Rob

    The fastest way for JBuilder to see it is just to create a library for servlet.jar and add it to the project.
    Tools->Configure Libraries->New
    Then browse to the location of the servlet.jar and call the library SERVLET.
    Project->Project Settings->Required Libraries
    Then add this library and try to build your project.
    JBuilder will automatically add it to the classpath when it compiles the project that way.

  • Javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib

    Hi
    i have a form from which i am gettin values and i am using struts to get those values and perform actions in my DAO,
    i am able to retrieve values from DAO but the value is not gettin printed in front end.. its throwing
    "javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope" error
    got any suggestions
    thankx

    Got the solution,. i had closed my <html:form> before closing one of my <html:form>
    thankx

  • Cannot access servlet

    Hi,
    I have a couple of servlets that run on JavaWebServer2.0 which resides on my local computer too.
    Everythings runs fine and correctly on my local computer: I open up a browser, access my local computer and run the servlet, everything seems fine . But when I go to another computer and connect to my computer using IP address, only the HTML and other xml files works, I cannot access/call servlet program from other computer, I got error message whenever my programm request a servlet call. Could anyone tell me what shouldbe change in the server setup/configuration or servlet so that the problems could be fixed.
    Thank you very much
    BM

    Hi,
    Can you provide some additional details such as:
    1. what browser you are using from the other machine (including version)
    2. what is the error you get when you try to access the servlet from the other machine
    3. have you tried accessing the servlet using a hostname rather than the IP address?

  • I have written servlet to access the ejb methods.i got compilation  error p

    Hello Everybody,
    i very new to weblogic server 8.1.i have written a servlet to access ejb(SignOn) method validateUser(username,password).when ever i compile it shows package not found exception.
    Please any one help me.
    Thanks in advance
    riaz
    I put my servlet code here
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    import javax.ejb.*;
    import demo.*;
    import javax.rmi.PortableRemoteObject;
    public class SessionTestServlet extends HttpServlet {
    SignOnHome signOnHome;
    SignOn signOn=null;
    public void init(ServletConfig config) throws ServletException {
    //Look up home interface
    try {
    InitialContext ctx = new InitialContext();
    Object objref = ctx.lookup("demo/SignOn");
    signOnHome = (SignOnHome)PortableRemoteObject.narrow(objref,SignOnHome.class);
    } catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request,HttpServletResponse response)
    throws ServletException, IOException
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Hello World Servlet!</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<p align=\"center\"><font size=\"4\" color=\"#000080\">Servlet Calling Session Bean</font></p>");
    try{
    // MyTestSession beanRemote;
    SignOn signOn;
    signOn = (SignOn)signOnHome.create();
    out.println("<p align=\"center\"> Message from Session Bean is: <b>" + signOn.SayHello() + "</b></p>");
    signOn.remove();
    }catch(Exception CreateException){
    CreateException.printStackTrace();
    out.println("<p align=\"center\"><a href=\"javascript:history.back()\">Go to Home</a></p>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");
    exception:
    SessionTestServlet .java:13: class SessionTestServlet is public, should be decla
    red in a file named SessionTestServlet.java
    public class SessionTestServlet extends HttpServlet {
    ^
    SessionTestServlet .java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    SessionTestServlet .java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    SessionTestServlet .java:7: package javax.ejb does not exist
    import javax.ejb.*;
    ^
    SessionTestServlet .java:8: package demo does not exist
    import demo.*;
    ^
    SessionTestServlet .java:13: cannot find symbol

    SessionTestServlet .java:13: class SessionTestServlet
    is public, should be decla
    red in a file named SessionTestServlet.java
    public class SessionTestServlet extends HttpServlet
    ^You servlet should be placed in SessionTestServlet.java. The source file name should match the class name since the class is public.
    SessionTestServlet .java:2: package javax.servlet
    does not exist
    import javax.servlet.*;
    ^
    SessionTestServlet .java:3: package
    javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    SessionTestServlet .java:7: package javax.ejb does
    not exist
    import javax.ejb.*;
    ^
    SessionTestServlet .java:8: package demo does not
    exist
    import demo.*;
    ^
    SessionTestServlet .java:13: cannot find symbolThese errors indicate that you haven't set the ClassPath correctly.
    Add the weblogic.jar with the correct path to your classpath and compile.
    Regards,
    ***Annie***

  • I can't access able to compile the servlet that access EJB methods

    Hello,
    i have written i servlet (TestServlet.java) to access the ejb(SignOn) method(validateUser(userId,Password)) but i can't compile this servlet.it shows this type error.can anybody help me to do it complete.i have written the ejb & servlet in (d:\ejb\src\demo).
    D:\riazejb\src\demo>javac TestServlet.java
    TestServlet.java:15: cannot find symbol
    symbol : class SignOnHome
    location: class demo.TestServlet
    SignOnHome signOnHome;
    ^
    TestServlet.java:16: cannot find symbol
    symbol : class SignOn
    location: class demo.TestServlet
    SignOn signOn;
    ^
    TestServlet.java:23: cannot find symbol
    symbol : class SignOnHome
    location: class demo.TestServlet
    signOnHome = (SignOnHome)PortableRemoteObject.narrow(objref,SignOnHome.c
    lass);
    My servlet code is
    package demo;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    import javax.ejb.*;
    import demo.*;
    import javax.rmi.PortableRemoteObject;
    public class TestServlet extends HttpServlet {
    SignOnHome signOnHome;
    SignOn signOn;
    public void init(ServletConfig config) throws ServletException {
    //Look up home interface
    try {
    InitialContext ctx = new InitialContext();
    Object objref = ctx.lookup("demo/SignOn");
    signOnHome = (SignOnHome)PortableRemoteObject.narrow(objref,SignOnHome.class);
    } catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request,HttpServletResponse response)
    throws ServletException, IOException
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Hello World Servlet!</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<p align=\"center\"><font size=\"4\" color=\"#000080\">Servlet Calling Session Bean</font></p>");
    try{
    // MyTestSession beanRemote;
    SignOn signOn;
    signOn = (SignOn)signOnHome.create();
    out.println("<p align=\"center\"> Message from Session Bean is: <b>" + signOn.validateUser(student,password) + "</b></p>");
    signOn.remove();
    }catch(Exception CreateException){
    CreateException.printStackTrace();
    out.println("<p align=\"center\"><a href=\"javascript:history.back()\">Go to Home</a></p>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");
    Thanks in advance.
    Riaz

    Have you added the EJB client JAR to classpath for compilation?
    java -classpath "%CLASSPATH%;<<EJBCLient JAR path>> *.java

  • Error: 500    Cannot create bean of class Simulation

    Hello, I was working with J2ee 1.2 and suddenly I got this error. Any one has an idea about it?, I can't continue working.
    Thanks...
    Error: 500
    Internal Servlet Error:
    javax.servlet.ServletException: Cannot create bean of class Simulation
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:384)
         at _0005csimulation_0002ejspsimulation_jsp_325._jspService(_0005csimulation_0002ejspsimulation_jsp_325.java:215)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:352)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
         at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
         at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
         at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
         at java.lang.Thread.run(Thread.java:484)
    Root cause:
    javax.servlet.ServletException: Cannot create bean of class Simulation
         at _0005csimulation_0002ejspsimulation_jsp_325._jspService(_0005csimulation_0002ejspsimulation_jsp_325.java:79)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:352)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
         at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
         at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
         at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
         at java.lang.Thread.run(Thread.java:484)

    This is the code for the simulatin class.
    I think nothing special.
    Begin --- Simulation.java
    import java.io.*;
    import java.util.*;
    public class Simulation
    private int lastMessage;
    private int transactions;
    private int transaction_prospere;
    /* Creation des variables du system */
         private String Quantite_acheteurs;
         private String Quantite_vendeurs;
         private String Argent_initiale;
         private String Articles_initiales;
         private String Prix_initial;
         private String Mechants_acheteurs;
         private String Mechants_vendeurs;
         private String Cycles_simulation;
         private String Choisir_strategie;
         private String Choisir_formule;
         private String Afficher_resultats;
    int iAfficher_resultats = (new Integer(Afficher_resultats)).intValue();
         /* Section de declaration des constants */
         private int OFFRE_DE_VENTE = 0;
         private int DEMANDE_ACHAT = 1;
         private int BROADCAST = -1;
    private int TRICHEUR = -1;
         private int PROSPERE = 1;
         private int VRAI = 1;
         private int FAUX = 0;
    private int ACHETEUR = 0;
    private int VENDEUR = 1;
         private int GENTIL = 0;
         private int MECHANT = 1;
         private double SEUIL_MECHANT = 0.87;
    Messages message_anterieur= null;
    /*** PADOVAN ********************************/
         public String Padovan_alpha;
    Begin --- Creation des agents...
    Pour la creation des agents il y a une generation des chiffres aleatoires
         pour repartir les vendeurs et les acheteurs, ainsi que les gentils et les
         mechants dans le vecteur d'agents
         public Vector Creation_des_agents(){
    System.out.println ("<<<<<<<<<<Executing...Creation_des_agents>>>>>>>>");
    /* Le vector avec des agents....*/
              Vector agents = new Vector();
    lastMessage = 0; /* Le derni�re message ajout� au tableau */
              transactions = 0; /* Compteur pour les transactions */
              transaction_prospere = 0; /* Compteur pour les transaction prosp�res*/
              /* Conversion de variables de string a int */
    int iQuantite_acheteurs = (new Integer(Quantite_acheteurs)).intValue();
    int iQuantite_vendeurs = (new Integer(Quantite_vendeurs)).intValue();
    int iArgent_initiale = (new Integer(Argent_initiale)).intValue();
    int iArticles_initiales = (new Integer(Articles_initiales)).intValue();
    int iPrix_initial = (new Integer(Prix_initial)).intValue();
    int iMechants_acheteurs = (new Integer(Mechants_acheteurs)).intValue();
    int iMechants_vendeurs = (new Integer(Mechants_vendeurs)).intValue();
    int i; /* Compteur pour la generation des agents */
              double agent_type; /* Pour generation aleatoire et savoir si est acheteur ou vendeur */
              int iagent_type; /* Type d'agent acheteur=0, vendeur=1 */
              double agent_comportement; /* Pour generation aleatoire et savoir si est gentil ou mechant */
              int iagent_comportement; /* Comportement de l'agent 0=gentil, 1=mechant, gentil par default */
    int total=iQuantite_acheteurs+iQuantite_vendeurs;
              /* Pour les agents......... */
              int j=0;
              for (i=0;i<total;)
                   iagent_comportement = 0;
    j++;
                   agent_type=Math.random(); /* Pour repartir les agentes vendeurs et acheteurs aleatoirement. */
    iagent_type=(agent_type<0.5?0:1); /* 0-> acheteur, 1-> vendeur */
                   if (iagent_type==0){   /*Creation des acheteurs.... */
    if(iQuantite_acheteurs>0)
    iQuantite_acheteurs--; /* un acheteur de moins */
    /* Generation du comportement */
                             if (iMechants_acheteurs>0) /* Faltan generar agentes mechantes */
                             if ((iQuantite_acheteurs > iMechants_acheteurs))
    agent_comportement = Math.random(); /* Pour repartir les comportement de l'agent */
    iagent_comportement=(agent_comportement<0.5?0:1);     /* 0->gentil, 1->mechant */
                             else
                                  iagent_comportement=1;
                             if (iagent_comportement==1) /* S'il est mechante... */
    iMechants_acheteurs --;
                             Agents agent = new Agents(i,ACHETEUR,0,0,iArgent_initiale,iagent_comportement, total);
                             agent.setPadovan_alpha(Padovan_alpha);
                   i++;
    agents.addElement(agent);
                   else{                  /* Creation des vendeurs... */
    if(iQuantite_vendeurs>0)
                             iQuantite_vendeurs--; /* un vendeur de moins */
    /* Generation du comportement */
                             if (iMechants_vendeurs>0) /*Faltan generar agentes mechantes */
                             if ((iQuantite_vendeurs > iMechants_vendeurs))
    agent_comportement = Math.random(); /* Pour repartir les comportement de l'agent */
    iagent_comportement=(agent_comportement<0.5?0:1);     /* 0->gentil, 1->mechant */
                             else
                                  iagent_comportement=1;
                             if (iagent_comportement==1) /* S'il est mechante... */
    iMechants_vendeurs --;
    Agents agent = new Agents(i,VENDEUR,iArticles_initiales,iPrix_initial,0,iagent_comportement,total);
                             agent.setPadovan_alpha(Padovan_alpha);
                   i++;
    agents.addElement(agent);
         }/* End for */
    System.out.println ("<<<<<<<<<<Ending...Creation_des_agents>>>>>>>>>>");
    return agents;
         } /* End Creation_des_agents */
    End --- Creation des agents...
    Begin --- Setters and getters.........
    public void     setQuantite_acheteurs(String Quantite_acheteurs) {
              this.Quantite_acheteurs= Quantite_acheteurs;
    public void     setQuantite_vendeurs(String Quantite_vendeurs) {
              this.Quantite_vendeurs= Quantite_vendeurs;
    public void     setArgent_initiale(String Argent_initiale) {
              this.Argent_initiale= Argent_initiale;
    public void     setArticles_initiales(String Articles_initiales) {
              this.Articles_initiales= Articles_initiales;
    public void     setPrix_initial(String Prix_initial) {
              this.Prix_initial= Prix_initial;
    public void     setMechants_acheteurs(String Mechants_acheteurs) {
              this.Mechants_acheteurs= Mechants_acheteurs;
    public void     setMechants_vendeurs(String Mechants_vendeurs) {
              this.Mechants_vendeurs= Mechants_vendeurs;
    public void     setCycles_simulation(String Cycles_simulation) {
              this.Cycles_simulation= Cycles_simulation;
    public void     setChoisir_strategie(String Choisir_strategie) {
              this.Choisir_strategie= Choisir_strategie;
    public void     setChoisir_formule(String Choisir_formule) {
              this.Choisir_formule= Choisir_formule;
    public void     setPadovan_alpha(String Padovan_alpha) {
              this.Padovan_alpha= Padovan_alpha;
    public void     setAfficher_resultats(String Afficher_resultats) {
              this.Afficher_resultats= Afficher_resultats;
    public String getPadovan_alpha( ){
    return this.Padovan_alpha;
    } // End of the class Simulation
    End --- Simulation

  • I cannot access CF10 developper built in server remotely

    Just successfully installed CF10 developper ediiton with built in server
    I can access the web pages from the dev server on
    http://localhost:8500
    or
    http://192.168.1.49:8500
    But I cannot access the pages from a remote computer on the same network
    Any suggestion would be welcome

    Such kind of locking CF server access by local dev. machine was normally done by resetting the value of
    <attribute name="interface">*</attribute> attribute
    to
    <attribute name="interface">127.0.0.1</attribute>
    of   <service class="jrun.servlet.http.WebService" name="WebService">   service of jrun.xml file but it was done till CF 9 server through this jrun.xml file attribute change.

  • Cannot find bean in any scope

    Hi,
    I am getting the following error
    Cannot find bean allJobsForm in any scope. I need some help in trying to identify the problem. I have attached the strust action mapping, the JSP, and the action and form classes. Please have a look and assist me in solving this problem as it I am becoming really frustrated.
    Warm Regards
    Denzil
    Action Mapping
    <action
    path="/secure/moshomo/search/GetAllJobsAction"
    type="za.co.mpilo.moshomo.web.action.GetAllJobsAction"
    name="allJobsForm"
    scope="session"
    input="/secure/CVHomeHR.do?p_content=/jsp/secure/moshomo/ms_recruiter_jobs.jsp"
    unknown="false"
    validate="true"
    >
    <forward
    name="success"
    path="/secure/CVHomeHR.do?p_content=/jsp/secure/moshomo/ms_recruiter_jobs.jsp"
    redirect="false"
    />
    JSP
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/struts-nested" prefix="nested" %>
    <%@ taglib uri="/tags/war-extranet" prefix="extranet" %>
    <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
    <nested:root name="allJobsForm">
         <div align="center">
         <table width="80%" class="mstable" >
              <thead>
                   <td>Posted Jobs</td>
              </thead>
              <tr>
                   <td>
                        <table width="100%" >
                             <tr class="mssubhead">                         
                                  <td width="60%" ><font color="#160866">
                                       Job Title
                                  </font></td>
                                  <td width="22%" align="center" ><font color="#160866">
                                       Posted Date
                                  </font></td>
                                  <td width="18%" align="center" ><font color="#160866">
                                       Expiration Date
                                  </font></td>
                             </tr>
                             <tr>
                             <td width="80%" ><font color="#160866">
                                       Job Description
                                  </font></td>                              
                             </tr>
                             <nested:iterate property="all" id="ref" type="za.co.mpilo.moshomo.vo.JobVO">
                                  <tr>
                                       <td width="60%"><font color="#160866">
                                            <nested:write name="ref" property="jobTitle"/>
                                       </font></td>
                                       <td width="22%"><font color="#160866">
                                            <nested:write name="ref" property="postedDate"/>
                                       </font></td>
                                       <td width="18%"><font color="#160866">
                                       <nested:write name="ref" property="expirationDate"/>
                                       </font></td>     
                                  </tr>
                                  <tr>
                                       <td width="80%" align="center"><font color="#160866">
                                            <nested:write name="ref" property="jobDescription"/>                                   
                                       </td>
                                  </tr>
                             </nested:iterate>
                             <nested:empty property="all">
                                  <tr>
                                       <td colspan="3"><font color="#160866"> No results found. </font></td>
                                  </tr>
                             </nested:empty>
                        </table>                    
                   </td>
              </tr>
         </table>
         </div>
    </nested:root>
    Action Class
    package za.co.mpilo.moshomo.web.action;
    import java.util.HashMap;
    import java.util.logging.Level;
    import javax.ejb.FinderException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionMessage;
    import org.apache.struts.action.ActionMessages;
    import za.co.mpilo.common.web.action.CommonAction;
    import za.co.mpilo.moshomo.interfaces.CVRepositoryManager;
    import za.co.mpilo.moshomo.util.CVRepositoryManagerUtil;
    import za.co.mpilo.moshomo.vo.CVVO;
    import za.co.mpilo.moshomo.vo.SearchVO;
    import za.co.mpilo.moshomo.vo.JobVO;
    import za.co.mpilo.moshomo.web.form.AllJobsForm;
    import za.co.mpilo.moshomo.web.form.AllTertiaryEducationForm;
    import za.co.mpilo.moshomo.web.form.JobSearchForm;
    * @struts.action
    *                     name="allJobsForm"
    *                     path="/secure/moshomo/search/GetAllJobsAction"
    *                     input="/secure/CVHomeHR.do?p_content=/jsp/secure/moshomo/ms_recruiter_jobs.jsp"
    *                     scope="session"
    *                     validate="true"
    * redirect="false"
    * @struts.action-forward
    *                     name="success"
    *                     path="/secure/CVHomeHR.do?p_content=/jsp/secure/moshomo/ms_recruiter_jobs.jsp"
    * @version $Revision: 1.4 $
    *      @author $Author: denzilf $
    *      @date $Date: 2006/11/02 11:03:10 $
    public class GetAllJobsAction extends CommonAction{
         public ActionForward execute(ActionMapping mapping, ActionForm f, HttpServletRequest request, HttpServletResponse response) throws Exception {
                   if ( getLogger().isLoggable(Level.INFO) )
                        getLogger().info( "execute" );
                   ActionForward result = mapping.getInputForward();
                   ActionMessages errors = new ActionMessages ();
                   AllJobsForm form = (AllJobsForm) f;
                   try {
                        //vo.setAllORany( form.getAllORany());
                        //vo.setMatch( form.getMatch());
                        //vo.setSearchText(form.getSearchText());
                        String uid = request.getUserPrincipal().getName(); //logged in user
                        CVRepositoryManager manager = CVRepositoryManagerUtil.getHome( getIntialProperies() ).create();
                        HashMap jobs = manager.findAllJobsPerUserId(uid);
                        form.setAll( jobs.values() );     
                        result = mapping.findForward( "success" );
                   catch (Exception xe) {
                        if ( getLogger().isLoggable(Level.WARNING) )
                             getLogger().log( Level.WARNING , xe.getMessage() , xe );
                        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general" ) );               
                   if ( !errors.isEmpty() )
                        saveErrors( request , errors );
                   return result;     
    Form
    package za.co.mpilo.moshomo.web.form;
    import java.util.Collection;
    import org.apache.struts.validator.ValidatorForm;
    import za.co.mpilo.moshomo.vo.JobVO;
    * @struts.form
    *           name="allJobsForm"
    public class AllJobsForm extends ValidatorForm {
         private int selection;
         private Collection all;
         public JobVO[] getAll() {
              JobVO[] array = new JobVO[all.size()];
              all.toArray( array );
              return array;
         public void setAll(Collection all) {
              this.all = all;
         public int getSelection() {
              return selection;
         public void setSelection(int selection) {
              this.selection = selection;
    }

    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: An exception occurred processing JSP page /jsp/Edituser.jsp at line 36
    33: <html:form action="/Updateuser" method="post">
    34:
    35:           <table border="0" align="center">
    36:           *<logic:iterate id="details" name="user">*
    37:           <tr>
    38:                <td><html:hidden property="userid" name="details"/></td>
    39:                <td><html:hidden property="contactid" name="details"/></td>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:397)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
         org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
         org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "user" in any scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.jsp.Edituser_jsp._jspService(Edituser_jsp.java:844)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
         org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
         org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    javax.servlet.jsp.JspException: Cannot find bean: "user" in any scope
         org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)
         org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)
         org.apache.jsp.jsp.Edituser_jsp._jspService(Edituser_jsp.java:184)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
         org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
         org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
    --------------------------------------------------------------------------------

  • Cannot access Statement

    Hi
    why i am getting following compilation error.
    mysql1.java:37: cannot access Statement bad class file: .\Statement.class
    class file contains wrong class: org.gjt.mm.mysql.Statement Please remove or make sure it appears in the correct subdirectory of the classpath.
    Statement stmt = con.createStatement();
    thanks in advance

    Hi Raju
    Thanks a lot for all your kind comments. i succedded to get the connection with mySql server as it execute the connection statement.
    Now it gives compilation error as stated .
    variable "username" is also my database name.
    my code is here
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    //import java.sql.*; //gives compilation error "cannot access Connection"
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Driver;
    public class mysql2 extends HttpServlet
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    ServletOutputStream out = response.getOutputStream();
    String title = "Servlet connecting to MySQL database";
    response.setContentType("text/html");
    try {
    out.println("Start...");
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    //Class.forName("com.mysql.jdbc.Driver").newInstance();
    String username = "user"; // Insert your own username for MySQL
    String password = "pass"; // Insert your own password for MySQL
    String url = "jdbc:mysql://mysql.it-c.dk/" + username;
    Connection con = DriverManager.getConnection(url, username , password);
    out.println("Mubarik hoooo..Good Luck...");
    //working up to here
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * from phone_book");
    ResultSetMetaData meta = rs.getMetaData();
    out.println("Fik fat i databasen!<br>Her kommer det, vi trak ud:<br><br>");
    while( rs.next() ) {
    String fornavn = rs.getString("name");
    String efternavn = rs.getString("address");
    String kn = rs.getString("kn");
    out.println(fornavn + " " + efternavn + " er en "+"<br>");
    stmt.close();
    catch( Exception e ) {
    out.println("Der er fejl!");
    out.println(e.getMessage());
    e.printStackTrace();
    Thanks
    Nadeem

Maybe you are looking for

  • Problems creating a portfolio header in Acrobat 9 Pro.

    I create a header and save my file. But when I exit out of the file and then reopen it, the header that I just saved is gone. Anyone have any ideas? Thanks!

  • Problem in converting ASCII value in Dev. and Production

    Hi... The ASCII values for # differ in the development and the production system. The code below (value 0009 ) populates # in the variable lv_sep. DATA: lv_sep TYPE x. FIELD-SYMBOLS : <field> TYPE x. ASSIGN lv_sep TO <field> CASTING TYPE x. <field> =

  • Question about the chain step name in DEFINE_CHAIN_STEP

    I have questions about the chain step name in DEFINE_CHAIN_STEP: 1. Can the step name be a number (e.g. "8")? 2. Should the step name be unique within a chain or across all chains? I am having this exception: ORA-25448: rule DMUSER.RULE_6_3707 has er

  • My Mac wont load

    I press the ON button, I hear the MAC Start Up Sound, then the loading wheel appears, and a progress bar appears below, which dosnt do anything then the MAC SHUTS OFF, I've had the MAC since 2011 and this is the first problem I've had

  • The problem about  the Log Level

    Hi everyone, The Log Level of Oracle Application Server includes NULL,Severe,Warning,Info,Config,fine,finer,finest. Which log level is the highest ? I want to get more message about My Esb instances,How to set the log level ?