java - Security: Invalid subject while connecting to JMS External Server Weblogic -
i have ejb module supposed run on weblogic 10.3.5
on weblogic console, have set jms module external server points weblogic instance. in module have jms/myqueue
, jms/myconnectionfactory
.
in ejb module, defined mdb following annotation , works (it notified when messaged present on queue , processes it).
@messagedriven( activationconfig = { @activationconfigproperty( propertyname = "destination", propertyvalue = "jms/myqueue"), @activationconfigproperty( propertyname = "destinationtype", propertyvalue = "javax.jms.queue"), @activationconfigproperty( propertyname = "connectionfactoryjndiname", propertyvalue = "jms/myconnectionfactory") }
the problem is, when try define client puts message on same queue, using following code inside ejb
@stateless public class messagesender implements messagesenderlocal { @resource(mappedname="jms/myconnectionfactory") private connectionfactory connectionfactory; @resource(mappedname="jms/myqueue") private queue queue; @override public void sendmessage(string msgstring) { connection connection = connectionfactory.createconnection(); session session = connection.createsession(true, session.auto_acknowledge); messageproducer messageproducer = session.createproducer(queue); message message = session.createtextmessage(); message.settext(msgstring); messageproducer.send(message); connection.close(); } }
i following error @ statement connection.createsession(true, session.auto_acknowledge)
:
java.lang.securityexception: [security:090398]invalid subject: principals=[weblogic, administrators] @ weblogic.rjvm.responseimpl.unmarshalreturn(responseimpl.java:234) ~[com.bea.core.weblogic.rmi.client_1.10.0.0.jar:1.10.0.0] @ weblogic.rmi.cluster.clusterableremoteref.invoke(clusterableremoteref.java:348) ~[com.bea.core.weblogic.rmi.client_1.10.0.0.jar:1.10.0.0] @ weblogic.rmi.cluster.clusterableremoteref.invoke(clusterableremoteref.java:259) ~[com.bea.core.weblogic.rmi.client_1.10.0.0.jar:1.10.0.0] @ weblogic.jms.frontend.feconnectionfactoryimpl_1035_wlstub.connectioncreaterequest(unknown source) ~[weblogic.jar:10.3.5.0] @ weblogic.jms.client.jmsconnectionfactory.setupjmsconnection(jmsconnectionfactory.java:224) ~[weblogic.jar:10.3.5.0] @ weblogic.jms.client.jmsconnectionfactory.createconnectioninternal(jmsconnectionfactory.java:285) ~[weblogic.jar:10.3.5.0] @ weblogic.jms.client.jmsconnectionfactory.createqueueconnection(jmsconnectionfactory.java:165) ~[weblogic.jar:10.3.5.0] @ ...
this error apparently has trusted domains on weblogic, but
- why connection work when receiving?
- is there way overcome without having change configuration in external server?
thank you.
the problem was: external jndi server required no credentials, our authenticator automatically set logged user.
to avoid behavior , force "no-user" login on external jndi server, put string java.naming.security.principal=
in jndi properties field of foreign server configuration on weblogic console.
Comments
Post a Comment