Skip to content

Commit

Permalink
6847 WLS JMS connector doesn't support named factory bean (#6922)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkec authored Jun 28, 2023
1 parent dff9b10 commit 4cf5bb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static io.helidon.messaging.connectors.jms.JmsConnector.JNDI_JMS_FACTORY_ATTRIBUTE;
import static io.helidon.messaging.connectors.jms.JmsConnector.JNDI_JMS_FACTORY_DEFAULT;
import static io.helidon.messaging.connectors.jms.JmsConnector.JNDI_PROPS_ATTRIBUTE;
import static io.helidon.messaging.connectors.jms.JmsConnector.NAMED_FACTORY_ATTRIBUTE;

/**
* Context related to one actual connection being constructed by JMS connector.
Expand Down Expand Up @@ -69,7 +70,8 @@ public class ConnectionContext {
}

boolean isJndi() {
return config.get(JNDI_ATTRIBUTE).exists();
return config.get(JNDI_ATTRIBUTE).exists()
&& !config.get(NAMED_FACTORY_ATTRIBUTE).exists();
}

Optional<? extends ConnectionFactory> lookupFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ static <T> T executeInIsolation(IsolationSupplier<T> supplier) {

boolean inWlsJar(String name) {
// Load jms exceptions from inside the thin jar to avoid deserialization issues
if (name.startsWith("javax.jms") && name.endsWith("Exception")) {
if ((name.startsWith("javax.jms") || name.startsWith("jakarta.jms"))
&& name.endsWith("Exception")) {
return true;
}

// Load only javax JMS API from outside, so cast works
// Load only javax and jakarta JMS API from outside, so cast works
return !name.startsWith("javax.jms")
&& !name.startsWith("jakarta.jms")
&& !name.equals(IsolatedContextFactory.class.getName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#

pattern=weblogic.**;java.util.**;java.lang.**;java.io.**;java.rmi.**
pattern=weblogic.**;java.util.**;java.lang.**;java.io.**;java.rmi.**;javax.naming.**

0 comments on commit 4cf5bb2

Please sign in to comment.