Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 935307 Details for
Bug 1139197
[QE] (6.3.z) Long server shut-down with unresponsive client with opened JNDI Context
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
JNDIContext.java
JNDIContext.java (text/plain), 1.84 KB, created by
Miroslav Novak
on 2014-09-08 11:21:13 UTC
(
hide
)
Description:
JNDIContext.java
Filename:
MIME Type:
Creator:
Miroslav Novak
Created:
2014-09-08 11:21:13 UTC
Size:
1.84 KB
patch
obsolete
>package org.jboss.jms.client; > >import javax.jms.*; >import javax.naming.Context; >import javax.naming.InitialContext; >import javax.naming.NamingException; >import java.util.Properties; > >public class JNDIContext { > > > String hostname = "10.40.4.138"; > String topicJndiName = ""; > > public static void main(String[] args) throws Exception { > > > if (args.length != 2) { > System.out.println("Set parameters \"hostname\" and \"jndi_name_of_the_queue\""); > System.exit(1); > } > > JNDIContext client = new JNDIContext(args[0], args[1]); > > client.startClient(); > } > > > public JNDIContext(String hostname, String topicJndiName) { > this.hostname = hostname; > this.topicJndiName = topicJndiName; > } > > void startClient() throws Exception { > > Context context = null; > > try { > > final Properties env = new Properties(); > env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); > env.put(Context.PROVIDER_URL, "remote://" + hostname + ":4447"); > context = new InitialContext(env); > System.out.println("Context created."); > ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/RemoteConnectionFactory"); > > Topic topic = (Topic) context.lookup(topicJndiName); > > System.out.println("Wait 60 s - disconnect the network."); > Thread.sleep(60000); > System.out.println("Wait - finished."); > > > } finally { > System.out.println("Closing context"); > if (context != null) { > try { > context.close(); > System.out.println("Context close"); > } catch (NamingException e) { > e.printStackTrace(); > } > } > } > } > >} > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1139197
: 935307 |
938062
|
940036