# Meet error javax.naming.NamingException: Username must be specified when consume solace

**URL:** <https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752>\
**Category:** General Discussions\
**Created:** [May 21, 2021, 8:21am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752 "2021-05-21T08:21:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Owen](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/owen/32/562_2.png) [@Owen](https://community.solace.com/u/Owen)\
**Post date:** [May 21, 2021, 8:21am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/1 "2021-05-21T08:21:00Z")

</div>

Hi gurus,  
My scenario is capture Solace JMS message then deliver to oracle via OGG Application Adapter (jmsvam).  
throw below error message when start ogg extract process  
it’s stranger what username should be specified? but i already setup java.naming.security.principal  
does my reference solace jars are correct?

```auto
May 21, 2021 7:29:34 AM oracle.goldengate.messaging.VamMain main
INFO: Starting main: class oracle.goldengate.messaging.VamMain, with arguments [length=0]: {} => using context(s): -o, /oracle/goldengate/messaging/default-vam-jms-context.xml
2021-05-21 07:29:35: JMSPROVIDER(jmsprovider.c:528) [ERROR]: Error occurred (Java exception): Error calling static void Method UserExitMain.main: org.springframework.beans.factory.Bea
nCreationException: Error creating bean with name 'jndiConnectionFactory' defined in class path resource [oracle/goldengate/messaging/default-vam-jms-context.xml]: Invocation of init m
ethod failed; nested exception is javax.naming.NamingException: Username must be specified 

```

properties configuration

```auto
java.naming.provider.url=smf://ip:55555
java.naming.factory.initial=com.solacesystems.jndi.SolJNDIInitialContextFactory
java.naming.security.principal=default@default
java.naming.security.credentials=default
gg.source=jms
gg.jms.connectionFactory=/jms/cf/default
gg.jms.destination=queue/ogg/1
jvm.bootoptions=-Djava.class.path=dirprm:ggjava/ggjava.jar:/home/opc/oggadapter/soljmslib/sol-jms-10.10.0.jar:/home/opc/oggadapter/soljmslib/sol-jcsmp-10.10.0.jar:/home/opc/oggadapter/soljmslib/sol-common-10.10.0.jar:/home/opc/oggadapter/soljmslib/javaee-api-8.0.jar:/home/opc/oggadapter/soljmslib/commons-lang-2.6.jar:/home/opc/oggadapter/soljmslib/commons-logging-1.1.3.jar:/home/opc/oggadapter/soljmslib/geronimo-jms_1.1_spec-1.1.1.jar:/home/opc/oggadapter/soljmslib/org.apache.servicemix.bundles.jzlib-1.0.7_2.jar:/home/opc/oggadapter/soljmslib/org.osgi.annotation-6.0.0.jar

```

---

<div class="post-metadata">

**Author:** ![amackenzie](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/amackenzie/32/1168_2.png) [@amackenzie](https://community.solace.com/u/amackenzie)\
**Post date:** [May 21, 2021, 11:17am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/2 "2021-05-21T11:17:46Z")

</div>

Are you missing: gg.handler.oggjms.useJndi=true

---

<div class="post-metadata">

**Author:** ![Owen](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/owen/32/562_2.png) [@Owen](https://community.solace.com/u/Owen)\
**Post date:** [May 24, 2021, 1:17am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/3 "2021-05-24T01:17:07Z")

</div>

tried add `gg.handler.oggjms.useJndi=true` still not work

---

<div class="post-metadata">

**Author:** ![amackenzie](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/amackenzie/32/1168_2.png) [@amackenzie](https://community.solace.com/u/amackenzie)\
**Post date:** [May 24, 2021, 1:58am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/4 "2021-05-24T01:58:03Z")

</div>

You could add the username to the url.  
Try smf://default@ip:55555

---

<div class="post-metadata">

**Author:** ![Owen](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/owen/32/562_2.png) [@Owen](https://community.solace.com/u/Owen)\
**Post date:** [May 24, 2021, 3:37am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/5 "2021-05-24T03:37:38Z")

</div>

@amackenzie after add username to url that error was resolved, but there is new error  
what is the mean 401: The RADIUS profile is shutdown?

```auto
2021-05-24 11:14:03 INFO OGG-00178 VAM Client Report <Error occured in jmsprovider.c[528]: Error oc
curred (Java exception): Error calling static void Method UserExitMain.main: org.springframework.beans.
factory.BeanCreationException: Error creating bean with name 'jndiConnectionFactory' defined in class pa
th resource [oracle/goldengate/messaging/default-vam-jms-context.xml]: Invocation of init method failed;
 nested exception is javax.naming.NamingException: JNDI lookup failed - 401: The RADIUS profile is shutd
own [Root exception is ((Client name: dedwdbadm02.corpdev.hkjc.com/20237/#00190001/Ssl4SEoaYr Local ad
dr: 1.19.14.22 Local port: 46543 Remote addr: 1.19.13.23 Remote port: 55555) - ) com.solaces
ystems.jcsmp.JCSMPErrorResponseException: 401: The RADIUS profile is shutdown [Subcode:1]]

```

---

<div class="post-metadata">

**Author:** ![Owen](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/owen/32/562_2.png) [@Owen](https://community.solace.com/u/Owen)\
**Post date:** [May 24, 2021, 3:48am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/6 "2021-05-24T03:48:02Z")

</div>

it’s strange that it can success connect to my testing solace (docker version with default configuration) , but it encounter `401: The RADIUS profile is shutdown` error when connect to customer solace environment.

---

<div class="post-metadata">

**Author:** ![Owen](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/owen/32/562_2.png) [@Owen](https://community.solace.com/u/Owen)\
**Post date:** [May 26, 2021, 3:14am UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/7 "2021-05-26T03:14:29Z")

</div>

> [@amackenzie](#):
>
> You could add the username to the url.  
> Try smf://default@ip:55555

Hi @amackenzie, may i know how to add vpn for this format url?  
like that “smf://default@TESTVPN1@ip:55555”?

---

<div class="post-metadata">

**Author:** ![marc](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/marc/32/2191_2.png) [@marc](https://community.solace.com/u/marc)\
**Post date:** [May 26, 2021, 3:14pm UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/8 "2021-05-26T15:14:38Z")

</div>

Hi @Owen,  
My guess is that your app is fine if it connects to your environment. The event broker has different ways to configure basic authentication, RADIUS being one of them. You’ll need to follow-up with the customer and have them check on the RADIUS profiles configured and make sure they aren’t shutdown. Here is some info from docs that shows how to configure RADIUS: [Configuring RADIUS Authentication](https://docs.solace.com/Configuring-and-Managing/Configuring-RADIUS-Authentication.htm)

Note that caution in yellow/orange:

> When you shut down a RADIUS profile, all users and/or clients attempting to authenticate using the RADIUS profile will fail until it is enabled again .

Hope that helps!

---

<div class="post-metadata">

**Author:** ![amackenzie](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/amackenzie/32/1168_2.png) [@amackenzie](https://community.solace.com/u/amackenzie)\
**Post date:** [May 26, 2021, 3:40pm UTC](https://community.solace.com/t/meet-error-javax-naming-namingexception-username-must-be-specified-when-consume-solace/752/9 "2021-05-26T15:40:27Z")

</div>

> @Owen said:
> 
> > @amackenzie said:  
> > You could add the username to the url.  
> > Try smf://default@ip:55555
> 
> Hi @amackenzie, may i know how to add vpn for this format url?  
> like that “smf://default@TESTVPN1@ip:55555”?

I am not sure you can add the VPN on the URI. There is a property you can pass: `Solace_JMS_VPN=vpn_name` if you need a VPN that isn’t Default.
