Constructor compiles, arraylists, not calling method correctly?

I am starting back on the program from yesterday! Working with arraylists
I have the constructor compiling, both class files compile.,
with the code i have in the driver file, the driver file is not compiling
code is:
for hotel class: (compiles)
import java.util.ArrayList;
public class Hotel//Sets the class
      ArrayList<Room> theRooms;
      private String name;
      private String location;
      private int occupiedCnt=0;
      private double occupancyPercentage = 0;
      private double DailySales = 0;
      private static final int NOT_FOUND = -1;
contructor method
public Hotel(String n, String a)
        name = n;
        location = a;
/** accessor methods with calculations
//returns a boolean that is true if all the rooms in the hotel are occupied
public boolean isFull()
   return true;
//returns a boolean that is true if all the rooms in the hotel are unoccupied.
public boolean isEmpty()
   return true;
The Hotel will have an addRoom method that will create each room with the required
information: room number, bed type, smoking/non-smoking, and the room rate.  Create
at least 5 rooms with different characteristics. Each room will also have a boolean
field called occupied attribute that will be set to false when the room is created.**/
public void addRoom(String bd, int rn, char s, double r)
   Room newRoom = new Room(bd,rn,s,r );
   theRooms.add(newRoom);
}for the rooms class: (compiles)
public Room(String bd, int rn, char s,
                  double r)
        roomNum = rn;
      bedType = bd;
      smoking = s;
      rate = r;     
   }For the driver file (does not compile and i am sure that I am calling the method incorrectly) first time working with arraylists.......
public class TestHotel
public static void main(String[] args)
         Hotel pensacola = new Hotel("Browns Town", "3308 Damon Dr Milton Fl32583");
         //pensacola.addReservation();
         pensacola.theRooms.add(newRoom("king",201,'s',59.99));        
}        error that i am getting:
----jGRASP exec: javac -g C:\Users\Jessie\Documents\java\class project files\project 7\TestHotel.java
TestHotel.java:25: cannot find symbol
symbol : method newRoom(java.lang.String,int,char,double)
location: class TestHotel
pensacola.theRooms.add(newRoom("king",201,'s',59.99));
^
1 error
----jGRASP wedge2: exit code for prcess is 1.
----jGRASP: operation complete.
again i am sure it is something simple like how i am calling the method. any pointers appreciated.

NEVER MIND...........maybe should be drinking coffee instead of drinking Coke!

