What does multitier means in weblogic server JNDI Lookup - java

I was checking InitialContext object and properties that are need for JNDI lookup. One of the property which is required for InitialContext is INITIAL_CONTEXT_FACTORY for environment, for weblogic server its value is weblogic.jndi.WLInitialContextFactory.
In the documentation of weblogic.jndi.WLInitialContextFactory it is said:
weblogic.jndi.WLInitialContextFactory can also be used to create a multitier connection to another naming service through a WebLogic Server.
I did not understand the meaning of multitier connection. Can someone elaborate what exactly it means?

Two-tier connections are when the client loads the connection driver into the same JVM and that driver communicates directly with the resource.
Multitier connections are when WebLogic loads a driver into its JVM. The client communicates with WebLogic. WebLogic communicates with the resource. (There could be additional steps inbetween.)
To use a database connection as an example, this is useful because your client doesn't need to have the native libraries for the database and you can allow WebLogic to manage particulars like connection pooling, keep alive, and stale connection disposal, or load balancing and failover.
It also allows you to configure details such as the remote machine name, user name, and password in WebLogic while your code only needs to know the JNDI name.
This should be saying that WebLogic supports remote naming services for you in a way that's similar to how you might set up a JNDI name for a JDBC connection, message queue/JMS, or other remote service.

Related

How can two web-applications, deployed on different application servers communicate via JMS

I am having two java web applications deployed on different app-servers. I want to exchange messages between the two using JMS. I know how to do it for applications running under same app-server, but I cannot find any example for the applications distributed over different app-servers.
I am using Glassfish 4.1 as application server.
You can create queues with same names on both servers, and let the first queue push its messages to the second one using glassfish configuration, so let the imq brokers do the job. Configure the jms connection factory on the first server with the property "AddressList" with value "mq://host2:port2" with the settings for the second broker.
See the glassfish resource template for such a configuration in the OSCM Service Catalog https://github.com/servicecatalog/development/blob/master/oscm-installation/domains/bes_domain/installer/resources-template.xml
The example is the connection factory "jms/bss/masterIndexerQueueFactory" which you can find in this template.
More about the Open Source Project OSCM Cloud Service Management Software

tomcat's JNDI sharing

I have tomcat and JNDI point in system.
I need to use this point for connecting remote consumers. I read that tomcat doesn't share its JNDI, if so, how to set up a separate JNDI server on my network or is there any way to configure tomcat to share JNDI?
There is no such thing as a 'JNDI server'. JNDI is a client-side API that interfaces to various naming technologies.
You could consider an LDAP server.

Many versions on one IBM Websphere server

Is it possible to deploy different versions of single application on one IBM Websphere Application Server (WAS)?
For example I have:
App1 with url binding http://app/1.0/service/
App2 with url binding http://app/2.0/service/
Is it possible?
I think not due to port listening issue, but maybe there is some chance...
It should be possible, but with some restrictions (depending on your application). If you have WAS ND 8.5.5, then you have Application Edition management feature. Read more details on that page.
If you are on the older version, you will have to change several things during deployment, e.g.:
context-root of the application
JNDI EJB binding names
if other version is using different database - update the JDBC references
if other version is using additional resources (like queues, qcf) update them also.
Actually, port listening has nothing to do with it, as both application will use same port, but different context-roots.
This of course assumes that application doesn't have hard coded values in it (like context root, jndi names, etc).

How to create a Connection Pool in Web App rather than in tomcat

I want to create a connection pool for my Oracle database but I want this connection pool to be created when my Web App is deployed in my Tomcat Server.
What I 've seen until now is loads of examples on how to create connection pooling in tomcat using JNDI and by defining the resource in the context.xml. That means (If I got this right) that even id you undeploy your app the pool remains in the server with open connections.
Is there any way to define the connection pool in the Web App rather than in tomcat server?
Thanks
Use C3P0 or DBCP to manage connections at application level.
Yes, you can define the pool as a static class member. Initialize it in a static constructor and use factory methods to get connections from it.

Securing JNDI for remote clients on JBoss

Does anybody know how to secure the JNDI access for remote clients on JBoss?
I know how to secure remote JMX invokers but even with that in effect it is still possile to lookup, bind and unbind things in JNDI even if the client is not authenticated.
I would like that that the server refuses to give you access to the InitialContext if you are not authenticated and to make it read only for some clients. Is this possible?
I am using JBoss 5.1.0 GA with jdk6
The instructions on how to do this are in the JBoss Wiki. It is not perfect, but it works.
Even if the article only mentions versions 3 and 4 of JBoss it still works with 5.1.0 GA.

Categories