java - javax.jms.JMSSecurityException: User name [null] or password is invalid -
i have simple jms sender , receiver.
use jboss-amq broker.
use jndi lookup values.
jndi.properties
java.naming.factory.initial = org.apache.activemq.jndi.activemqinitialcontextfactory java.naming.provider.url = tcp://localhost:61616 java.naming.security.principal = admin java.naming.security.credentials = admin connectionfactorynames = connectionfactory queue.trade.q = trade.q
using these values got following exception:
exception in thread "main" javax.jms.jmssecurityexception: user name [null] or password invalid. @ org.apache.activemq.util.jmsexceptionsupport.create(jmsexceptionsupport.java:52) @ org.apache.activemq.activemqconnection.syncsendpacket(activemqconnection.java:1393) @ org.apache.activemq.activemqconnection.ensureconnectioninfosent(activemqconnection.java:1496) @ org.apache.activemq.activemqconnection.start(activemqconnection.java:523) @ examples.jmssender.main(jmssender.java:26) caused by: java.lang.securityexception: user name [null] or password invalid. @ org.apache.activemq.security.jaasauthenticationbroker.authenticate(jaasauthenticationbroker.java:89) @ org.apache.activemq.security.jaasauthenticationbroker.addconnection(jaasauthenticationbroker.java:68) @ org.apache.activemq.broker.brokerfilter.addconnection(brokerfilter.java:97) @ org.apache.activemq.broker.mutablebrokerfilter.addconnection(mutablebrokerfilter.java:102) @ org.apache.activemq.broker.transportconnection.processaddconnection(transportconnection.java:817) @ org.apache.activemq.broker.jmx.managedtransportconnection.processaddconnection(managedtransportconnection.java:77) @ org.apache.activemq.command.connectioninfo.visit(connectioninfo.java:139) @ org.apache.activemq.broker.transportconnection.service(transportconnection.java:338) @ org.apache.activemq.broker.transportconnection$1.oncommand(transportconnection.java:188) @ org.apache.activemq.transport.mutextransport.oncommand(mutextransport.java:50) @ org.apache.activemq.transport.wireformatnegotiator.oncommand(wireformatnegotiator.java:113) @ org.apache.activemq.transport.abstractinactivitymonitor.oncommand(abstractinactivitymonitor.java:300) @ org.apache.activemq.transport.transportsupport.doconsume(transportsupport.java:83) @ org.apache.activemq.transport.tcp.tcptransport.dorun(tcptransport.java:214) @ org.apache.activemq.transport.tcp.tcptransport.run(tcptransport.java:196) @ java.lang.thread.run(thread.java:745) caused by: javax.security.auth.login.loginexception: username can not null @ org.apache.karaf.jaas.modules.properties.propertiesloginmodule.login(propertiesloginmodule.java:90) @ org.apache.karaf.jaas.boot.proxyloginmodule.login(proxyloginmodule.java:83) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ javax.security.auth.login.logincontext.invoke(logincontext.java:755) @ javax.security.auth.login.logincontext.access$000(logincontext.java:195) @ javax.security.auth.login.logincontext$4.run(logincontext.java:682) @ javax.security.auth.login.logincontext$4.run(logincontext.java:680) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.login.logincontext.invokepriv(logincontext.java:680) @ javax.security.auth.login.logincontext.login(logincontext.java:587) @ org.apache.activemq.security.jaasauthenticationbroker.authenticate(jaasauthenticationbroker.java:84) ... 15 more
i noticed if add following jndi file
username=admin password=admin
the 2 programs runs without errors
so, problem first approach?
the activemqconnectionfactory class default factory used connectionfactorynames = connectionfactory property sets introspectionsupport class set properties looks username , password properties rather creds , principal
Comments
Post a Comment