29+ "ProviderURL. This is likely to cause problems.");
30}
31if (urlPkgPrefixes != null) {
32env.put(Context.URL_PKG_PREFIXES, urlPkgPrefixes);
33}
34if (securityPrincipalName != null) {
35env.put(Context.SECURITY_PRINCIPAL, securityPrincipalName);
36if (securityCredentials != null) {
37env.put(Context.SECURITY_CREDENTIALS,
38securityCredentials);
39} else {
40LogLog.warn("You have set SecurityPrincipalName option but not the "
41+ "SecurityCredentials. This is likely to cause problems.");
42}
43}
44jndi = new InitialContext(env);
45} else {
46jndi = new InitialContext();
47}
48LogLog.debug("Looking up [" + tcfBindingName + "]");
49topicConnectionFactory = (TopicConnectionFactory) lookup(jndi,
50tcfBindingName);
51LogLog.debug("About to create TopicConnection.");
52if (userName != null) {
53topicConnection = topicConnectionFactory.createTopicConnection(
54userName, password);
55} else {
56topicConnection = topicConnectionFactory
57.createTopicConnection();
58}
59LogLog.debug("Creating TopicSession, non-transactional, "
60+ "in AUTO_ACKNOWLEDGE mode.");
61topicSession = topicConnection.createTopicSession(false,
62Session.AUTO_ACKNOWLEDGE);
63LogLog.debug("Looking up topic name [" + topicBindingName + "].");
64Topic topic = (Topic) lookup(jndi, topicBindingName);
65LogLog.debug("Creating TopicPublisher.");
66topicPublisher = topicSession.createPublisher(topic);
67LogLog.debug("Starting TopicConnection.");
68topicConnection.start();
69jndi.close();
70} catch (JMSException e) {
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-29497-12.html
我想这样就好了
康师傅在大陆确实赚的太多太多