[jboss-user] [JNDI/Naming/Network] - Dtabase connection Error(Mysql)

badhikary81 do-not-reply at jboss.com
Sat May 17 01:20:08 EDT 2008


Hi! 
thanks for reply.My program main part where arise the problem
 String customerNr = request.getParameter("customer_nr");
   if((customerNr != null) && !(customerNr.equals("")))
   {
   try{
   ejb.CustomerFacadeRemote custFacade = lookupCustomerFacadeBean();
   out.println("Customer's info for nr. " + customerNr + ": " + custFacade.getCustomerInfo(
                    Integer.parseInt(customerNr)));
   }catch(Exception ex){
       out.println("Customer with nr. " + customerNr +" not found");
     }
}
when I enter customer_nr and submit .program show the output Customer with nr. " + customerNr +" not found.
My program jboss-ds.xml file is 
<?xml version="1.0" encoding="UTF-8"?>
 .Only contain this.
My program lookupCustomerFacadeBean() is 
 
 private CustomerFacadeRemote lookupCustomerFacadeBean() {
        try {
            return ((ejb.CustomerFacadeRemoteHome) getServiceLocator().getRemoteHome("java:comp/env/CustomerFacadeBean", ejb.CustomerFacadeRemoteHome.class)).create();
        } catch (NamingException ne) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        } catch (CreateException ce) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ce);
            throw new RuntimeException(ce);
        } catch (RemoteException re) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", re);
            throw new RuntimeException(re);
        }
    }
 please help me.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151575#4151575

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151575



More information about the jboss-user mailing list