You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/06/10 10:18:35 UTC
svn commit: r666004 -
/incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
Author: antelder
Date: Tue Jun 10 01:18:35 2008
New Revision: 666004
URL: http://svn.apache.org/viewvc?rev=666004&view=rev
Log:
Update to set the ORB property when running with WsnInitialContextFactory and a non-IBM JRE
Modified:
incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
Modified: incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java?rev=666004&r1=666003&r2=666004&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java (original)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java Tue Jun 10 01:18:35 2008
@@ -122,12 +122,29 @@
if (jndiURL != null) {
props.setProperty(Context.PROVIDER_URL, jndiURL);
}
+
+ initJREEnvironment(props);
+
context = new InitialContext(props);
}
return context;
}
- public Destination lookupDestination(String jndiName) throws NamingException {
+ /**
+ * If using the WAS JMS Client with a non-IBM JRE then an additional
+ * environment property needs to be set to initialize the ORB correctly.
+ * See: http://www-1.ibm.com/support/docview.wss?uid=swg24012804
+ */
+ private void initJREEnvironment(Properties props) {
+ if (props.get(Context.INITIAL_CONTEXT_FACTORY).equals("com.ibm.websphere.naming.WsnInitialContextFactory")) {
+ String vendor = System.getProperty("java.vendor");
+ if (vendor == null || !vendor.contains("IBM")) {
+ props.setProperty("com.ibm.CORBA.ORBInit","com.ibm.ws.sib.client.ORB");
+ }
+ }
+ }
+
+ public Destination lookupDestination(String jndiName) throws NamingException {
return (Destination)jndiLookUp(jndiName);
}
@@ -150,6 +167,7 @@
try {
o = getInitialContext().lookup(name);
} catch (NamingException ex) {
+ ex.printStackTrace();
// ignore
}
}