Cannot lookup the bean in JBoss

I had a entity bean called AddressBean and bind the JNDI name as ejb/entity/AddressBean, but I cannot lookup this bean. The NameNotFoundException is thrown, the exception message is "ejb not bound". Did anyone know what happen with it?
Hashtable props = new Hashtable();
props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
InitialContext initialContext = new InitialContext(props);
Object obj = initialContext.lookup("ejb/entity/AddressBean");But I can lookup this bean by using the default JNDI name "AddressBean".

I've been trying to make a lookup from a remote client.
I've tried this code
props.put(InitialContext.PROVIDER_URL, "jnp://10.10.10.10:1099");
I get the error unknown protocol
Ofcourse 10.10.10.10 was not the acutal ip address of the machine on which JBoss was running. While running the code i did have the correct ip address.
Then I tired the approach discussed here
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=63&t=000150
Now i get a "no protocol" error.
I have included the jboss-client.jar and the jnp-client.jar in the classpath of the client.
Can someone help me out with this?

Similar Messages

  • JSP file cannot find the beans

    Hi all,
    My question is about Tomcat and JSP with Javabean.
    I put my .jsp files under c:\tomcat\webapps\examples\jsp\Demo,
    it works correctly, but when I add:
    <jsp:useBean id="data" scope="session" class="DataBean" />
    Where DataBean at:c:\tomcat\webapps\examples\WEB-INF\classes\DataBean.class
    it throuws exception as follow:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 25 in the jsp file: /jsp/Demo/base.jsp
    Generated servlet error:
    C:\Tomcat\work\localhost\examples\jsp\Demo\base$jsp.java:60: Class org.apache.jsp.DataBean not found.
    DataBean DataBean = null;
    BTW:The DataBean.class compiled withou any error.
    OS:WIN2000
    Tomcat4.0
    It looks like the Server can't find the class, but it exists.
    Any suugestion?
    Thanks!

    Try putting the Bean in a package - for some reason Tomcat doesn't always find classes in the default package.
    i.e. add a package statement to DataBean and change the useBean to include class="yourpackage.DataBean".
    Hope this helps.

  • Cannot set the bean

    error comes from the tomcat is:
    Error testing property 'name' in bean of type null
    plzzz resolve this prob

    Look at this:
    http://www.jsf-faq.com/faqs/faces-exception.html#103

  • Deployment of Beans in JBoss

    Kindly let me know the deployment procedure for the Beans in JBoss server. viz..the jar files to be created and so on..

    Kindly let me know the deployment procedure for the Beans in JBoss server. viz..the jar files to be created and so on..

  • WTC8.1 cannot lookup TuxedoConnection in JNDI for a Tuxedo8.1 service

    Hi,
    I have Weblogic WTC configured to use a Tuxedo service and the ejb cannot lookup the TuxedoConnection object.
    The error from the client is shown below:
    java tperrno encountered: TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not get TuxedoConnectionFactory : javax.naming.NameNotFoundException: Unable to resolve 'tuxedo.services.TuxedoConnection' Resolved tuxedo.services; remaining name 'TuxedoConnection'
    I confirmed that the Tuxedo service is listening on port 9001 on machine 15.8.156.143
    Here is the wtc server config:
    <WTCServer Name="mySimpapp">
    <WTCRemoteTuxDom AccessPoint="myRemoteAp" AccessPointId="TDOM1
    LocalAccessPoint="myLocalAp" NWAddr="//15.8.156.143:9001"
    Name="WTCRemoteTuxDom-1251829072487"/>
    <WTCImport LocalAccessPoint="myLocalAp"
    Name="WTCImport-1251829191287"
    RemoteAccessPointList="myRemoteAp" RemoteName="TOUPPER" Re
    sourceName="TOUPPER"/>
    </WTCServer>
    and here is the tuxedo service config:
    *DM_RESOURCES
    VERSION=U22
    *DM_LOCAL_DOMAINS
    TDOM1 GWGRP=GROUP2
    TYPE=TDOMAIN
    DOMAINID="TDOM1"
    BLOCKTIME=20
    MAXDATALEN=56
    MAXRDOM=89
    DMTLOGDEV="/opt/beatux/tuxedo8.1/samples/wtc/simpserv/tlog"
    DMTLOGNAME="log1"
    *DM_REMOTE_DOMAINS
    *DM_TDOMAIN
    TDOM1 NWADDR="//15.8.156.143:9001"
    *DM_REMOTE_SERVICES
    I looked at the JNDI tree in Weblogic console and there is no tuxedo.services.TuxedoConnection object in the JNDI tree.
    regards
    -Sarab

    Hi Sarab,
    Did you target the WTC Server to one of your WLS instances? As for something listening on "//15.8.156.143:9001", you appear to have both WTC and Tuxedo trying to use that port to listen on. That's not going to work. If WLS and Tuxedo are on the same machine, the local domain (local access point) for each needs to listen on a unique port. So at a minimum you need to have WTC listen on one port and the Tuxedo domain gateway listen on a different port. Also, whether Tuxedo is up or not will not affect your ability to get the JNDI name.
    Also, you should see in the WLS startup log indications that WTC started if it has been targeted to a WLS instance.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • How to lookup a Bean?

    i have successfully deployed an EJB by using J2EE deploytool.
    my source code to lookup the Bean as following:
    Context ctx = new InitialContext(System.getProperties());
    java.lang.Object objref = ctx.lookup("skey");
    home = (SessionKeyHome)PortableRemoteObject.narrow(objref, com.ibm.sessionkey.SessionKeyHome.class);
    i have read serval books and articles,there are different codes for lookuping a bean.Why?and when should we use this or that?
    But i get the error msg:
    Warning: unable to read transaction.interoperability config property
    java.io.FileNotFoundException: /export/home/ass/config/security.properties
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:103)
    at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42)
    at com.sun.enterprise.iiop.security.SecurityMechanismSelector.<clinit>(SecurityMechanismSelector.java:102)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.getEndPointInfo(IIOPSSLSocketFactory.java:211)
    at com.sun.corba.ee.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:73)
    at com.sun.corba.ee.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:68)
    at com.sun.corba.ee.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:70)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(InitialNamingClient.java:769)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostInfo(InitialNamingClient.java:597)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(InitialNamingClient.java:573)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBInitRef(InitialNamingClient.java:544)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1080)
    at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:981)
    at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:2425)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:52)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
    at javax.naming.InitialContext.lookup(InitialContext.java:347).java:23)
    javax.naming.CommunicationException: Can't find SerialContextProvider
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)

    Hi,
    There r two ways to lookup. One is that u specify the provider while running the client. E.g:
    java -D java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    -Djava.naming.provider.url=t3://localhost:7001
    or alternatively u can specify these two properties in the Properties object of your client. e.g:
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,"t3://localhost:7001");
    Context ctx = null;
    Object obj = null;
    try
    ctx = new InitialContext(props);               
    obj = ctx.lookup("HelloJNDI");
    Which method to use is matter of convenience.
    Values of provider url & initialContext will change depending on the app server u r using.
    I hope this will help u.

  • Where to put the Bean class in a html- Bean- JSP setup

    Hi,
    The setup is simple, the front end is a html form, there is a Java Bean with set/get methods and finally a jsp which accesses the bean and prints the result.
    The problem is that it cannot locate the Bean class. I have compiled the bean class and stored the .class file in webapps/ROOT/WEB-INF/classes dir. The jsp and html files are located in the webapps/ROOT dir. Iam using tomcat 5.0.28, with ROOT context enabled. Is this because I need to set the CLASSPATH for Tomcat? Any pointers?
    Thanks

    No you don't need to set CLASSPATH.
    You need to put your bean in a package.
    As of java1.4, JSPs can not access beans that are in the default/unnamed pacakge.
    package mypackage
    public class MyClass
    and then the class would compile to
    WEB-INF/classes/mypackage/MyClass.class

  • Cannot resolve the symbol while using use bean in jsp

    Hi,
              Jsp with weblogic version 4.5 were running fine. When running on
              weblogic server 6.1 I get an error while running jsp pages cannot resolve
              symbol
              probably due to
              <jsp:useBean id = "hmllinkbean1" class="com.accupac.html.htmllink.LinkRS"/>
              I have the bean classes in
              config/accudomain/applications/DefaultWebApp_myserver/Web-inf/classes/
              and jsp files in the directory
              config/accudomain/applications/DefaultWebApp_myserver/
              Any help will be appreciated.
              Thanks
              madhu
              

    Three possibilities:
              Is your directory name really "Web-inf"? That will not work. It needs to be "WEB-INF".
              In WEB-INF, do you have:
              classes/com/accupac/html/htmllink/LinkRS.class
              When you say "cannot resolve symbol", is it the LinkRS class that it can't resolve?

  • Obtaining PersistenceManager from Session Bean in JBoss 3.0.4

    Hi,
    I'm attempting to use the JCA for JBoss with Kodo 2.4.0. The kodo.rar seems to deploy ok:
    2002-12-18 11:19:43,640 INFO [com.solarmetric.kodo.impl.jdbc.ee.ManagedConnectionFactoryImpl.kodo] Bound connection factory for resource adapter 'KodoJDO' to JNDI name 'java:/kodo'
    2002-12-18 11:19:43,640 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Started
    2002-12-18 11:19:43,640 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/kodo.rar
    In my session bean, I access the PersistenceManager using the following code:
    InitialContext context _ new InitialContext();
    JDOConnectionFactory factory _ (JDOConnectionFactory)context.lookup("java:/kodo");
    PersistenceManager pm _ (PersistenceManager)factory.getConnection();
    The code generates a JDOFatalDataStoreException when I try to execute it:
    Error in use of ManagedConnectionPool: matchManagedConnection failed with subject: null and ConnectionRequestInfo: [email protected]3be7ac; - nested throwable: (javax.resource.ResourceException: Error in use of ManagedConnectionPool: matchManagedConnection failed with subject: null and ConnectionRequestInfo: [email protected]3be7ac)
    And when I execute it a second time around, it seems to retrieve the PersistenceManager ok, but when I try to invoke methods on it, I get an SQLException:
    Connection is broken: Software caused connection abort: socket write error
    at com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newDataStoreId(JDBCStoreManager.java:464)
         at com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1107)
         at com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:1059)
         at org.aims.his.ejb.PatientBean.createPatient(PatientBean.java:117)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
         ... 47 more
    So...what did I miss? Could it be the configuration of my connection to the database in kodo-service.xml (see attached)? In the server log files I didn't see any of my connection properties.
    Any help is appreciated.
    Thanks,
    Jeff

    Ok, looks like it was the kodo-service.xml file. I removed the ConnectionFactoryName entry and most of the options were commented out which I didn't catch...
    Thanks,
    Jeff
    "Jeff Carnegie" <[email protected]> wrote in message news:[email protected]...
    Hi,
    I'm attempting to use the JCA for JBoss with Kodo 2.4.0. The kodo.rar seems to deploy ok:
    2002-12-18 11:19:43,640 INFO [com.solarmetric.kodo.impl.jdbc.ee.ManagedConnectionFactoryImpl.kodo] Bound connection factory for resource adapter 'KodoJDO' to JNDI name 'java:/kodo'
    2002-12-18 11:19:43,640 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Started
    2002-12-18 11:19:43,640 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/kodo.rar
    In my session bean, I access the PersistenceManager using the following code:
    InitialContext context _ new InitialContext();
    JDOConnectionFactory factory _ (JDOConnectionFactory)context.lookup("java:/kodo");
    PersistenceManager pm _ (PersistenceManager)factory.getConnection();
    The code generates a JDOFatalDataStoreException when I try to execute it:
    Error in use of ManagedConnectionPool: matchManagedConnection failed with subject: null and ConnectionRequestInfo: [email protected]3be7ac; - nested throwable: (javax.resource.ResourceException: Error in use of ManagedConnectionPool: matchManagedConnection failed with subject: null and ConnectionRequestInfo: [email protected]3be7ac)
    And when I execute it a second time around, it seems to retrieve the PersistenceManager ok, but when I try to invoke methods on it, I get an SQLException:
    Connection is broken: Software caused connection abort: socket write error
    at com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newDataStoreId(JDBCStoreManager.java:464)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1107)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:1059)
    at org.aims.his.ejb.PatientBean.createPatient(PatientBean.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
    ... 47 more
    So...what did I miss? Could it be the configuration of my connection to the database in kodo-service.xml (see attached)? In the server log files I didn't see any of my connection properties.
    Any help is appreciated.
    Thanks,
    Jeff

  • How to lookup a bean from a standalone app.

    I've got the following question..
    I've created a stateless sessionbean and deployed it in the J2EE Server 1.3.1. (That one you get from Sun when you download the J2EE SDK) I've created a client for my bean, and when i execute it with the 'runclient -client my.ear -name myclientclass' command, it works just fine.
    But, i now want to run it as a standalone application, without the 'runclient' command. I am able to create an initialcontext (without any properties), but my bean can not be found in 'java:comp/env/ejb/bean' (the same name i use with the 'runclient' command, so the bean should be there). My guess is that i should add some initial context properties, but which ones? All the examples i can find are with ldap context factories. Can anyone give me any advice on how to connect to the J2EE server and lookup my bean?
    Thanks in advance.
    Nick

    Hi,
    You could write something as below
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL, "jnp:localhost:1099");
    env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
    try {
    Context ctx = new InitialContext(env);
    Session_LocalHome session_lh = (Session_LocalHome) ctx.lookup("Session_Home");
    Session_ session_ = session_lh.create();
    OR
    Use a jndi.properties file which would have the same entries as above, please search over internet and find out what to include in it.
    One more thing to note is, in above example i said
    env.put(Context.PROVIDER_URL, "jnp:localhost:1099");
    meaning the lookup is on port 1099, this is not same for all the servers. Check your server documentation and find out " What is the port number on which your server listens ? "
    Regards
    Meka Toka

  • Cannot capture the exception generated by EJB components.

    Hi, All:
    I got a strange problem when developing EJB application under SAP WAS server. I developed an EJB as below:
    public class UserAccountBean implements SessionBean{
         String getUserEmail(String accountID) throws SAPSystemException{
              if(error){
                   throw new SAPSystemException("Specified user not found.");
    Exception I defined as below.
    public class SAPSystemException extends Exception {
    @param message
         public SAPSystemException(String message) {
              super(message);
    In client side I code as below:
    public String getUserMail(String accountID){
         UserAccount bean = home.create();
         try{
              String email = bean.getUserEmail(accountID);
         }catch(SAPSystemException e){
              // do something here;
         }catch(Exception e){
              // do some other thing here;
    It is strange that the SAPSystemException I throw out in the bean cannot be caught by the block catch(SAPSystemException e), it is only captured as general exception and it is said as UndeclaredThrowableException.
    When I deployed EJB components and Web components together, the exception can be captured successfully. But when I deployed them separately, it has problem for exception capture. I think it must be the protocol problem. Before I only use RMI-IIOP but SAP WAS server using RMI-P4. Is anything I can do to solve this problem?
    I packed the remote and home interface for the EJB and common classes like value objects and exceptions in both components. Is there anything I forgot to set for the deployment?
    Thanks in advance.
    Message was edited by: Weimin Guo
    Message was edited by: Weimin Guo

    Thank you very much Gregor. In fact, I already defined this throws exception in the remote object interface.
    public interface UserAccount extends EJBObject {
         public String getUserEmail(String accountID) throws RemoteException, SAPSystemException;
    This is application-specific interface and this mechanism works well in my previous in other application server.
    I checked the SAP document and found if you using RMI-IIOP, you need to get the client package for your deployed EJBs and put in the path accessible by the WEB components. Based on this suggestion, I put the EJB jar file together with WEB application (Sure the EJB application still deployed in other host and JNDI point to that host. I remembered one book mentioned that if you don't want generate the client package from EJB containter, you can do it this way. For me, I just haven't found the way to get the client package with Administrator Tool it said.), It works!!!. I checked the remote object generated by home object, it is different with EJB jar file there or not. But in the document SAP said that only if you use RMI-IIOP you need do this way, for RMI-P4, you don't need that. Anyway, it seems that RMI-P4 use same way as RMI-IIOP(You only don't need narrow the home object after lookup).
    I'll try to find how to get EJB client package from WAS server. For this is my first time to use SAP WAS Server, things a little strange.
    Thank you very much for your great help.
    Cheers.

  • NullPointerException - Cannot get the value from variable f_cashGiven

    In SubCheckout.java (a POS), what I want is when Payment button (f_cashPayment) is pressed, the action "Cash" is performed, get the value from Cash Given (f_cashGiven), do the subtraction and post the value as Cash Return (f_cashReturn). The code is filled in actionPerformed. But I cannot get the value by using f_cashGiven.getValue() from VNumber class. It returns NULL. This should be quite straight forward, but I do not know what is wrong. Please help!
    Enclosed please find the source code of SubCheckout.java and VNumber.java
    This is the code of SubCheckout.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.pos;
    import java.awt.*;
    import java.awt.event.*;
    import java.math.BigDecimal;
    import javax.swing.border.*;
    import org.compiere.grid.ed.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     POS Checkout Sub Panel
    *  @author Jorg Janke
    *  @version $Id: SubCheckout.java,v 1.3 2005/03/11 20:28:22 jjanke Exp $
    public class SubCheckout extends PosSubPanel implements ActionListener
          *      Constructor
          *     @param posPanel POS Panel
         public SubCheckout (PosPanel posPanel)
              super (posPanel);
         }     //     PosSubCheckout
         private CButton f_register = null;
         private CButton f_summary = null;
         private CButton f_process = null;
         private CButton f_print = null;
         private CLabel f_lcreditCardNumber = null;
         private CTextField f_creditCardNumber = null;
         private CLabel f_lcreditCardExp = null;
         private CTextField f_creditCardExp = null;
         private CLabel f_lcreditCardVV = null;
         private CTextField f_creditCardVV = null;
         private CButton f_cashPayment = null;
         private CLabel f_lcashGiven = null;
         private VNumber f_cashGiven = null;
         private CLabel f_lcashReturn = null;
         private VNumber f_cashReturn = null;
         private CButton f_creditPayment = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(SubCheckout.class);
          *      Initialize
         public void init()
              //     Title
              TitledBorder border = new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"));
              setBorder(border);
              //     Content
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              gbc.insets = INSETS2;
              //     --     0
              gbc.gridx = 0;
              f_register = createButtonAction("Register", null);
              gbc.gridy = 0;
              add (f_register, gbc);
              f_summary = createButtonAction("Summary", null);
              gbc.gridy = 1;
              add (f_summary, gbc);
              f_process = createButtonAction("Process", null);
              gbc.gridy = 2;
              add (f_process, gbc);
              f_print = createButtonAction("Print", null);
              gbc.gridy = 3;
              add (f_print, gbc);
              //     --     1 -- Cash
              gbc.gridx = 1;
              gbc.gridheight = 2;
              gbc.fill = GridBagConstraints.BOTH;
              gbc.weightx = .1;
              CPanel cash = new CPanel(new GridBagLayout());
              cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
              gbc.gridy = 0;
              add (cash, gbc);
              GridBagConstraints gbc0 = new GridBagConstraints();
              gbc0.insets = INSETS2;
              gbc0.anchor = GridBagConstraints.WEST;
              f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
              cash.add (f_lcashGiven, gbc0);
              f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount,
                   Msg.translate(Env.getCtx(), "CashGiven"));
              f_cashGiven.addActionListener(this);
              f_cashGiven.setColumns(10, 25);
              cash.add (f_cashGiven, gbc0);
              f_cashGiven.setValue(Env.ZERO);
              f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
              cash.add (f_lcashReturn, gbc0);
              f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount,
                   "CashReturn");
              f_cashReturn.setColumns(10, 25);
              cash.add (f_cashReturn, gbc0);
              f_cashReturn.setValue(Env.ZERO);
              f_cashPayment = createButtonAction("Payment", null);
              f_cashPayment.setActionCommand("Cash");
              gbc0.anchor = GridBagConstraints.EAST;
              gbc0.weightx = 0.1;
              cash.add (f_cashPayment, gbc0);
              //     --     1 -- Creditcard
              CPanel creditcard = new CPanel(new GridBagLayout());
              creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType")));
              gbc.gridy = 2;
              add (creditcard, gbc);
              GridBagConstraints gbc1 = new GridBagConstraints();
              gbc1.insets = INSETS2;
              gbc1.anchor = GridBagConstraints.WEST;
              gbc1.gridx = 0;
              gbc1.gridy = 0;
              f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber"));
              creditcard.add (f_lcreditCardNumber, gbc1);
              gbc1.gridy = 1;
              f_creditCardNumber = new CTextField(18);
              creditcard.add (f_creditCardNumber, gbc1);
              gbc1.gridx = 1;
              gbc1.gridy = 0;
              f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp"));
              creditcard.add (f_lcreditCardExp, gbc1);
              gbc1.gridy = 1;
              f_creditCardExp = new CTextField(5);
              creditcard.add (f_creditCardExp, gbc1);
              gbc1.gridx = 2;
              gbc1.gridy = 0;
              f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV"));
              creditcard.add (f_lcreditCardVV, gbc1);
              gbc1.gridy = 1;
              f_creditCardVV = new CTextField(5);
              creditcard.add (f_creditCardVV, gbc1);
              gbc1.gridx = 3;
              gbc1.gridy = 0;
              gbc1.gridheight = 2;
              f_creditPayment = createButtonAction("Payment", null);
              f_creditPayment.setActionCommand("CreditCard");
              gbc1.anchor = GridBagConstraints.EAST;
              gbc1.weightx = 0.1;
              creditcard.add (f_creditPayment, gbc1);
         }     //     init
          *      Get Panel Position
         public GridBagConstraints getGridBagConstraints()
              GridBagConstraints gbc = super.getGridBagConstraints();
              gbc.gridx = 0;
              gbc.gridy = 3;
              return gbc;
         }     //     getGridBagConstraints
          *      Dispose - Free Resources
         public void dispose()
              super.dispose();
         }     //     dispose
          *      Action Listener
          *     @param e event
         public void actionPerformed (ActionEvent e)
              String action = e.getActionCommand();
              if (action == null || action.length() == 0)
                   return;
              log.info( "PosSubCheckout - actionPerformed: " + action);
              if (e.getSource() == f_cashGiven) {
                   f_cashGiven.setValue(f_cashGiven.getValue());
                   System.out.println("f_cashGiven"+f_cashGiven.getDisplay());
              //     Register
              //     Summary
              //     Print
              if (action.equals("Cash")) {
                   BigDecimal CashGiven, GrandTotal, CashReturn;
                   System.out.println("Cash given is "+f_cashGiven.getDisplay());
                   CashGiven = (BigDecimal)f_cashGiven.getValue();
                   GrandTotal = (BigDecimal)p_posPanel.f_curLine.getOrder().getGrandTotal();
                   CashReturn = CashGiven.subtract(GrandTotal);
                   f_cashReturn.setValue(CashReturn);
              //     Cash (Payment)
              //     CreditCard (Payment)
         }     //     actionPerformed
    }     //     PosSubCheckoutThis is the code of VNumber.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.grid.ed;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.math.*;
    import java.text.*;
    import java.util.logging.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import org.compiere.apps.*;
    import org.compiere.model.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     Number Control
    *      @author      Jorg Janke
    *      @version      $Id: VNumber.java,v 1.41 2005/09/03 01:57:16 jjanke Exp $
    public final class VNumber extends JComponent
         implements VEditor, ActionListener, KeyListener, FocusListener
         /**     Number of Columns (12)          */
         public final static int SIZE = 12;
          *  IDE Bean Constructor
         public VNumber()
              this("Number", false, false, true, DisplayType.Number, "Number");
         }   //  VNumber
          *     Create right aligned Number field.
          *     no popup, if WindowNo == 0 (for IDs)
          *  @param columnName column name
          *  @param mandatory mandatory
          *  @param isReadOnly read only
          *  @param isUpdateable updateable
          *  @param displayType display type
          *  @param title title
         public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
              int displayType, String title)
              super();
              super.setName(columnName);
              m_columnName = columnName;
              m_title = title;
              setDisplayType(displayType);
              LookAndFeel.installBorder(this, "TextField.border");
              this.setLayout(new BorderLayout());
    //          this.setPreferredSize(m_text.getPreferredSize());          //     causes r/o to be the same length
    //          int height = m_text.getPreferredSize().height;
    //          setMinimumSize(new Dimension (30,height));
              //     ***     Text     ***
              m_text.setBorder(null);
              m_text.setHorizontalAlignment(JTextField.TRAILING);
              m_text.addKeyListener(this);
              m_text.addFocusListener(this);
              //     Background
              setMandatory(mandatory);
              this.add(m_text, BorderLayout.CENTER);
              //     ***     Button     ***
              m_button.setIcon(Env.getImageIcon("Calculator10.gif"));
              m_button.setMargin(new Insets(0, 0, 0, 0));
              m_button.setFocusable(false);
              m_button.addActionListener(this);
              this.add (m_button, BorderLayout.EAST);
              //     Prefereed Size
              this.setPreferredSize(this.getPreferredSize());          //     causes r/o to be the same length
              //  Size
              setColumns(SIZE, CComboBox.FIELD_HIGHT-4);     
              //     ReadWrite
              if (isReadOnly || !isUpdateable)
                   setReadWrite(false);
              else
                   setReadWrite(true);
         }     //     VNumber
          *  Dispose
         public void dispose()
              m_text = null;
              m_button = null;
              m_mField = null;
         }   //  dispose
          *     Set Document
          *  @param doc document
         protected void setDocument(Document doc)
              m_text.setDocument(doc);
         }     //     getDocument
         private String               m_columnName;
         protected int               m_displayType;     //  Currency / UoM via Context
         private DecimalFormat     m_format;
         private String               m_title;
         private boolean               m_setting;
         private String               m_oldText;
         private String               m_initialText;
         private boolean               m_rangeSet = false;
         private Double               m_minValue;
         private Double               m_maxValue;
         private boolean               m_modified = false;
         /**  The Field                  */
         private CTextField          m_text = new CTextField(SIZE);     //     Standard
         /** The Button                  */
         private CButton              m_button = new CButton();
         private MField          m_mField = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(VNumber.class);
          *      Set no of Columns
          *     @param columns columns
         public void setColumns (int columns, int height)
              m_text.setPreferredSize(null);
              m_text.setColumns(columns);
              Dimension size = m_text.getPreferredSize();
              if (height > size.height)               //     default 16
                   size.height = height;
              if (CComboBox.FIELD_HIGHT-4 > size.height)
                   size.height = VLookup.FIELD_HIGHT-4;
              this.setPreferredSize(size);          //     causes r/o to be the same length
              this.setMinimumSize(new Dimension (columns*10, size.height));
              m_button.setPreferredSize(new Dimension(size.height, size.height));
         }     //     setColumns
          *     Set Range with min & max
          *  @param minValue min value
          *  @param maxValue max value
          *     @return true, if accepted
         public boolean setRange(Double minValue, Double maxValue)
              m_rangeSet = true;
              m_minValue = minValue;
              m_maxValue = maxValue;
              return m_rangeSet;
         }     //     setRange
          *     Set Range with min & max = parse US style number w/o Gouping
          *  @param minValue min value
          *  @param maxValue max value
          *  @return true if accepted
         public boolean setRange(String minValue, String maxValue)
              if (minValue == null || maxValue == null)
                   return false;
              try
                   m_minValue = Double.valueOf(minValue);
                   m_maxValue = Double.valueOf(maxValue);
              catch (NumberFormatException nfe)
                   return false;
              m_rangeSet = true;
              return m_rangeSet;
         }     //     setRange
          *  Set and check DisplayType
          *  @param displayType display type
         public void setDisplayType (int displayType)
              m_displayType = displayType;
              if (!DisplayType.isNumeric(displayType))
                   m_displayType = DisplayType.Number;
              m_format = DisplayType.getNumberFormat(displayType);
              m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title));
         }   //  setDisplayType
          *     Set ReadWrite
          *  @param value value
         public void setReadWrite (boolean value)
              if (m_text.isReadWrite() != value)
                   m_text.setReadWrite(value);
              if (m_button.isReadWrite() != value)
                   m_button.setReadWrite(value);
              //     Don't show button if not ReadWrite
              if (m_button.isVisible() != value)
                   m_button.setVisible(value);
         }     //     setReadWrite
          *     IsReadWrite
          *  @return true if rw
         public boolean isReadWrite()
              return m_text.isReadWrite();
         }     //     isReadWrite
          *     Set Mandatory (and back bolor)
          *  @param mandatory mandatory
         public void setMandatory (boolean mandatory)
              m_text.setMandatory(mandatory);
         }     //     setMandatory
          *     Is it mandatory
          *  @return true if mandatory
         public boolean isMandatory()
              return m_text.isMandatory();
         }     //     isMandatory
          *     Set Background
          *  @param color color
         public void setBackground(Color color)
              m_text.setBackground(color);
         }     //     setBackground
          *     Set Background
          *  @param error error
         public void setBackground (boolean error)
              m_text.setBackground(error);
         }     //     setBackground
          *  Set Foreground
          *  @param fg foreground
         public void setForeground(Color fg)
              m_text.setForeground(fg);
         }   //  setForeground
          *     Set Editor to value
          *  @param value value
         public void setValue(Object value)
              log.finest("Value=" + value);
              if (value == null)
                   m_oldText = "";
              else
                   m_oldText = m_format.format(value);
              //     only set when not updated here
              if (m_setting)
                   return;
              m_text.setText (m_oldText);
              m_initialText = m_oldText;
              m_modified = false;
         }     //     setValue
          *  Property Change Listener
          *  @param evt event
         public void propertyChange (PropertyChangeEvent evt)
              if (evt.getPropertyName().equals(org.compiere.model.MField.PROPERTY))
                   setValue(evt.getNewValue());
         }   //  propertyChange
          *     Return Editor value
          *  @return value value (big decimal or integer)
         public Object getValue()
              if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0)
                   return null;
              String value = m_text.getText();
              //     return 0 if text deleted
              if (value == null || value.length() == 0)
                   if (!m_modified)
                        return null;
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(0);
                   return Env.ZERO;
              if (value.equals(".") || value.equals(",") || value.equals("-"))
                   value = "0";
              try
                   Number number = m_format.parse(value);
                   value = number.toString();      //     converts it to US w/o thousands
                   BigDecimal bd = new BigDecimal(value);
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(bd.intValue());
                   if (bd.signum() == 0)
                        return bd;
                   return bd.setScale(m_format.getMaximumFractionDigits(), BigDecimal.ROUND_HALF_UP);
              catch (Exception e)
                   log.log(Level.SEVERE, "Value=" + value, e);
              if (m_displayType == DisplayType.Integer)
                   return new Integer(0);
              return Env.ZERO;
         }     //     getValue
          *  Return Display Value
          *  @return value
         public String getDisplay()
              return m_text.getText();
         }   //  getDisplay
          *      Get Title
          *     @return title
         public String getTitle()
              return m_title;
         }     //     getTitle
          *      Plus - add one.
          *      Also sets Value
          *     @return new value
         public Object plus()
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(0);
                   else
                        value = Env.ZERO;
              //     Add
              if (value instanceof BigDecimal)
                   value = ((BigDecimal)value).add(Env.ONE);
              else
                   value = new Integer(((Integer)value).intValue() + 1);
              setValue(value);
              return value;
         }     //     plus
          *      Minus - subtract one, but not below minimum.
          *      Also sets Value
          *     @param minimum minimum
          *     @return new value
         public Object minus (int minimum)
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(minimum);
                   else
                        value = new BigDecimal(minimum);
                   setValue(value);
                   return value;
              //     Subtract
              if (value instanceof BigDecimal)
                   BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE);
                   BigDecimal min = new BigDecimal(minimum);
                   if (bd.compareTo(min) < 0)
                        value = min;
                   else
                        value = bd;
              else
                   int i = ((Integer)value).intValue();
                   i--;
                   if (i < minimum)
                        i = minimum;
                   value = new Integer(i);
              setValue(value);
              return value;
         }     //     minus
          *     Action Listener
          *  @param e event
         public void actionPerformed (ActionEvent e)
              log.config(e.getActionCommand());
              if (ValuePreference.NAME.equals(e.getActionCommand()))
                   if (MRole.getDefault().isShowPreference())
                        ValuePreference.start (m_mField, getValue());
                   return;
              if (e.getSource() == m_button)
                   m_button.setEnabled(false);
                   String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title);
                   m_text.setText(str);
                   m_button.setEnabled(true);
                   try
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                   catch (PropertyVetoException pve)     {}
                   m_text.requestFocus();
         }     //     actionPerformed
          *     Key Listener Interface
          *  @param e event
         public void keyTyped(KeyEvent e)    {}
         public void keyPressed(KeyEvent e)  {}
          *     Key Listener.
          *          - Escape           - Restore old Text
          *          - firstChange     - signal change
          *  @param e event
         public void keyReleased(KeyEvent e)
              log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar()
                           + " -> " + m_text.getText());
              //  ESC
              if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                   m_text.setText(m_initialText);
              m_modified = true;
              m_setting = true;
              try
                   if (e.getKeyCode() == KeyEvent.VK_ENTER)     //     10
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                        fireActionPerformed();
                   else     //     indicate change
                        fireVetoableChange (m_columnName, m_oldText, null);     
              catch (PropertyVetoException pve)     {}
              m_setting = false;
         }     //     keyReleased
          *     Focus Gained
          *  @param e event
         public void focusGained (FocusEvent e)
              if (m_text != null)
                   m_text.selectAll();
         }     //     focusGained
          *     Data Binding to MTable (via GridController.vetoableChange).
          *  @param e event
         public void focusLost (FocusEvent e)
         //          log.finest(e.toString());
              //     APanel - Escape
              if (e.getOppositeComponent() instanceof AGlassPane)
                   m_text.setText(m_initialText);
                   return;
              try
                   fireVetoableChange (m_columnName, m_initialText, getValue());
                   fireActionPerformed();
              catch (PropertyVetoException pve)     {}
         }   //  focusLost
          *     Invalid Entry - Start Calculator
          *  @param jc parent
          *  @param value value
          *  @param format format
          *  @param displayType display type
          *  @param title title
          *  @return value
         public static String startCalculator(Container jc, String value,
              DecimalFormat format, int displayType, String title)
              log.config("Value=" + value);
              BigDecimal startValue = new BigDecimal(0.0);
              try
                   if (value != null && value.length() > 0)
                        Number number = format.parse(value);
                        startValue = new BigDecimal (number.toString());
              catch (ParseException pe)
                   log.info("InvalidEntry - " + pe.getMessage());
              //     Find frame
              Frame frame = Env.getFrame(jc);
              //     Actual Call
              Calculator calc = new Calculator(frame, title,
                   displayType, format, startValue);
              AEnv.showCenterWindow(frame, calc);
              BigDecimal result = calc.getNumber();
              log.config( "Result=" + result);
              calc = null;
              if (result != null)
                   return format.format(result);
              else
                   return value;          //     original value
         }     //     startCalculator
          *  Set Field/WindowNo for ValuePreference
          *  @param mField field
         public void setField (MField mField)
              m_mField = mField;
              if (m_mField != null
                   && MRole.getDefault().isShowPreference())
                   ValuePreference.addMenu (this, popupMenu);
         }   //  setField
          *      Remove Action Listner
          *      @param l Action Listener
         public void removeActionListener(ActionListener l)
              listenerList.remove(ActionListener.class, l);
         }     //     removeActionListener
          *      Add Action Listner
          *      @param l Action Listener
         public void addActionListener(ActionListener l)
              listenerList.add(ActionListener.class, l);
         }     //     addActionListener
          *      Fire Action Event to listeners
         protected void fireActionPerformed()
              int modifiers = 0;
              AWTEvent currentEvent = EventQueue.getCurrentEvent();
              if (currentEvent instanceof InputEvent)
                   modifiers = ((InputEvent)currentEvent).getModifiers();
              else if (currentEvent instanceof ActionEvent)
                   modifiers = ((ActionEvent)currentEvent).getModifiers();
              ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED,
                   "VNumber", EventQueue.getMostRecentEventTime(), modifiers);
              // Guaranteed to return a non-null array
              Object[] listeners = listenerList.getListenerList();
              // Process the listeners last to first, notifying those that are interested in this event
              for (int i = listeners.length-2; i>=0; i-=2)
                   if (listeners==ActionListener.class)
                        ((ActionListener)listeners[i+1]).actionPerformed(ae);
         }     //     fireActionPerformed
    }     //     VNumber

    If getValue() returns null, you need to trace the execution of the code and figure out which sequence of code is leading to the return of null. This method looks complex - a lot of if statements. If you do not have a debugger, put System.out.println statements inside the method to figure out what's going on.

  • Get selected value from a select one choice in the bean

    I'm trying to do with the SelectOneChoice valueChangeListener and this is the code of my method, I'm using jdeveloper11g if alguin can help as I need the value you selected in the bean
    public void cambioCombo(ValueChangeEvent valueChangeEvent) {
    CoreSelectOneChoice csoc = (CoreSelectOneChoice) valueChangeEvent.getSource();
    List childList = csoc.getChildren();
    for (int i = 0; i < childList.size(); i++) {
    if (childList.get(i) instanceof CoreSelectItem){
    CoreSelectItem csi = (CoreSelectItem) childList.get(i);
    if (((String)csi.getValue()).equals((String) valueChangeEvent.getNewValue()) ){
    System.out.println("------------>"+csi.getLabel());
    I get the following error when running the application and selecting in my select one choice
    oracle.adf.view.rich.component.rich.input.RichSelectOneChoice cannot be cast to org.apache.myfaces.trinidad.component.core.input.CoreSelectOneChoice

    This is an example of some code that i wrote.
    public void changeDesc(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    System.out.println("value "+ valueChangeEvent.getNewValue().toString());
    //System.out.println("old value "+ valueChangeEvent.getOldValue().toString());
    if (valueChangeEvent.getNewValue().toString().equals("Area Uno")){
    this.descripcion.setValue("RR.HH");
    } else {
    this.descripcion.setValue("Finanzas");
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.descripcion);
    For get the Value select in the "SelectOneChice" component i use this: valueChangeEvent.getNewValue().toString()
    cheers

  • 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

  • How to obtain PROVIDER_URL in the bean

    I want to get access in my bean to the Context.PROVIDER_URL property which
    was used by the client to create the initial context.
    I know the ejbContext.getEnvironment() method is deprecated so I tried the
    following:
    javax.naming.InitialContext ctx = new InitialContext();
    String sURL =
    (String)ctx.lookup("java:comp/env/"+javax.naming.Context.PROVIDER_URL);
    This gives me a null back. What am I doing wrong?
    Or is there another way to get the provider url inside the bean code?
    Ashish P. Narvekar
    email: [email protected]

    Ashish,
    FWIW, this is how we're doing it...
    InputStream inp =
    ClassLoader.getSystemResourceAsStream("weblogic.properties");
    if(inp != null)
    Properties env = new Properties();
    env.load(inp);
    String icf = env.getProperty("databroker.initialContextFactory");
    env.put(Context.INITIAL_CONTEXT_FACTORY, icf);
    String url = env.getProperty("databroker.providerUrl");
    env.put(Context.PROVIDER_URL, url);
    entCtx = new InitialContext(env);
    We then use entCtx to lookup the home interface. This allows us to "soft code"
    our icf and url values in the weblogic.properties file. To my knowledge, nothing
    here is deprecated. If anyone knows differently, please let me know.
    Guy :)
    Jim Zhou wrote:
    You probably need to do:
    javax.naming.InitialContext ctx = new InitialContext("t3"//host:port");
    new InitialContext() will only works when client and server are in the same
    JVM.
    Regards,
    Jim Zhou.
    Ashish P. Narvekar <[email protected]> wrote in message
    news:[email protected]..
    I want to get access in my bean to the Context.PROVIDER_URL property which
    was used by the client to create the initial context.
    I know the ejbContext.getEnvironment() method is deprecated so I tried the
    following:
    javax.naming.InitialContext ctx = new InitialContext();
    String sURL =
    (String)ctx.lookup("java:comp/env/"+javax.naming.Context.PROVIDER_URL);
    This gives me a null back. What am I doing wrong?
    Or is there another way to get the provider url inside the bean code?
    Ashish P. Narvekar
    email: [email protected]

Maybe you are looking for

  • How do I add a logo/image to my signature?

    Hi all, A pretty easy one I hope....I just want to add a logo to the bottom on my signature. Is this possible within Mail? If not does anyone know what email programme I could use to do this? thanks iBook Clamshell SE - iMac G5 20inch - iPod Nano 4g

  • Language pack resource files in SharePoint 2010 and 2013

    Hi, We are translating the Language pack for SharePoint 2013 in Albanian language. Comparing to SharePoint 2010 resource files, there are less of them in SharePoint 2013 but they are bigger in size. Are they merged and in that case which of them are

  • Cant get into Itunes, receiving error message

    Can't get into Itunes Store- receiving error message - help

  • Problems in the creation of strcture

    hi,       Any body can help me when i am creating the strcture i am getting the error RFC system error for destination GTADIR_SERVER. what is this error how can i overcome from this.

  • Network places no longer connects

    Hi all I'm a complete noob on solaris and net working. I was always able to connect my two computers using Network Places on solaris 10 without any configuration, on an a previous installation. I have since re-installed Solaris, my two computers are