List of usage examples for javax.naming NamingException getMessage
public String getMessage()
From source file:org.josso.gateway.session.service.store.db.DataSourceSessionStore.java
/** * Lazy load the datasource instace used by this store. * * @throws SSOSessionException/*w w w . j av a 2s .c o m*/ */ protected synchronized DataSource getDataSource() throws SSOSessionException { if (_datasource == null) { try { if (logger.isDebugEnabled()) logger.debug("[getDatasource() : ]" + _dsJndiName); InitialContext ic = new InitialContext(); _datasource = (DataSource) ic.lookup(_dsJndiName); } catch (NamingException ne) { logger.error("Error during DB connection lookup", ne); throw new SSOSessionException("Error During Lookup\n" + ne.getMessage()); } } return _datasource; }
From source file:org.atricore.idbus.idojos.dbidentitystore.DataSourceIdentityStore.java
/** * Lazy load the datasource instace used by this store. * * * @throws SSOIdentityException//from w w w.j av a 2 s .co m */ protected DataSource getDataSource() throws SSOIdentityException { if (_datasource == null) { try { if (logger.isDebugEnabled()) logger.debug("[getDatasource() : ]" + _dsJndiName); InitialContext ic = new InitialContext(); _datasource = (DataSource) ic.lookup(_dsJndiName); } catch (NamingException ne) { logger.error("Error during DB connection lookup", ne); throw new SSOIdentityException("Error During Lookup\n" + ne.getMessage()); } } return _datasource; }
From source file:org.apache.juddi.rmi.JNDIRegistration.java
public void unregister() { try {//from w w w . j a v a 2s . c o m context.unbind(UDDI_SECURITY_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } securityService = null; try { context.unbind(UDDI_PUBLICATION_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } publicationService = null; try { context.unbind(UDDI_INQUIRY_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } inquiryService = null; try { context.unbind(UDDI_SUBSCRIPTION_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } subscriptionService = null; try { context.unbind(UDDI_SUBSCRIPTION_LISTENER_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } subscriptionListenerService = null; try { context.unbind(UDDI_CUSTODY_TRANSFER_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } custodyTransferService = null; try { context.unbind(JUDDI_PUBLISHER_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } publisherService = null; try { context.unbind(OWL_S_INQUERY_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } owl_SInquiryService = null; try { context.unbind(OWL_S_Publication_SERVICE); } catch (NamingException e) { log.error(e.getMessage(), e); } owl_SPublicationService = null; try { context.unbind(JUDDI); } catch (NamingException e) { log.error(e.getMessage(), e); } }
From source file:com.spring.jca.tuxedo.ApplicationConfig.java
@Bean public ResourceAdapterFactoryBean tuxedoResourceAdapter() { try {/*from w w w .j av a2 s .c om*/ SimpleNamingContextBuilder.emptyActivatedContextBuilder(); } catch (NamingException e) { System.out.println("Simple Naming context builder error: " + e.getMessage()); } TuxedoResourceAdapter ra = new TuxedoResourceAdapter(); ra.setTraceLevel("100000"); ra.setDebugAdapter(true); ra.setDebugBuffer(true); ra.setDebugJatmi(true); ra.setDebugRouting(true); ra.setDebugSession(true); ra.setDebugXa(true); ra.setDebugConfig(true); ra.setDebugPdu(true); ra.setDebugPerf(true); ra.setDebugSec(true); ra.setDebugNet(true); ra.setXaAffinity("true"); ra.setDmconfig("C:\\Users\\40042466\\workspace\\Silk Tuxedo\\configuration\\runtime\\dmconfig.xml"); ResourceAdapterFactoryBean fc = new ResourceAdapterFactoryBean(); fc.setResourceAdapter(ra); SimpleTaskWorkManager stwm = new SimpleTaskWorkManager(); fc.setWorkManager(stwm); fc.setBootstrapContext(new SimpleBootstrapContext(stwm)); return fc; }
From source file:com.spring.jca.tuxedo.ApplicationConfig.java
ResourceAdapterFactoryBean tuxedoCSResourceAdapter() { // http://stackoverflow.com/questions/5682732/how-does-an-application-that-uses-springs-simplenamingcontextbuilder-know-to-se try {/*from w w w . jav a 2 s . c o m*/ SimpleNamingContextBuilder.emptyActivatedContextBuilder(); } catch (NamingException e) { System.out.println("Simple Naming context builder error: " + e.getMessage()); } TuxedoClientSideResourceAdapter ra = new TuxedoClientSideResourceAdapter(); ra.setTraceLevel("100000"); ra.setDebugAdapter(true); ra.setDebugBuffer(true); ra.setDebugJatmi(true); ra.setDebugRouting(true); ra.setDebugSession(true); ra.setDebugXa(true); ra.setDebugConfig(true); ra.setDebugPdu(true); ra.setDebugPerf(true); ra.setDebugSec(true); ra.setDebugNet(true); ra.setXaAffinity("true"); ra.setAutoTran(true); ra.setSpCredentialPolicy("LOCAL"); ra.setRapAllowAnonymous(false); ra.setLocalAccessPointSpec("//INV000000121176.ads.sfa.se:7001/domainId=INV000000121176"); ra.setRemoteAccessPointSpec("//vsgtu702.sfa.se:47022/domainId=tr703tu"); ra.setImpResourceName("levereraPerson"); ra.setFieldTable32Classes("se.fk.silk.tuxedo.SampleFldTbl"); ResourceAdapterFactoryBean fc = new ResourceAdapterFactoryBean(); fc.setResourceAdapter(ra); SimpleTaskWorkManager stwm = new SimpleTaskWorkManager(); fc.setWorkManager(stwm); fc.setBootstrapContext(new SimpleBootstrapContext(stwm)); return fc; }
From source file:org.openadaptor.auxil.connector.jndi.JNDIReadConnector.java
/** * Establish an external JNDI connection. * <p/>/*from w w w . ja va 2s. com*/ * If already connected, do nothing. * * @throws ConnectionException if an AuthenticationException or NamingException occurs */ public void connect() { try { _ctxt = jndiConnection.connect(); } catch (AuthenticationException ae) { log.warn("Failed JNDI authentication for principal: " + jndiConnection.getSecurityPrincipal()); throw new ConnectionException("Failed to Authenticate JNDI connection - " + ae.toString(), ae, this); } catch (NamingException ne) { log.warn(ne.getMessage()); throw new ConnectionException("Failed to establish JNDI connection - " + ne.toString(), ne, this); } log.info(getId() + " connected"); }
From source file:org.atricore.idbus.idojos.dbsessionstore.DataSourceSessionStore.java
/** * Lazy load the datasource instace used by this store. * * @throws SSOSessionException//from w ww .j a va 2s.co m */ protected DataSource getDataSource() throws SSOSessionException { if (_datasource == null) { synchronized (this) { if (_datasource == null) { try { if (logger.isDebugEnabled()) logger.debug("[getDatasource() : ]" + _dsJndiName); InitialContext ic = new InitialContext(); _datasource = (DataSource) ic.lookup(_dsJndiName); } catch (NamingException ne) { logger.error("Error during DB connection lookup", ne); throw new SSOSessionException("Error During Lookup\n" + ne.getMessage()); } } } } return _datasource; }
From source file:org.openadaptor.auxil.connector.jndi.JNDIReadConnector.java
/** * Disconnect external JNDI connection./*from w w w .j a v a2 s . c o m*/ * <p/> * If already disconnected, do nothing. * * @throws ConnectionException if a NamingException occurs. */ public void disconnect() { log.debug("Connector: [" + getId() + "] disconnecting ...."); if (_ctxt != null) { try { _ctxt.close(); } catch (NamingException ne) { log.warn(ne.getMessage()); } } log.info(getId() + " disconnected"); }
From source file:org.wso2.carbon.analytics.datasource.hdfs.HDFSAnalyticsFileSystem.java
@Override public void init(Map<String, String> properties) throws AnalyticsException { String dsName = properties.get(HDFSAnalyticsDataSourceConstants.DATASOURCE_NAME); if (dsName == null) { throw new AnalyticsException( "The property '" + HDFSAnalyticsDataSourceConstants.DATASOURCE_NAME + "' is required"); }//from www .ja va2 s . c o m try { this.fileSystem = (FileSystem) InitialContext.doLookup(dsName); } catch (NamingException e) { throw new AnalyticsException("Error in looking up data source: " + e.getMessage(), e); } }
From source file:com.interface21.ejb.support.XmlBeanFactoryLoader.java
/** * Load the bean factory. //w w w . j a va 2 s . c o m * @throws BootstrapException if the JNDI key is missing or if * the factory cannot be loaded from this location */ public BeanFactory loadBeanFactory() throws BootstrapException { JndiTemplate jt = new JndiTemplate(); String beanFactoryPath = null; try { beanFactoryPath = (String) jt.lookup(BEAN_FACTORY_PATH_ENVIRONMENT_KEY); logger.info("BeanFactoryPath from JNDI is '" + beanFactoryPath + "'"); InputStream is = getClass().getResourceAsStream(beanFactoryPath); if (is == null) throw new BootstrapException("Cannot load bean factory path '" + beanFactoryPath + "'", null); ListableBeanFactory beanFactory = new XmlBeanFactory(is); logger.info("Loaded BeanFactory [" + beanFactory + "]"); return beanFactory; } catch (NamingException ex) { throw new BootstrapException( "Define an environment variable 'ejb/BeanFactoryPath' containing the location on the classpath of an XmlBeanFactory" + ex.getMessage(), ex); } catch (BeanDefinitionStoreException ex) { throw new BootstrapException("Found resource at '" + beanFactoryPath + "' but it's not a valid Spring bean definition XML file: " + ex.getMessage(), null); } }