Bean debugging

I have a feeling this is not the best place to discuss java beans for forms (11) but ....
my bean doesnt work! In fact it hangs ... So the next question is, how to debug a bean...Typically I would just put System.out.println statements in java to
get some idea of what goes on. But in a bean...I'm getting the feeling that doesn't work. Where does console output go in a bean? I'm thinking nowhere.  So then what do you do? Write a file? Can you write a file from a bean?
After I wrote that I realized that perhaps the java console gets stdout from applets. (Or not. I don't know.) I'll check that. Problem with the java console is it is either bugging you by being there or it's not there and you don't remember that it exists.

Hello,
Teh System.out.println() write to the Java Console, so that display it at runtime and you will see them.
Francois

Similar Messages

  • Message Driven Bean debugging not supported in 9.0.3?

    Message Driven Beans are now supported with the preview of 9.0.3, but you can't debug into them using the embedded container? Will this be resolved for the release version?

    Brice --
    Are you using the embedded help system or hosted documentation? I've just double-checked, and with the full jdev install, the "About Debugging PL/SQL Programs and Java Stored Procedures" is loading fine for me.
    The PL/SQL variable should show up as well, without anything needing to be enabled on the server. What database version are you using, and what are the datatypes of the PL/SQL variables?
    -- Brian
    Hello,
    We have downloaded JDev 903 Preview to try out the new PL/SQL debugging features, but it seems we are unable to inspect/watch/debug PL/SQL variables. The relevant panels are simply blank.
    Strangely enough, the help files are also lacking on the subject (e.g. the "About debugging PL/SQL" help topic does not seem to exist).
    Is there an option to turn on in the database server to view PL/SQL variables ?
    Thanks
    Regards
    Brice

  • JDEV 10.1.3 How to manipulate/Debug IndirectList from ejb 3.0 session bean

    I was debugging my session bean a seen that element data for the employeesCollection was empty.
    I didn't understood why my java client was throwing an error when i accessed manually the Departments collection and get the employeeCollection from the first entry in the collection. What was confusing me was that my master/detail jfs application was displaying these data. From where ? how was it possible ? it was the same session bean !
    This is the reason i debugged the session bean return object and seen that the collection was also empty as the from executing from my java client application. I have seen the type of the object that was not a collection but IndirectList.
    So my question ! how is it possible to load the collection of this type ? Which method the data control is executing to load it ? Where may i found a description of this very interesting process ?

    Hi Frank.
    plain English - on plan :).
    I create managed bean with function which do access to LDAP and this function 'return List<Users>'.
    In JDeveloper :) on managed bean(java class) i create "Create Data Control"... after, from Data Controls i drop on page this data(create ADF Table with selectOne)...
    First Page Ready!
    Second page... i need to know which option selected on first page. This option(row) contains, UserName and etc... On second page i again fetch data, from LDAP, associated with this concrete UserName... Because i fetch data using managed bean :) i need to know this username in my managed bean...
    May be :) im wrong...
    sessionAttribute - like this? ->
    * Convenience method for setting Session variables
    * @param ctx FacesContext
    * @param key object key
    * @param object value to store
    public static void storeOnSession(FacesContext ctx, String key, Object object) {
    Map sessionState = ctx.getExternalContext().getSessionMap();
    sessionState.put(key, object);
    * Convenience method for getting Session variables
    * @param ctx FacesContext
    * @param key object key
    public static Object getFromSession(FacesContext ctx, String key) {
    Map sessionState = ctx.getExternalContext().getSessionMap();
    return sessionState.get(key);
    }

  • How to debug a bean in JSP page with JBX???

    How to debug a bean in JSP page with JBX???
    i have a bean within a JSP page. i wanna find out how do they varibles work and changes of them values.
    are there some ways or tools to get the situations of them in visual way? just like when i debug VB program,i can get the situations in immediately window.

    help me !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • Java.io in J2ee stateless session bean, general questions about debugging

    Doing conventional Java IO (with java.io functions and classes such as
    PrintWriter and println) in a Enterprise bean has been discussed before
    in this and other forum. We know that the EJB specification says not to do it.
    (For example the EJB 2.0 spec, 24.1.2) says that an enterprise
    bean must not use the java.io package to attempt to access files and
    directories int he file system."
    The discussion in various forums including this one is that
    a) using java.io in a bean would impact portability, ability to
    move the bean for load balancing
    b) However, this is not always an an issue and it may be reasonable
    to use these functions anyway. e. g. see the response by "maozhoulu"
    on Jun 21, 2002.
    I tried it in Sun Application Server Nine in my stateless Session Bean:
    package RS;
    import RS.CourseHome;
    import RS.CoursePK;
    import java.rmi.RemoteException;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.EJBException;
    import java.io.*;
    public class AddCourseBean implements javax.ejb.SessionBean {
       public void ejbCreate(){};
       public void CreateCourse (int CourseNumber, String CourseName) {
        try {
         System.out.println("in Create Course");
         PrintWriter F = null;
         try {
          F = new PrintWriter (new FileOutputStream("/tmp/v/af"));
         catch (java.io.FileNotFoundException fe){}
         F.println ("here zero");F.flush();
         InitialContext jndiContext = new InitialContext();
         F.println ("here one");F.flush();
         Object o = jndiContext.lookup("ejb/X");
             ...I got a Null pointer exception on the line:
    "F.println("here zero"); Is there anyway one can do simple debugging with print lines in one's beans?
    Or is there something obviousthat I am overlooking? (I saw mention of doing
    debugging with System.out.println but to where would the bean write?)
    I tried using the Jakarta Commons Logging, but I got a
    java.lang.NoClassDefFoundError on org/apache/commons/logging/LogFactory
    Which logging system does one use in GlassFish, hopefully one with minimal
    configuration? I want to do some debugging, not set up logging for a full
    enterprise system.
    Thanks for your insight and advice.
    Dr. Laurence Leff, Associate Professor of Computer Science WIU ST447 61455
    Pager 309 367 0787, Fax 309 298 2302

    My apology for posting this message twice. I looked for it before and
    did not see it. I thought I forget to click the "Post message" button.
    Also, I did resolve one problem. System.out.println does go to
    the log file, which in my case turned out to be:
    /opt/j2ee/SUNWappserver/domains/domain1/logs/server.log
    (Obvously, the first part would vary based upon where you installed your
    Application Server Nine.)
    However, it would be nice if there was some way to use FILE I/O inside of
    beans. I am teaching some J2EE in the graduate software engineering course,
    and I believe this would be pedagogically sound even if other techniques
    would be appropriate for a production environment.
    Thanks for your patience with this problem and my duplicate post.

  • How to Debug a Java bean In Jdeveloper 3.2

    I want to debug my java Bean in Jdeveloper Environment.
    When I click on debug option Nothing happens .can some body provide me some guidance here

    Sameera,
    You can create a "Custom Project" which is equivalent to "Generic Project".
    -Arun

  • Where in Debug tree are the management beans?

    Hi I'm trying to verify some property settings of a Management bean during a debug session (that does not use methods). Does anyone know where in the tree the properties of a management bean would be held (if at all). Please advise. Thanks!

    Actually not. That page has the same or even less information compared to the "Add Role" wizard from Server Manager GUI. Not helpful at all. However, from the two what I can gather is there is no native mechanism in Server 10 to manage the Network
    Controller role or the data it surfaces. One is left to either purchase ($$$) and use other software or roll your own (possible??). 
    Looking at the files installed by Canary, I doubt if even this is possible with Canary because it just seems to be a set of services...
    Sujay Sarma {Unbounded;} Blog: http://blog.sujay.sarma.in

  • How do I enable debugging in beans.ocx

    I am successfully running a Java Web enabled Application in Windows 2000 IIS Server.
    The application is accesses via Active Server Page (ASP) COM object interface enabled by Sun �JavaPlugin-ActiveX Bridge�. The application works great, it is using Java version is 1.3.1.
    I need to enable debug in the �JavaPlugin-ActiveX Bridge� How do I turn �DEBUG ON�
    I want to pass the following parameters to �JavaPlugin-ActiveX Bridge� ;
    -Xnoagent -Xdebug -Xrunjdwp:transport=dt_shmem,address=jdbconn,server=y,suspend=n -Djavaplugin.trace=true

    Hi,
    In order to debug, first you need to compile your .java files with -g option in javac.
    1)For debugging, start the Java PLug-in Control Panel.On the Basic tab,specify the following parameters in the Java Runtime Parameters:
    -Djavaplugin.trace=true
    -Xnoagent
    -Xdebug
    -Xrunjdwp:transport=dt_shmem-,address=jdbconn,server=y,suspend=n
    Check the address once again .
    2)On the Advanced tab in the Java Plug-in Control Panel, select "JDK <version> in <jdk-path>" for the Java Runtime, where <version> is the Java Plug-in version and <jdk-path> is the path to the Java 2 SDK installation. For example, "JDK1..3.1 in C:\jdk1.3.1" . Do not select the Debug Options under the Advanced tab.
    3)Start Internet Explorer or Netscape Navigator and load the page which contains the applet to be debugged. Make sure the applet code has been compiled with -g option in javac.
    4)Run the command jdb -attach <connection address> in a DOS command prompt. <connection address> is the name mentioned in the step 1. For example, if <connection address> is 2502, you will run the command as
              jdb -attach 2502
    5)Once the jdb has attached to the VM, you can set up breakpoints in the applet.
    6)When the applet in the browser reaches the breakpoint, it will stop executing, and you will see the debugger waiting for your input to continue debugging.
    Hope this will help you.
    Anil.
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Error while deploying a message driven bean

    I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file.
    #1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.policy.PolicyInfoManagerImpl##com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration#Administrator#523####e5dbec01b35c11db90e70016e6197593#SAPEngine_Application_Thread[impl:3]_39##0#0#Error#1#/System/Security/WS/SecurityProtocol#Java###An error occured while copying configurations for application . Reason: #3#sap.com/MessageEAR#com.sap.engine.frame.core.configuration.NameNotFoundException#A configuration with the path "webservices/services/sap.com/MessageEAR" does not exist.#
    Can you please tell where to look for it and what to do?

    the session bean is ::
    public class SenderBean implements SessionBean {
      public static final boolean DEBUG = false;
      private SessionContext ctx;
      private TopicConnectionFactory factory;
      private TopicConnection connection;
      private Topic topic;
      public SenderBean() {
         log("constructor");
      public void ejbCreateSender() throws CreateException {
         log("ejbCreate");
                try {
                   InitialContext naming = new InitialContext();
                   factory = (TopicConnectionFactory)naming.lookup("jmsfactory/default/ExceptionTopicFactory");
                   topic = (Topic)naming.lookup("jmstopics/default/ExceptionTopic");
                   log("factory: " + factory);
                   allocateResources();
                } catch (Exception exc) {
                   log("exception occured during ejbCreate().");
                   throw new CreateException("Unexpected exception in ejbCreate().");
      public void ejbCreate() throws CreateException {
      public void ejbActivate() {
         log("ejbActivate");
         try {
           allocateResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbPassivate() {
         log("ejbPassivate");
         try {
           releaseResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbRemove() {
         log("ejbRemove");
      public void setSessionContext(SessionContext _ctx) {
         log("setSessionContext");
         ctx = _ctx;
      public void sendMessage(String text) throws MessageNotSentException {
         log("sendMessage");
         log("text = " + text);
         TopicSession session = null;
         try {
           session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
           log("topic = " + topic);
           TopicPublisher publisher = session.createPublisher(topic);
           TextMessage textMessage = session.createTextMessage();
           textMessage.setText(text);
           publisher.publish(textMessage);
           System.out.println("Message Sent");
           log("message sent");
         } catch (JMSException jmse) {
           jmse.printStackTrace();
           throw new MessageNotSentException(jmse.toString());
         } finally {
           try {
              if (session != null) {
                session.close();
           } catch (Exception exc) {
      private void releaseResources() throws JMSException {
         connection.close();
         connection = null;
      private void allocateResources() throws JMSException {
         connection = factory.createTopicConnection();
         log("connection = " + connection);
         connection.start();
         log("connection started");
      private void log(String message) {
         if (DEBUG) {
           System.out.println("SenderBean: " + message);
    the mdb is::
    public class MessageDisplayBean implements MessageDrivenBean, MessageListener {
           public static final boolean DEBUG = false;
           private MessageDrivenContext ctx;
           private QueueConnectionFactory factory;
           private QueueConnection connection;
           private Queue queue;
           public MessageDisplayBean() {
              System.out.println("In constructor");
              log("constructor");
           public void onMessage(Message message) {
              TextMessage textMessage = (TextMessage)message;
              try {
                String text = textMessage.getText();
                log("message received. Text follows:\n\n  " + text + "\n\n");
                connection = factory.createQueueConnection();
                connection.start();
                QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                TextMessage confirmation = session.createTextMessage();
                confirmation.setText("Message \""+ textMessage.getText() + "\" received.");
                //queue = session.createQueue("ConfirmationQueue");
                QueueSender sender = session.createSender(queue);
                sender.send(confirmation);
                session.close();
                connection.close();
                System.out.println("Message received");
              } catch (javax.jms.JMSException jmse) {
           public void ejbRemove() {
              log("ejbRemove()");
           public void setMessageDrivenContext(MessageDrivenContext _ctx) {
              log("setMessageDrivenContext()");
              ctx = _ctx;
              System.out.println("In context");
           public void ejbCreate() {
              try {
                   System.out.println("In ejbcreate");
                InitialContext naming = new InitialContext();
                factory = (QueueConnectionFactory)naming.lookup("jmsfactory/default/ExceptionQueueFactory");
                queue = (Queue)naming.lookup("jmsqueues/default/ExceptionQueue");
                log("factory: " + factory);
              } catch (Exception exc) {
                log("exception occured during ejbCreate().");
              log("ejbCreate()");
           private void log(String str) {
              if (DEBUG) {
                System.out.println("MessageDisplayBean: " + str);
    th ejb-j2ee-engine.xml is::
    <ejb-j2ee-engine>
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>MessageDisplayBean</ejb-name>
                   <jndi-name>MessageDisplayBean</jndi-name>
                   <message-props>
                        <destination-name>ExceptionTopic</destination-name>
                        <connection-factory-name>ExceptionTopicFactory</connection-factory-name>
                   </message-props>
              </enterprise-bean>
              <enterprise-bean>
                   <ejb-name>MessageSender</ejb-name>
                   <jndi-name>MessageSender</jndi-name>
                   <session-props/>
              </enterprise-bean>
                   </enterprise-beans>
    </ejb-j2ee-engine>
    the ejb-jar.xml is::
                 <ejb-jar>
        <display-name>        Message Driver Bean Example      </display-name>
        <enterprise-beans>
            <session>
                <display-name>            MessageSender          </display-name>
                <ejb-name>MessageSender</ejb-name>
                <home>com.sap.message.sender.SenderHome</home>
                <remote>com.sap.message.sender.Sender</remote>
                <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                <local>com.sap.message.sender.SenderLocal</local>
                <ejb-class>com.sap.message.sender.SenderBean</ejb-class>
                <session-type>Stateful</session-type>
                <transaction-type>Container</transaction-type>
                <ejb-local-ref>
                    <ejb-ref-name>ejb/SenderBean</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                    <local>com.sap.message.sender.SenderLocal</local>
                    <ejb-link>MyEJB.jar#MessageSender</ejb-link>
                </ejb-local-ref>
                <resource-ref>
                    <res-ref-name>ExceptionTopicFactory</res-ref-name>
                    <res-type>javax.jms.TopicConnectionFactory</res-type>
                    <res-auth> Container</res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>ExceptionTopic        </resource-env-ref-name>
                    <resource-env-ref-type>   javax.jms.Topic        </resource-env-ref-type>
                </resource-env-ref>
            </session>
            <message-driven>
                <ejb-name>MessageDisplayBean</ejb-name>
                <ejb-class>com.sap.message.mdb.MessageDisplayBean</ejb-class>
                <transaction-type>Container</transaction-type>
                <message-driven-destination>
                    <destination-type>javax.jms.Topic</destination-type>
                </message-driven-destination>
                <resource-ref>
                    <res-ref-name>   ExceptionQueueFactory            </res-ref-name>
                    <res-type>              javax.jms.QueueConnectionFactory            </res-type>
                    <res-auth>              Container            </res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>        ExceptionQueue        </resource-env-ref-name>
                    <resource-env-ref-type>          javax.jms.Queue        </resource-env-ref-type>
                </resource-env-ref>
            </message-driven>
               </enterprise-beans>
        <assembly-descriptor>
            <container-transaction>
                <method>
                    <ejb-name>MessageDisplayBean</ejb-name>
                    <method-name>onMessage</method-name>
                </method>
                          <trans-attribute>           NotSupported         </trans-attribute>
            </container-transaction>
        </assembly-descriptor>
    </ejb-jar>

  • How to debug in SAP Netweaver Developers Studio?

    Hi there,
    I am trying to debug and slove my error in SAP NWDS.
    I am building portal application->JSPDynPage
    I am trying to debug the jsp code behind page, it doesn't realli give error message like the java beans does.
    I am quite new to this and do not know how to set the function to test and debug this page can anyone provide any solution ?
    I have have this prob pls refer to this link
    <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=192104">https://www.sdn.sap.com/irj/sdn/thread?threadID=192104</a>
    Thanks loads
    Quatre

    Hi Quatre ,
    -Select the breakpoints in your Dynpages /beans in ur project
    -To debug u have to change the prespective to debug which u can find in
    window/open prespective /Debug in NWDS
    -Select the Run/Debug or the Debug icon in the toolbar.
    -Fill the project name ,application name in  the in the wizard opnend .
    - Follow the debugging using the next step over F6 ,step return F7 keys .
    These link may be helpful:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/66/547f09281d464b951c9a3a6b06a12d/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a8/def86ab54da5418a3575373934ca00/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d4/31e24044b80b06e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/be/cffcb407c67842b122bd1296dc810f/frameset.htm
    U can always find out the way in the PDK development /how to debug/
    ie in NWDS /HELP /SAP WAS AS Documentation /SAP J2ee Enterprise Java Beans/Java development User Guide /Running and Debugging
    Cheers,
    Swathi Rao
    Do offer pts:-)

  • Session scope managed bean is not instantiating?

    We have the need to use a session bean (rather than pageFlowScope) in our application.  But it looks like the session beans are not being instantiated at run time like other beans are.  I created a simple test case to verify.  One bean, named "MySessionBean", defined in the task flow as Session scope, then referenced in a view with an input text box, value:  #{sessionScope.MySessionBean.value1}. When I run the application,  I just get PropertyNotFoundException, Target Unreachable, 'MySessionBean' returned null.
    If I simply change the bean to use pageFlowScope, everything works fine.   I have debug code in the bean constructor, and it never gets called.   Is there some other step I am missing to have ADF instantiate the session bean?

    No luck, I tried it in both adfc-config.xml, and faces-config.xml.  I also tried moving the call to my view, from my bounded taskflow, into the adfc-config unbounded task flow, and then I ran that instead.  Still got the same error.    Here is my code from the the last round of tests with the view called in the main adfc-config.xml unbounded taskflow:
    adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
          <view id="testView">
                <page>/testView.jspx</page>
          </view>
          <managed-bean id="__2">
          <managed-bean-name id="__5">MySessionBean</managed-bean-name>
          <managed-bean-class id="__4">test.MySessionBean</managed-bean-class>
          <managed-bean-scope id="__3">session</managed-bean-scope>
        </managed-bean>
    </adfc-config>
    testView.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:inputText label="Label 1" id="it1"
                          value="#{sessionScope.MySessionBean.value1}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    MySessionBean.java:
    package test;
    public class MySessionBean {
        private String value1="Hello World";
        public MySessionBean() {
            super();
        public void setValue1(String value1) {
            this.value1 = value1;
        public String getValue1() {
            return value1;

  • Value from backing bean in javascript confirm in 10.1.3

    Hallo,
    Please help
    I have 2 problems:
    Page with 1 record, where 8 items are updatable.
    In entity I 've a method where I set a value in bean. (BotId1 is one of these 8 updatebale items)
    What I expect: when I change a value in BotId1 the value of botId in ValiderenBotBean will be also changed
    public void setBotId1(Number value) {
    setAttributeInternal(BOTID1, value);
    EL.set("#{ValiderenBotBean.botId}",BotId.toString());
    My bean (session scope):
    package viewcontroller.pagedefs.produceren.backing;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ValiderenBotBean
    private static Log log = LogFactory.getLog(ValiderenBotBean.class);
    private String botId;
    public ValiderenBotBean() {
    // accessors
    public void setBotId(String botId) {
    log.debug("setBotId : " + botId);
    this.botId = botId;
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    return this.botId;
    Op my generaten page I have the button:
    <af:commandButton actionListener="#{bindings.Commit.execute}"
    action="Commit" onclick="if (validateForm('dataForm')){return(confirm(#{ValiderenBotBean.botId} + 'la')}"
    rendered="#{(((jhsUserRoles['JDMR_PRD03']) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])}" textAndAccessKey="#{nls['SAVE_BUTTON_LABEL_KOPPELENPRODUCTIEGEGEVENS']}"
    id="KoppelenProductiegegevensSaveButton">
    <af:resetActionListener/>
    </af:commandButton>
    I get the following error:
    Foutdetails webpagina
    Gebruikersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; AskTB5.6)
    Tijdstempel: Thu, 17 Feb 2011 13:54:46 UTC
    Bericht: Syntaxisfout
    Regel: 3744
    Teken: 1
    Code: 0
    URI: http://172.16.6.108:8988/demeter/adf/jsLibs/Common10_1_3_2_0.js
    The code from Common:
    3732 function _callChained(
    3733 a0,
    3734 a1,
    3735 a2
    3736 )
    3737 {
    3738 if(a0&&(a0.length>0))
    3739 {
    3740 if(a2==(void 0))
    3741 {
    3742 a2=a1.window.event;
    3743 }
    3744 var a3=new Function("event",a0);
    3745 a1._tempFunc=a3;
    3746 var a4=a1._tempFunc(a2);
    3747 a1._tempFunc=(void 0);
    3748 return!(a4==false);
    3749 }
    3750 else
    3751 {
    3752 return true;
    3753 }
    3754 }
    Problem nr.1:
    When I call the button I do not see any logging that indicate that the value is set in backing bean
    Workaround: I made item on my page depending on item where I put my code.
    Result: I have to press 2 times on my button to execute the button code. First time to make the validation and the second time the button code itself.
    Not nice. The validation is also slow.
    But ok:
    Problem 2:
    I still get the same error, I see logging of execution of my validation.
    There is also the difference between loggings is 2 cases:
    If I use
    onclick="if (validateForm('dataForm')){return((#{ValiderenBotBean.botId} + 'la')}"
    what I really want instead of
    onclick="if (validateForm('dataForm')){return'la')}"
    I get:
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    It means that value is obtained correctly.
    But still the same error.
    If I put for test purpose
    the following code into my bean:
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    botId = "23";
    return this.botId;
    I do not get any error.
    Any ideas?
    Please help

    Thanks, Amit,
    I will try it tomorrow.
    Some remarkes:
    1. I need javascript for confirmation
    2. I really do not PPR. It takes so long. The user use the scanner to put the value into input items in order speed up the process. And now PPR...
    3. My transient attribute will depend on 8 items. Even more waiting process.
    What I really want is to execute my db function only 1 time "onclick" or "oncommit" and according to outcome of db-function ask user for confirmation of commit.
    I tried already to implement dialog from ADF with launchDialog function.
    But ReturnListener did not function while I launch the Dialog manually.
    Anna

  • Action / actionListener in h:commandButton with managed beans

    I have a problem with a backing bean whose method is not invoked when i click it. I've seen some posts on here about this yet, I still don't understand what I am doing wrong, if anything.
    Some context...I've modeled my application after 'jcatalog' from this article:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html . It's simpler than the article -- I'm not using Spring/Hibernate and the persistence is the file system. For each business object (Resource), there's a backing bean (ResourceBean).
    In short, I can't get the backing bean to respond to the button event for 'Add' bound to addAction. This is just like the jcatalog 'createProduct' impl -- which doesn't use the (FacesEvent fe ) approach.
    Anyway, I would appreciate anyone's help to get past this.
    -Lorinda
    (Below are the codes...)
    Here's my beans-config.xml:
         <!-- view -->
         <managed-bean>
              <description>
                   Managed bean that is used as an application scope cache
              </description>
              <managed-bean-name>applicationBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ApplicationBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
              </managed-bean>
         <managed-bean>
              <description>
                   View service manager impl for business services
              </description>
              <managed-bean-name>viewServicesManagerBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ViewServicesManagerBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <description>
                   Backing bean that contains product information.
              </description>
              <managed-bean-name>resourceBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ResourceBean
              </managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    (Note, the applicationBean uses view services manager. The manager is used by the ResourceBean. (It's initialized by the h:output dummy variable reference at the top of my .jsp page)). I can see the initialization in the debug trace.
    Here's the resource bean:
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.FacesException;
    import javax.faces.model.SelectItem;
    import com.intalio.qa.exceptions.DuplicateIdException;
    import com.intalio.qa.exceptions.TCMException;
    import com.intalio.qa.tcm.model.Resource;
    import com.intalio.qa.tcm.view.builders.ResourceBuilder;
    import com.intalio.qa.tcm.view.util.FacesUtils;
    * Resource backing bean.
    public class ResourceBean extends RootBean {
    * The Resource id
         private String id;
         * The Resource name
         private String name;
    * Description
    private String description;
         * the resource type id associated with the Resource
         private String resourceTypeId;
    // the resource type id associated with the Resource
    private List resourceTypeIds;
    * @return Returns the resourceTypeIds.
    public List getResourceTypeIds() {
    return resourceTypeIds;
    * @param resourceTypeIds The resourceTypeIds to set.
    public void setResourceTypeIds(List resourceTypeIds) {
    this.resourceTypeIds = resourceTypeIds;
         * Default constructor.
         public ResourceBean() {
    super();
    init();
         * Initializes ResourceBean.
         * @see RootBean#init()
         protected void init() {
              try {
                   LOG.info("ResourceBean init()");
                   if (id != null) {
                        Resource resource = viewServicesManager.getResourceService().getResourceById(id);
                        ResourceBuilder.populateResourceBean(this, resource);
              } catch (TCMException ce) {
                   String msg = "Could not retrieve Resource with id of " + id;
                   LOG.info(msg, ce);
                   throw new FacesException(msg, ce);
         * Backing bean action to update Resource.
         * @return the navigation result
         public String updateAction() {
              LOG.info("updateAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
              //     LOG.info("ResourceId = " + Resource.getId());
              //     viewServicesManager.getResourceService().updateResource(Resource);
                   //remove the ResourceList inside the cache
                   //FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not update Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error.");
                   return NavigationResults.FAILURE;
              LOG.info("Resource with id of " + id + " was updated successfully.");
              return NavigationResults.SUCCESS;
         * Backing bean action to create a new Resource.
         * @return the navigation result
         public String addAction() {
              LOG.info("addAction is invoked");
              try {
                   Resource resource = ResourceBuilder.createResource(this);
    LOG.info("between");
                   viewServicesManager.getResourceService().saveResource(resource);
              } catch (DuplicateIdException de) {
                   String msg = "This id already exists";
                   LOG.info(msg);
                   FacesUtils.addErrorMessage(msg);
                   return NavigationResults.RETRY;
              } catch (Exception e) {
                   String msg = "Could not save Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was created successfully.";
              LOG.info(msg);
              return NavigationResults.SUCCESS;
         * Backing bean action to delete Resource.
         * @return the navigation result
         public String deleteAction() {
              LOG.info("deleteAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
         //          viewServicesManager.getResourceService().deleteResource(Resource);
                   //remove the ResourceList inside the cache
    //               FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not delete Resource. ";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(null, msg + "Internal Error.");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was deleted successfully.";
              LOG.info(msg);
              FacesUtils.addInfoMessage(msg);
              return NavigationResults.SUCCESS;
         public String getId() {
              return id;
         * Invoked by the JSF managed bean facility.
         * <p>
         * The id is from the request parameter.
         * If the id is not null, by using the id as the key,
         * the Resource bean is initialized.
         * @param newQueryId the query id from request parameter
         public void setId(String newId) {
              id = newId;
         public String getName() {
              return name;
         public void setName(String newName) {
              name = newName;
         public String getDescription() {
              return description;
         public void setDescription(String newDescription) {
              description = newDescription;
         public String getResourceTypeId() {
              return resourceTypeId;
         public void setResourceTypeId(String newResourceTypeId) {
              resourceTypeId = newResourceTypeId;
         public String toString() {
              return "id=" + id + " name=" + name;
    Here's the jsp:
    <f:subview id="resourcesCombinedView_subview">
         <h:form id="createResourceForm" target="dataFrame">
              <h:outputText value="#{applicationBean.dummyVariable}" rendered="true" />
              <div align="center">
              <head>
              <link href="../../css/stylesheet.css" rel="stylesheet" type="text/css">
              <FONT color="#191970" size="4" face="Arial">Resources View</FONT>
              </head>
              <table style="margin-top: 2%" width="35%" cellpadding="10">
              <div align="left">
              <FONT color="#191970" size="3" face="Arial">Update Resources </FONT>
              </div>
                   <tr>
                        <td align="center" valign="top" align="center" style="" bgcolor="white" />
                        <table>
                             <tbody>
                                  <tr>
                                       <td align="left" styleClass="header" width="100" />
                                       <td align="left" width="450"/>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Id" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.id}" id="id" required="true" /> <h:message
                                            for="id" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Name" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.name}" id="name" required="true" /> <h:message
                                            for="name" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Type" /></td>
                                       <td align="left" width="550">
                                       <h:selectOneMenu
                                            value="#{resourceBean.resourceTypeId}" id="resourceTypeId">
                                            <f:selectItem itemValue="" itemLabel="Select Resource Type" />
                                            <f:selectItem itemValue="database" itemLabel="Database" />
                                            <f:selectItem itemValue="external application"
                                                 itemLabel="External Application" />
                                            <f:selectItem itemValue="internal"
                                                 itemLabel="Intalio|n3 Products" />
                                            <f:selectItem itemValue="os" itemLabel="Operating System" />
                                       </h:selectOneMenu> <h:outputText
                                            value="#{resourceBean.resourceTypeId}" /> <h:message
                                            for="resourceTypeId" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Description" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.description}" id="description" size="96" />
                                       <h:message for="description" styleClass="errorMessage" /></td>
                                  </tr>
                             </tbody>
                        </table>
                        </h:form></td>
                        <!-- END DATA FORM -->
                        <!-- BEGIN COMMANDS -->
                        <td width="30%" align="left" valign="top"><h:form
                             id="buttonCommandsForm">
                             <h:panelGroup id="buttons">
                                  <h:panelGrid columns="1" cellspacing="1" cellpadding="2"
                                       border="0" bgcolor="white">
                                       <h:commandButton value="Add"
                                            style="height:21px; width:51px;font-size:8pt; font-color: black;"
                                            actionListener="#{resourceBean.addAction}">
                                       </h:commandButton>
                                       <h:commandButton id="deleteCB" value="Delete"
                                            style="height:21px; width:51px;font-size:8pt"
                                            action="#{resourceBean.deleteAction}">
                                       </h:commandButton>
                                       <h:commandButton id="spaceFillerButton" tabindex="-1"
                                            style="height:21px; width:51px;font-size:8pt;background-color: #ffffff;color: #ffffff;border: 0px;">
                                       </h:commandButton>
                                       <h:commandButton id="saveCB" value="Save"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.saveAction}">
                                       </h:commandButton>
                                       <h:commandButton id="updateCB" value="Update"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.updateAction}">
                                       </h:commandButton>
                                  </h:panelGrid>
                             </h:panelGroup>
                        </h:form> <!-- end buttons --></td>
                   </tr>
              </table>
              <HR align="center" size="2" width="60%" />
              <!-- data table --></div>
    </f:subview>

    Hey, anyway, have you note your jsp reference to the backing bean begins with a lowercase letter, and your backing bean class name begins with an uppercase letter?? I think that's it... I think, cause I'm too unexperienced in JSF.... Bye!!

  • Error on bean:message and resource properties file ??

    Hi everyone! I'm new to struts and i just can't figure out why tomcat's giving me an error. I've manage to run a simple example but when i use the bean:message tag i get this error
    ERROR IS:
    java.lang.NullPointerException
         org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1175)
         org.apache.struts.taglib.TagUtils.message(TagUtils.java:1038)
         org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
         org.apache.jsp.index_jsp._jspx_meth_bean_message_0(org.apache.jsp.index_jsp:135)
         org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:101)
         org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Can anyone help me with this problem?
    my ApplicationResources.propeties file is in WEB-INF/classes
    index.jsp
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html locale="true">
    <head>
        <title> <bean:message key="index.title"/> </title>
    </head>
    <body>
    <html:link module="/exercise" action="/welcome">Taglib Test Pages</html:link>
    </body>
    </html:html>
    web.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <!-- Action Servlet Configuration -->
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <!-- Resources bundle base class -->
        <init-param>
          <param-name>application</param-name>
          <param-value>ApplicationResources</param-value>
        </init-param>
          <!-- Context-relative path to the XML resource containing Struts configuration information -->
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <!-- The debugging detail level for this servlet, which controls how much information is logged. -->
        <init-param>
         <param-name>debug</param-name>
         <param-value>2</param-value>
        </init-param>
        <init-param>
         <param-name>detail</param-name>
         <param-value>2</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Action Servlet Mapping -->
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
    <!-- The Welcome File List -->
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <!-- Struts Tag Library Descriptors -->
      <taglib>
        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <!-- Application Tag Library Descriptor -->
      <taglib>
        <taglib-uri>/WEB-INF/app.tld</taglib-uri>
        <taglib-location>/WEB-INF/app.tld</taglib-location>
      </taglib>
    </web-app>Please help..thanks in advance

    I have that on my struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>
      <form-beans>
    </form-beans>
      <global-forwards>
      </global-forwards>
      <action-mappings>
      </action-mappings>
      <message-resources parameter="ApplicationResources"/>
    </struts-config>and I also include it on my web.xml file
    <!-- Resources bundle base class -->
        <init-param>
          <param-name>application</param-name>
          <param-value>ApplicationResources</param-value>
        </init-param>

  • How can get the value of a HtmlInputText (created in the bean)

    Hi All,
    I have created a HtmlInputText object in the Backing Bean (the getter and setter are in another Bean used to manage the data, getEditableInputText and setEditableInputText)
    //getter and setter in Bean
    public HtmlInputText getEditableInputText() {
    return this.editableInputText;}
    public void setEditableInputText(HtmlInputText editableInputText) {
    this.editableInputText = editableInputText;
    I set the value in the Backin Bean
    The HtmlInputText is bound in the xml in this way:
    <h:inputText id="test" binding="#{Bean.editableInputText}"></h:inputText>
    When I load the page I can see the TextField with the value that I set previously (in the backin bean).
    The problem is when I try to change the value of the texField:
    I change the value, then I click on a button (its action is to call a method to get the value of the field).
    In debug mode I see that the value is allways the first set instead of the new value inserted.
    I tried with getValue and similar but it does not work.
    I tried also to put HtmlInputText in a panel (using a similar logic) and then to get it using getChildren() method but also this does not work.
    Any idea?
    Thanks in advance

    Ok (now I understand)
    I have used bean.getEditedInputText() and it is not null.(I got the HtmlInputTextObject)
    But bean.getEditedInputText().getValue has allways the first value set.
    If I don't set previously the value (in the backin bean) the getValue() is allways null.
    So my problem is that I can set but I cannot get the Value when I change it.
    Edited by: LucaMane on Nov 16, 2008 5:13 AM

Maybe you are looking for

  • WIndows compatibility issue for itunes 7

    I just upgraded to itunes 7. My shortcut icons for itunes are no lnger itunes images but a generic icon. Also when I open itunes it says my "version of itunes is set to run in compatibility mode to run with al older version of windows. For best resul

  • Dynamic user/role management

    I'm currently working with WebLogic 6.1 and looking into doing what seems to be a standard piece of development work, specifically dynamic user management. I need the ability to create/modify a user and define them as members of security role(s) from

  • Exception Aggregation for a Calculated Key Figure in a Structure

    Hello BI world, Please can someone tell me if it is technically possible to use "exception aggregation (count) in a calculated key figure within a structure. The definition of the structure is: Rows: Characteristic (Selection) = Problem type (0CATCOD

  • Trying to test a superduper bootable disk backup

    Running OSX 10.5.8 Followed Superduper instructions , first partitioning a new 1TB external (lacie USB) using GUID and extended journaled format, then doing earase and copy all application of superduper. But when i try to use the external to boot I g

  • Problem with 0RECORDMODE in datamart from ODS tu Cube

    Hi all, i need to do a datamart from a cube to an ODS, when i create the Update rules (in 3.5), this ask me "the infoobject 0RECORDMODE doesnt exist in the infosource", thats ok because the cube doesnt need the 0RECORDMODE, but the most weird is, all