Similar Messages

  • Strange behavior: action method not called when button submitted

    Hello,
    My JSF app is diplaying a strange behavior: when the submit button is pressed the action method of my managed bean is not called.
    Here is my managed bean:
    package arcoiris;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.SelectItem;
    public class SearchManagedBean {
        //Collected from search form
        private String keyword;
        private String country;
        private int[] postcode;
        private boolean commentExists;
        private int rating;
        private boolean websiteExists;
        //Used to populate form
        private List<SelectItem> availableCountries;
        private List<SelectItem> availablePostcodes;
        private List<SelectItem> availableRatings;
        //Retrieved from ejb tier
        private List<EstablishmentLocal> retrievedEstablishments;
        //Service locator
        private arcoiris.ServiceLocator serviceLocator;
        //Constructor
        public SearchManagedBean() {
            System.out.println("within constructor SearchManagedBean");
            System.out.println("rating "+this.rating);
        //Getters and setters
        public String getKeyword() {
            return keyword;
        public void setKeyword(String keyword) {
            this.keyword = keyword;
        public String getCountry() {
            return country;
        public void setCountry(String country) {
            this.country = country;
        public boolean isCommentExists() {
            return commentExists;
        public void setCommentExists(boolean commentExists) {
            this.commentExists = commentExists;
        public int getRating() {
            return rating;
        public void setRating(int rating) {
            this.rating = rating;
        public boolean isWebsiteExists() {
            return websiteExists;
        public void setWebsiteExists(boolean websiteExists) {
            this.websiteExists = websiteExists;
        public List<SelectItem> getAvailableCountries() {
            List<SelectItem> countries = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue("2");
            si_1.setLabel("ecuador");
            si_2.setValue("1");
            si_2.setLabel("colombia");
            si_3.setValue("3");
            si_3.setLabel("peru");
            countries.add(si_1);
            countries.add(si_2);
            countries.add(si_3);
            return countries;
        public void setAvailableCountries(List<SelectItem> countries) {
            this.availableCountries = availableCountries;
        public List<SelectItem> getAvailablePostcodes() {
            List<SelectItem> postcodes = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(75001);
            si_1.setLabel("75001");
            si_2.setValue(75002);
            si_2.setLabel("75002");
            si_3.setValue(75003);
            si_3.setLabel("75003");
            postcodes.add(si_1);
            postcodes.add(si_2);
            postcodes.add(si_3);
            return postcodes;
        public void setAvailablePostcodes(List<SelectItem> availablePostcodes) {
            this.availablePostcodes = availablePostcodes;
        public List<SelectItem> getAvailableRatings() {
            List<SelectItem> ratings = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(1);
            si_1.setLabel("1");
            si_2.setValue(2);
            si_2.setLabel("2");
            si_3.setValue(3);
            si_3.setLabel("3");
            ratings.add(si_1);
            ratings.add(si_2);
            ratings.add(si_3);
            return ratings;
        public void setAvailableRatings(List<SelectItem> availableRatings) {
            this.availableRatings = availableRatings;
        public int[] getPostcode() {
            return postcode;
        public void setPostcode(int[] postcode) {
            this.postcode = postcode;
        public List<EstablishmentLocal> getRetrievedEstablishments() {
            return retrievedEstablishments;
        public void setRetrievedEstablishments(List<EstablishmentLocal> retrievedEstablishments) {
            this.retrievedEstablishments = retrievedEstablishments;
        //Business methods
        public String performSearch(){
            System.out.println("performSearchManagedBean begin");
            SearchRequestDTO searchRequestDto = new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);
            SearchSessionLocal searchSession = lookupSearchSessionBean();
            List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);
            this.setRetrievedEstablishments(retrievedEstablishments);
            System.out.println("performSearchManagedBean end");
            return "success";
        private arcoiris.ServiceLocator getServiceLocator() {
            if (serviceLocator == null) {
                serviceLocator = new arcoiris.ServiceLocator();
            return serviceLocator;
        private arcoiris.SearchSessionLocal lookupSearchSessionBean() {
            try {
                return ((arcoiris.SearchSessionLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/SearchSessionBean")).create();
            } catch(javax.naming.NamingException ne) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
                throw new RuntimeException(ne);
            } catch(javax.ejb.CreateException ce) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
                throw new RuntimeException(ce);
    }Here is my jsp page:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
             <html>
                 <head>
                     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                     <META HTTP-EQUIV="pragma" CONTENT="no-cache">
                     <title>JSP Page</title>
                 </head>
                 <body>
                     <f:view>
                         <h:panelGroup id="body">
                             <h:form id="searchForm">
                                 <h:panelGrid columns="2">
                                     <h:outputText id="keywordLabel" value="enter keyword"/>   
                                     <h:inputText id="keywordField" value="#{SearchManagedBean.keyword}"/>
                                     <h:outputText id="countryLabel" value="choose country"/>   
                                     <h:selectOneListbox id="countryField" value="#{SearchManagedBean.country}">
                                         <f:selectItems id="availableCountries" value="#{SearchManagedBean.availableCountries}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="postcodeLabel" value="choose postcode(s)"/>   
                                     <h:selectManyListbox id="postcodeField" value="#{SearchManagedBean.postcode}">
                                         <f:selectItems id="availablePostcodes" value="#{SearchManagedBean.availablePostcodes}"/>
                                     </h:selectManyListbox>
                                     <h:outputText id="commentExistsLabel" value="with comment"/>
                                     <h:selectBooleanCheckbox id="commentExistsField" value="#{SearchManagedBean.commentExists}" />
                                     <h:outputText id="ratingLabel" value="rating"/>
                                     <h:selectOneListbox id="ratingField" value="#{SearchManagedBean.rating}">
                                         <f:selectItems id="availableRatings" value="#{SearchManagedBean.availableRatings}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="websiteExistsLabel" value="with website"/>
                                     <h:selectBooleanCheckbox id="websiteExistsField" value="#{SearchManagedBean.websiteExists}" />
                                     <h:commandButton value="search" action="#{SearchManagedBean.performSearch}"/>
                                 </h:panelGrid>
                             </h:form>
                         </h:panelGroup>
                     </f:view>
                 </body>
             </html>
         here is my faces config file:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
        <managed-bean>
            <managed-bean-name>SearchManagedBean</managed-bean-name>
            <managed-bean-class>arcoiris.SearchManagedBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
           <description></description>
            <from-view-id>/welcomeJSF.jsp</from-view-id>
            <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>index.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>The problem occurs when the field ratingField is left blank (which amounts to it being set at 0 since it is an int).
    Can anyone help please?
    Thanks in advance,
    Julien.

    Hello,
    Thanks for the suggestion. I added the tag and it now says:
    java.lang.IllegalArgumentException
    I got that from the log:
    2006-08-17 15:29:16,859 DEBUG [com.sun.faces.el.ValueBindingImpl] setValue Evaluation threw exception:
    java.lang.IllegalArgumentException
         at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:178)
         at com.sun.faces.el.impl.ArraySuffix.setValue(ArraySuffix.java:192)
         at com.sun.faces.el.impl.ComplexValue.setValue(ComplexValue.java:171)
         at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:234)
         at javax.faces.component.UIInput.updateModel(UIInput.java:544)
         at javax.faces.component.UIInput.processUpdates(UIInput.java:442)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIForm.processUpdates(UIForm.java:196)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:363)
         at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:81)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    2006-08-17 15:29:16,875 DEBUG [com.sun.faces.context.FacesContextImpl] Adding Message[sourceId=searchForm:ratingField,summary=java.lang.IllegalArgumentException)Do you see where the problem comes from??
    Julien.

  • JSP does not call the right method in controller class

    Hi all,
    I have a jsp file which loads a page at this address: http://localhost:8080/dir/list/
    I've added two checkboxes to the page; user can check both checkboxes, only one or none. Following is code I have in jsp file:
    <form class="checkboxForm">
    <c:choose>                                                                                                         
    <c:when test='${newItems==true}'>
    <input id="newItems" type="checkbox" value="#" name="newItems" class="checkbox2" checked="checked" /><strong> New Businesses   </strong>                                                                 
    </c:when>
    <c:otherwise>
    <input id="newItems" type="checkbox" value="#" name="newItems" class="checkbox2"/><strong> New Businesses   </strong>
    </c:otherwise>
    </c:choose>
    <c:choose>                                                                                                         
    <c:when test='${rejectedItems==true}'>
    <input id="rejectedItems" type="checkbox" value="#" name="rejectedItems" class="checkbox3" checked="checked"/><strong> Rejected Businesses   </strong>                                                                 
    </c:when>
    <c:otherwise>
    <input id="rejectedItems" type="checkbox" value="#" name="rejectedItems" class="checkbox3"/><strong> Rejected Businesses   </strong>
    </c:otherwise>
    </c:choose>
    <a href="#" onclick="apply();">
    <button name="apply" class="btn-primary" value="Apply" tabindex="4">Apply</button>
    </a>
    </form>
    <script type="text/javascript">
    function apply(){
         var newItems = document.getElementById("newItems").checked;
         var rejectedItems = document.getElementById("rejectedItems").checked;
         alert("Inside apply() method.");
         alert("newItems= " + newItems + ", rejectedItems: " + rejectedItems);     
         window.location = "<c:url value='/list/'/>" + newItems + "/" + rejectedItems;
         alert("window.location= " + window.location);
         alert("Add extra delay!");
         return false;
    </script>This is my Controller class:
    // Method1: this method gets called when the user loads the page for the first time.
    @RequestMapping(value="/list", method = RequestMethod.GET)
    public String list(Model model, HttpServletRequest request) {          
              System.out.println("Controller: method1: Passing through...");
              model.addAttribute("newItems", Boolean.TRUE);
              model.addAttribute("rejectedItems", Boolean.TRUE);
              // Does other things.
    // Method3: this method gets called when user checks/unchecks one of the checkboxes and clicks on Apply button.
    @RequestMapping(value="/list/{newItems}/{rejectedItems}", method = RequestMethod.GET)
    public String list(@PathVariable Boolean newItems, @PathVariable Boolean rejectedItems, Model model, HttpServletRequest request) {          
              System.out.println("Controller: method3: Passing through...");
              model.addAttribute("newItems", newItems);
              model.addAttribute("rejectedItems", rejectedItems);
    // Does other things.
         }The way my jsp code is written now, it calls the correct method and displays the correct url. When page loads for the first time, it calls method1 and the url is:
    http://localhost:8080/dir/list
    When the user checks/unchecks one or both checkboxes and clicks on apply button, method3 is called and this url is displayed:
    If both checkboxes are checked which both booleans are set to true:
    http://localhost:8080/dir/list/true/true
    Everything is fine... however, if I comment these two lines at the end of JavaScript apply() function,
    alert("window.location= " + window.location);
    alert("Add extra delay!");Then method3 will never gets called; only method1 gets called and I see this url:
    http://localhost:8080/url/list//?newItems=%23&rejectedItems=%23&apply=Apply
    I do not know why it gets confused bet. method1 and method3 and cannot pick the right method?
    I tried to use the POST method instead, but the page goes directly to our internal error page and it never reaches the method I wrote in my controller for POST:
    I don't really know what I'm doing wrong? Any help is greatly appraciated.
    Edited by: ronitt on Dec 13, 2011 2:35 PM

    I changed the <form> in the jsp to div and its working fine. I do not need to have comments in JavaScript funcion() anymore. I don't know why that made the difference though? According to:
    http://www.w3schools.com/tags/tag_form.asp
    The <form> tag is used to create an HTML form for user input.
    The <form> element can contain one or more of the following form elements:
    <input>
    <textarea>
    <button>
    <select>
    <option>
    <optgroup>
    <fieldset>
    <label>
    An HTML form is used to pass data to a server.
    I do have <button> and also send the data - the value of checkboxes - to server. So I think it should also work with <form>.
    Please let me know if you have any idea. Thanks.

  • Initializer block not called when static method called

    public class Initializer {
         Initializer(){
              System.out.println("Constructor called");
                   System.out.println("CLASS INITIALIZED");
         static void method(){
              System.out.println("Static method called");
         public static void main(String[] args) {
              Initializer.method();
    From the JLS
    A class or interface type T will be initialized immediately before the first occurrence of any one of the following:
    T is a class and an instance of T is created.
    T is a class and a static method declared by T is invoked.
    [b]
    But when i call the static method , if the class is initialized shouldnt the initializer block be called, it is not called, why.

    Perhaps running something like this will add a little more colour?:
    public class Initializer {
        static {
            System.out.println("First static initializer");
            System.out.println("First instance initializer");
        Initializer() {
            System.out.println("Constructor");
        static {
            System.out.println("Second static initializer");
            System.out.println("Second instance initializer");
        static void staticMethod() {
            System.out.println("staticMethod");
        void instanceMethod() {
            System.out.println("instanceMethod");
        public static void main(String[] args) {
            System.out.println("main");
            staticMethod();
            new Initializer().instanceMethod();
    }

  • In iOS 7.0.2 All and Missed tabs are not showing call history correctly

    In iOS 7.0.2 All and Missed tabs are not showing call history correctly, I have iPhone 4 running iOS 7.0.2 version it looks like there is a bug. Missed call history and All calls (incoming, outgoing and missed) history is not showing properly in a list. Ideally when I click on missed it should show me recent missed call list and when I click on All it should show me (incoming, outgoing and missed) calls list sorted by current date and time.
    I would like to request Apple developer team to look into this and fix this bug asap. Thanks in advance.

    Hello gnutellabrot
    Start with the article below to troubleshoot issues with email not sending and downloading to your iPhone.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Not calling the action method??

    hi ..
    now i up with some common problem...
    i said as common problem coz i dont know where the error is occuring.
    here is the description.
    In my jsp
    i am having a panel tabbed pane with 2 panes.
    first pane contains some 20 text boxes with save button, used to save the entered records to the database.
    second pane contains the summary page which displays all the records from the respected table with select option button(radio). By selecting the single radio button we can edit the particular record by getting the same in the first tabbed pane fields...
    (here, i am using a javascript to select any one radio button in the form coz radio buttons are generated thru datatable)
    In java
    ======
    in constructor
    i populate all the data from the table to a list. and i display the populated data to the summay fields.
    save button action
    saving the data to the table
    edit the value
    updating the edited values
    Here, my problem is after entering all the fields in the first tabbed pane
    i click the save button. if there is no data in the table(database) all things working properly, but if there single data, save function is not calling. but the constructor are calling properly.
    i am using hibernate for the database conn.
    i know this is some sort of logical error, i am posting this only if any one who had already face this type of error(might be in setting session values).. suggestions plz..

    Hi;
    Your question is not related wiht Download forum side, Please post your issue on related Forum side:
    Forum Home » Developer Tools » JDeveloper and ADF
    Regard
    Helios

  • [svn:fx-trunk] 16929: Add a [Mixin] class that will register the required class aliases in the event the mxml compiler generation   [RemoteClass(alias="")] code is not called because an application does not use the Flex UI framework .

    Revision: 16929
    Revision: 16929
    Author:   [email protected]
    Date:     2010-07-15 07:38:44 -0700 (Thu, 15 Jul 2010)
    Log Message:
    Add a class that will register the required class aliases in the event the mxml compiler generation  [RemoteClass(alias="")] code is not called because an application does not use the Flex UI framework.
    Add a reference to this class in the RPCClasses file so it always gets loaded.
    QE notes: Need a remoting and messaging regression test that doesn't use Flex UI.
    Bugs: Watson bug 2638788
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/rpc/src/RPCClasses.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/rpc/src/mx/utils/RpcClassAliasInitializer.as

    Great exercise to document the problem like this.  It got me thinking about how an app with modules would be different from an app that does not use modules.  Solution: I moved the dummy reference of PersonPhotoView out to the main application file (as opposed to being inside the module) and it worked.  I've probably been lucky not to have experienced this problem earlier, because for most other entities I have an instance attached to my model which is linked / compiled with the main application.

  • Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode.

    Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode. What changes I have to made to work great in iOS 7 also.

    I rewrote code for debugging purpose and tried to catch error using GetLastError();  method,
    but it only printed 0. Below is code snippet; I think Create() throw an exception
    and code goes to catch block. 
    LONG ConnectTS(CString strIP, UINT n_Port)
    try{
              ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
              if(!Create())
    // Exception Line
    n_Err = GetLastError();
    return NET_INIT;
    catch(...)
                       DWORD errorCode = GetLastError();
                       CString errorMessage
                       errorMessage.Format("%lu",errorCode);
                       ErrorLog (0, 0, "Image
    System", (LPTSTR)(LPCTSTR)errorMessage);
                       return  IS_ERR_WINDOWS;
    Output: -
    ConnectTS is calling Create [is going to call]
    Image System
    0

  • GET_V Method is not called for custom field

    Hi,
    We are using CRM 7.0
    I have enhanced component BT120H_CPL and added custom fields into view Details with AET. I am trying to implement search help which depends on another field. I have created V-GETTER for my field and tried to implement search help in this method. However, this method is not called in the program scope.
    I have debugged the application and result is :
    V_GETTER method GET_V_ZZAFLD00000D is created in class ZL_BT120H_C_DETAILS_CN00. It should be called from GET_V_S_EXT method but this method is called in class CL_BT120H_C_DETAILS_CN00 and exception occurs since GET_V_ZZAFLD00000D doesnu2019t exist in class CL_BT120H_C_DETAILS_CN00.
    I tried similar scenario : add search help to existing field of another component. However I couldnu2019t able to run GET_V method again.
    ( It works when I write search help id in the AET but in this way I cannot pass import parameter to it )
    Is there anything I am missing ? Thanks in advance for helps.
    Regards
    Abdul.

    Hi,
        Then, the next possible thing is checking the "enhancement set". Press F2 keeping the cursor on any field and check if the view is showing up as enhanced. Find this information under "Active Enhancement set" in the popup details. If this does not happen, then your enhanced view is not being used. You may want to check the COMPONENT_LOADING BADI if you are using more than one assignment set. You may also want to look at this WIKI.
    [http://wiki.sdn.sap.com/wiki/display/CRM/HowToEnhanceaWebUIComponentinSAP+CRM]
    Regards,
    Arun Prakash

  • Call method cl_crm_documents- create_with_file not creating attachment

    Hi,
    I am trying to create attachment in a transaction type using cl_crm_documents->create_with_file. But it is not creating the same, instead gives error "Error loading file &".
    I am uploading a file with fields object_id, text, file name, description  and category.
    I have passed the parameters as follows:
    data: gref_obj           type ref to cl_crm_documents.
    create object gref_obj.
              gw_prop_attr-name           = 'BDS_KEYWORD'.
              gw_prop_attr-value          = gw_attach-category.
              append gw_prop_attr to gt_prop_attr.
              gs_business_object-instid   = gw_guid-guid.(object guid)
              gs_business_object-typeid   = gv_object_type.(object type)
              gs_business_object-catid    = 'BO'.
              call method gref_obj->create_with_file
                exporting
                  file_name       = gw_attach-f_name (name as provided in my uploaded file, in my case it is test)
                  directory       = p_floder (C:\Attachment\)
                  properties      = gt_prop_attr
                  business_object = gs_business_object
                importing
                  phio            = gs_phio_id
                  loio            = gs_loio_id
                  error           = ls_error.
    Please help me on this. I doubt the directory that I am giving is wrong.
    Thanks.

    Hi,
    Please go through this...
    Re: Problem attach document with the FileUpload UI.
    Cheers,
    Kris.

  • ABAP Proxy Inbound message does not call generated method

    Hi,
    we tried to generate a ABAP Proxy for a customer demo. It just should retrieve some data and write them to a database table.
    the generation and activation of the proxy was without errors. If we call the check function the method works fine.
    But if we receive data from XI via the regarding interface it looks as if the execute-method of the generated class is not called. We can see the message in SXMB_Moni, but nothing is written to the db table.
    Does someone have any idea?

    Hi Peter,
    There will be some error in the Proxy Side.
    Check this in Transaction Code-SXMB_MONI of Application System(R/3 etc) not in the XI system.
    There may be some communication(http etc) issues.
    Also check this -
    /people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy
    Hope this helps to findout what is the error.
    Regards,
    Moorthy

  • Error: Permission denied for (document.domain has not been set) to call method Location.toString on (document.domain=).

    Why am I getting these errors Error: Permission denied for (document.domain has not been set) to call method Location.toString on (document.domain=).
    == URL of affected sites ==
    http://

    HOW DO YOU SET THIS??? I'M FRUSTRATED OVER THIS. ITS BEEN 2 MONTHS SINCE I HAVE BEEN ABLE TO PLAY ANY GAMES IN FACEBOOK DUE TO THIS PROBLEM! IT DOES NOT MATTER WHAT BROWSER I USE I STILL GET THIS SAME MESSAGE.

  • Action method not called in Backing Bean

    I am using <x:inputFileUpload> tag inside my jsp page. I am trying to call action method when clicking button, but action method not called.
    My jsp page:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
    <html>
         <head>
              <title>File upload Test</title>
         </head>
         <body>
              <f:view>
                   <h:form id="form1" enctype="multipart/form-data">
                        <h:messages id="asdghsda"/>          
                        <h:outputText value="This is file upload page functionlaity POC" />                                   
                        <h:inputText value="#{fileUploadBean.textField}" />
                        <x:inputFileUpload id="myFileId" value="#{fileUploadBean.myFile}" storage="file" required="true"/>                    
                        <h:commandButton action="#{fileUploadBean.storeFile}" value="Enter here" />                    
                        <h:commandLink value="Clicl Here!!" action="#{fileUploadBean.storeFile}"></h:commandLink>
                   </h:form>               
              </f:view>
         </body>     
    </html>
    My backing bean:
    package com.beans;
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import org.apache.log4j.Logger;
    import org.apache.myfaces.custom.fileupload.UploadedFile;
    public class FileUploadBean {     
         private static Logger logger = Logger.getLogger(FileUploadBean.class.getName());
         private String textField;
         private UploadedFile myFile;
         public UploadedFile getMyFile() {
              logger.info("inside get method");
         return myFile;
         public void setMyFile(UploadedFile myFile) {
              logger.info("inside set method");
              this.myFile = myFile;
         public void storeFile(){          
              logger.info("Inside the storeFile method");
              logger.info("The text field value: " + getTextField());
              try {
                   InputStream in = new BufferedInputStream(myFile.getInputStream());
                   logger.info("The string is: " + in.read());
                   System.out.println(in.read());
                   File f = new File("D:\\share\\sample.txt");               
                   OutputStream out = new FileOutputStream(f);
                   out.write(in.read());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              logger.info("Exit from the storeFile method");
         public String getTextField() {
              return textField;
         public void setTextField(String textField) {
              this.textField = textField;
    My web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>MyJSFProject</display-name>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    </web-app>
    Can someone help me on this? I need urgently.

    One straight and simple answer which i can give you method associated to action attributes always returns a java.lang.String Object.
    REF :
    action:
    =====
    If specified as a string: Directly specifies an outcome used by the navigation handler to determine the JSF page to load next as a result of activating the button or link If specified as a method binding: The method has this signature: String methodName(); the string represents the outcome
    source : http://horstmann.com/corejsf/jsf-tags.html#Table4_15
    therefore
    change
    public void storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    }to
    public String storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    return "success";
    }else where you can make use of actionlistener property in the following senario.
    but the method signature has to be void storeFile(ActionEvent ae)
    and could be use like
    <h:commandButton actionlistener="#{fileUploadBean.storeFile}" action="success" value="SUBMIT" /> Hope that might help :)
    REGARDS,
    RaHuL

  • Calling method from SWF file wtih javascript, when swf file is not loaded in any browser

    Hi There,
    I have a question regarding flex and javascript integration:
    1. We have created certain components and bundle them in swf. these swf file uses webservice to connect to backend code written in java.
    2. We have deployed swf file and backend on the same tomcat server.
    3. Backend server send some datapoint to UI and plot graph and displyaed to user.
    4. Now if user generate graph from datapoint and want to export it, we are tranferring image of that graph from UI to backend. No issues in this process.
    5. Now the question is. let say user has not open any swf file in browser and backend scheduling job want to generate the graph. How we will connect to swf file.
    6. Is ther any way we can connect or call method of swf from java/jsp/html/javascript code in this scenario without loading swf file in browser??
    Please help me!!!
    Thanks
    Sonu Kumar

    Both test sites work just fine for me.
    The "Update plugin" message is exactly what would be displayed if no .swfobject file at all was found... so it may not be the "version11" thing but rather, perhaps something else is messed up with the .swfobject file.
    File can be found in both folders:
    http://www.pureimaginationcakes.com/test/Scripts/swfobject_modified.js
    http://www.pureimaginationcakes.com/Scripts/swfobject_modified.js
    and file does download when downloading the html page (just check the cache).... but for some reason it doesn't seem to be working.... Hummmmm????
    Adninjastrator

  • Java Interface does not accept method that passes ArrayList...Why?

    Java Interface does not accept method that passes ArrayList...Why?
    for example...
    public interface Interface extends java.rmi.Remote
    public ArrayList getSomething(String ID) throws java.rmi.RemoteException;
    Why is this not acceptable?

    Java Interface does not accept method that passes ArrayList...Why?for example...
    ALSO:
    You are not 'passing' ArrayList, you are returning it.
    If you are 'passing' anything, it is String.
    ~David

Maybe you are looking for