How Spring gets data-source reference from server using JNDI - spring

As we all know we can get a data-source reference or any JNDI reference from server using InitialContextFactory
Ex. When it comes to Websphere Application Server using below properties we can get reference:
com.ibm.websphere.naming.WsnInitialContextFactory
corbaloc:iiop:localhost:2809
The InitialContextFactory varies based on server instance you are using.
Question:
While configuring spring data source or JNDI we dont provide server details ( like name of server, type .. etc) and in which port corbaloc running.
If I really write my own program to get data-source then I have to know above details to get but
How Spring code is so generic and without knowing those details how it is getting JNDI reference?
thanks for your answers..

Related

Jms Configuration Ready Api 2.2

i am trying to manually configure JMS in Ready API 2.2 . I want to use Apache ActiveMQ , for that i need valid inputs for :
Initial Context Class
Provider Url
Connection Factory JNDI name
I have checked many sources , but i am not getting exact values for these . Can anyone provide them. And what are basic Jar files required ?
Take a look at the ActiveMQ documentation on this subject. It should answer most if not all your questions.

Can someone explain MQSeries file based JNDI for remote client JMS access

I've been searching extensively for a description of how to set up JMS access from a remote client to a file based JNDI MQ Series provider without success.
My JMS client works Ok on the same Linux machine as my MQSeries 7.5 server using file based JNDI.
How does one set up a remote client to use file based JNDI? Is it even possible or must one use LDAP?
I've seen hints that one should be able to have a remote client but nothing very clear.
I'm using Spring JMSTemplate which uses a provider url. On the same machine my Tomcat context.xml file uses a file: fileName url which, as I say, works ok collocated with the MQSeries server.
Thanks
Not a problem. If you are using a File based JNDI then you just need to add a QCF that contains the appropriate information for the remote queue manager. i.e. hostname, port # and channel name
DEFINE QCF(myQCF) QMANAGER(MQWT1) CHANNEL(TEST.CHL) HOSTNAME(22.22.22.22) PORT(1414) TRANSPORT(CLIENT) FAILIFQUIESCE(YES)
I was assuming that there was more than there is to file based JNDI. All it is is reading a property file. Using the "file"" url format allows you to read remote files.

JMS Point-to-Point in jmeter

Reg: JMeter Point-to-Point
Could you please tell how to get the QueueConnnectionFaction
And ContextConnectionFactory
Can anyone help me in configuring JNDI properties in JMS POINT-TO-POINT of JMETER
ERROR - jmeter.protocol.jms.sampler.JMSSampler: progress/message/jclient/TopicConnectionFactory java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
Please provide some solution.
It seems you didn't put a dependency jar from your jms provider, see:
java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
The QueueConnnectionFactory is the container of the queues that is created before the queues. I used to use the Hermes JMS application to get this information but you could get it from WebLogic too.
For example, the next image shows my configuration, using the information of binding for the QueueConnectionFactory field, and using the information of initialContextFactory for the InitialContextFactory field, and do not forget to use the providerURL in the ProviderURL field.
In this example I am not getting the response. For this reason, I am only putting the name of my requester queue.
Ensure that the information is correct. In the JMS Properties you could use Headers for the request.

Does hibernate provide a datasource jdni url?

I know that application servers can typically provide a connection to your database via JNDI. Is it possible for hibernate running in Java SE to provide a JNDI url/datasource like an application container such as Tomcat/Glassfish/Jetty would normally?
From the documentation it seems like it should be possible. You just have to provide a few parameters:
Important Hibernate properties for JNDI datasources
hibernate.connection.datasource (required)
hibernate.jndi.url
hibernate.jndi.class
hibernate.connection.username
hibernate.connection.password

configure jndi.xml in serviceMix to work with MQseries

My j2EE app is currently running on ServiceMix. Now i want to add JMS to my app. The application should able to send/receive the JMS message to/from the queue that stays on MQSeries.
mq.hostname=10.3.6.19
mq.channel=CHANNEL
mq.queueManager=QManager
mq.port=1422
What i would like to do is:
1. Create a jndi.xml file and do configuration for jms stuff.
2. my app will initialize the context, look up jndi name, and create a connection, queueManager, queue. .etc
3. Develop send and receive methods.
My question is:
Can you tell me how to do 1st and 2nd steps.
(the script inside ServiceMix's jndi is diffrent with tomcat's
jndi and others.
ServiceMix using Spring based JNDI provider.
http://servicemix.apache.org/jndi-configuration.html)
I just ran into something similar with Weblogic. The following link uses spring-dm to integrate with websphere. It also takes it to the next logical step and adds camel to the mix.
http://lowry-techie.blogspot.com/2010/11/camel-integration-with-websphere-mq.html
Without using Spring-dm, you may run into classloader issues when trying to load the InitialContextFactory from the websphere jar (this is an issue I had with the Weblogic jar)

Resources