Skip to content

Commit

Permalink
6921 WLS JMS connector doesn't support named factory bean
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkec committed May 29, 2023
1 parent 717cef1 commit 45c8987
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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 @@ -68,7 +69,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

0 comments on commit 45c8987

Please sign in to comment.