JNDI lookup in a clustered environment

          Hi,
          I have deployed my application on a clustered environment containing one admin
          server and two managed servers. The application is deployed on the managed servers.
          We have a DNS for these two managed servers.
          Currently, I am using t3:localhost:portnumber to get an initial context for JNDI
          lookup.
          But this will not provide perfect load balancing, since each server side component
          (EJB) will lookup for a needed component on the same server itself.
          Is there any way to get the Initial Context by using the DNS name?
          I tried t3:DNSName (Our DNS is created till the port number. e.g. http://DNS points
          to http://Managedserver1:portnumber and http://Managedserver2:portnumber
          It works, but is random. Sometimes, it gives me the following exception:
          Root exception is java.net.ConnectException: t3://DNS Name: Destination not
          reachable using: 't3'
          Could someone help me figure out a way to do this in a better way?
          Thanks,
          Aparna
          

          If you don't want or have money to use external load balancers you should be using
          the DNS entry as t3://server1:port,server2:port (you indicated you are using http.
          Also make sure your network elements between the client and the servers allow
          t3 protocol if there is packet filtering).
          S
          "Aparna" <[email protected]> wrote:
          >
          >Hi,
          >
          >I have deployed my application on a clustered environment containing
          >one admin
          >server and two managed servers. The application is deployed on the managed
          >servers.
          >We have a DNS for these two managed servers.
          >
          >Currently, I am using t3:localhost:portnumber to get an initial context
          >for JNDI
          >lookup.
          >But this will not provide perfect load balancing, since each server side
          >component
          >(EJB) will lookup for a needed component on the same server itself.
          >
          >Is there any way to get the Initial Context by using the DNS name?
          >
          >I tried t3:DNSName (Our DNS is created till the port number. e.g. http://DNS
          >points
          >to http://Managedserver1:portnumber and http://Managedserver2:portnumber
          >
          >It works, but is random. Sometimes, it gives me the following exception:
          > Root exception is java.net.ConnectException: t3://DNS Name: Destination
          > not
          >reachable using: 't3'
          >
          >Could someone help me figure out a way to do this in a better way?
          >
          >Thanks,
          >Aparna
          

Similar Messages

  • Queue JNDI lookup in a clustered environment

    Hey all,
              I know in a 6.1 cluster, the queues/JMS servers can only reside on one
              server.
              How can i lookup a queue from internal code from one of the off servers? The
              JNDI lookup doesn't grab it, throws an object not found exception. Do I need
              to
              be using the createQueue() method in the QueueSession class?
              It's fairly critical to know this to get our app up on the cluster, so
              any help would
              be very appreciated!
              Thanks,
              Greg
              

              A dumb question - how do I specify JNDINameReplicated=false? I am using WLS 6.1
              SP3 and in my config.xml I have
              <JMSTopic Name="topicA" JNDIName="topicA" JNDINameReplicated="false" />
              but WebLogic does not like it.
              Eric Ma
              Tom Barnes <[email protected]> wrote:
              >The parameter name "JNDINameReplicated" parameter is only available in
              >a patch
              >on top
              >of SP2 or SP3, and is "true" by default. I doubt that you are using
              >it.
              >
              >Greg Kaestle wrote:
              >
              >> Thanks much,
              >> Where is this parameter set in config.xml?
              >>
              >> Greg
              >>
              >> "Shean-Guang Chang" <[email protected]> wrote in message
              >> news:[email protected]...
              >> > If you want the queue to be found from other server in the same cluster
              >> then
              >> > you should not set "JNDINameReplicated" to false. This
              >> > will make the JNDI name of the queue known to the local server which
              >is
              >> > hosting the JMS queue. The purpose to use "JNDINameReplicated=false"
              >> > is to have multiple queues with the same JNDI name and then use some
              >sort
              >> of
              >> > load balancer to spread load among different JMS servers in the cluster.
              >> >
              >> >
              >> > "Greg Kaestle" <[email protected]> wrote in message
              >> > news:[email protected]...
              >> > > Hey all,
              >> > >
              >> > > I know in a 6.1 cluster, the queues/JMS servers can only reside
              >on
              >> one
              >> > > server.
              >> > > How can i lookup a queue from internal code from one of the off
              >servers?
              >> > The
              >> > > JNDI lookup doesn't grab it, throws an object not found exception.
              >Do I
              >> > need
              >> > > to
              >> > > be using the createQueue() method in the QueueSession class?
              >> > >
              >> > > It's fairly critical to know this to get our app up on the cluster,
              >> so
              >> > > any help would
              >> > > be very appreciated!
              >> > >
              >> > > Thanks,
              >> > > Greg
              >> > >
              >> > >
              >> >
              >> >
              >
              

  • JNDI lookup in Multitired clustered architecture

    Hi alll,
    We are in the design phase of a multi tired clustered application.
    This application has jsp/servelet cluster and business application cluster. We are confused abt the JNDI lookup logic need to use in servlet cluster.
    Can anyone help me to find out an optimal solution for jndi which gives the complete advantage of load balancing and esp. fail over
    of clustering
    Thanks in advance
    gokul

    Hi,
              First of all, I would like to clear the point that load balancing can be done within a cluster not among the cluster.
              So if you have more than one cluster the load balancing
              would be at each cluster level.
              For JNDI lookup you have to provide cluster address i.e combination of Managed Server Address e.g:
              t3://localhost:7001,localhost:8001,localhost:9001...etc
              Thanks,
              Qumar

  • JNDI lookup on clustered server

              I am very new to clustering Weblogic servers, and I'm lost. Here is what my config.xml
              file looks like:
              <?xml version="1.0" encoding="UTF-8"?>
              <Domain ConfigurationVersion="8.1.0.0" Name="mydomain">
              <Cluster MulticastAddress="237.0.0.1" MulticastPort="8035" Name="DomainCluster"/>
              <Server ListenAddress="" ListenPort="8031" Machine="Machine1"
              Name="DomainAdmin" NativeIOEnabled="true" ServerVersion="8.1.0.0" StdoutEnabled="false">
              <SSL Enabled="true" HostnameVerificationIgnored="false"
              IdentityAndTrustLocations="KeyStores" ListenPort="8032" Name="DomainAdmin"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAdmin"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              </Server>
              <Server IIOPEnabled="false" ListenPort="80" Machine="Machine1"
              Name="DomainProxy" NativeIOEnabled="true" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="443" Name="DomainProxy"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainProxy"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="100"/>
              </Server>
              <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              IIOPEnabled="true" ListenPort="8035" Machine="Machine1"
              Name="DomainAppServer1a" NativeIOEnabled="true"
              ServerVersion="8.1.1.0" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="8036" Name="DomainAppServer1a"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1a"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              </Server>
              <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              IIOPEnabled="false" ListenPort="8037" Machine="Machine1"
              Name="DomainAppServer1b" NativeIOEnabled="true" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="8038" Name="DomainAppServer1b"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1b"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              </Server>
              <MigratableTarget Cluster="DomainCluster"
              Name="DomainAppServer1a (migratable)"
              Notes="This is a system generated default migratable target for a server.
              Do not delete manually." UserPreferredServer="DomainAppServer1a"/>
              <MigratableTarget Cluster="DomainCluster"
              Name="DomainAppServer1b (migratable)"
              Notes="This is a system generated default migratable target for a server.
              Do not delete manually." UserPreferredServer="DomainAppServer1b"/>
              <UnixMachine Name="Machine1" PostBindGID="domain"
              PostBindGIDEnabled="true" PostBindUID="DOMAIN" PostBindUIDEnabled="true">
              <NodeManager ListenAddress="" ListenPort="8033" Name="Machine1"/>
              </UnixMachine>
              <JMSServer Name="DomainJMSServer1a" Store="DomainJMSFileStore1a" Targets="DomainAppServer1a">
              <JMSTopic CreationTime="..."
              JNDIName="topic.someTopic" Name="someTopic" StoreEnabled="false"/>
              </JMSServer>
              <JMSServer Name="DomainJMSServer1b" Store="DomainJMSFileStore1b" Targets="DomainAppServer1b"/>
              <DomainLogFilter Name="DomainLogFilter" SeverityLevel="1"/>
              <Security Name="Domain" PasswordPolicy="wl_default_password_policy"
              Realm="wl_default_realm" RealmSetup="true"/>
              <EmbeddedLDAP
              Credential="..." Name="Domain"/>
              <SecurityConfiguration
              Credential="..."
              Name="Domain" RealmBootStrapVersion="1"/>
              <Realm FileRealm="wl_default_file_realm" Name="wl_default_realm"/>
              <FileRealm Name="wl_default_file_realm"/>
              <PasswordPolicy Name="wl_default_password_policy"/>
              <JDBCConnectionPool ConnectionCreationRetryFrequencySeconds="60"
              DriverName="oracle.jdbc.driver.OracleDriver" MaxCapacity="5"
              Name="domainPOOL" Password="..."
              Properties="..." ShrinkFrequencySeconds="18000"
              Targets="DomainCluster" TestConnectionsOnCreate="true"
              TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
              TestFrequencySeconds="300" TestTableName="DUAL" URL="..."/>
              <JDBCTxDataSource JNDIName="domainSource" Name="domainSource"
              PoolName="domainPOOL" Targets="DomainCluster"/>
              <Application Name="MyDomain" Path="domain.ear"
              StagingMode="nostage" TwoPhase="true">
              <EJBComponent Name="domainejb" Targets="DomainCluster" URI="domainEjb.jar"/>
              </Application>
              </Domain>
              As you can, I have two servers configured in my DomainCluster. My EJB, domainejb,
              is tied to
              this cluster. I can't seem to do a JNDI lookup of this EJB, or the JMS Topic
              that I've created.
              When I attempt to do the lookup (from a client on the local machine) using the
              URL
              t3://localhost:8031, I get a NameNotFound Exception. This makes sense, because
              the
              Admin server isn't a part of the cluster. However, when I do the lookup using
              t3://localhost:8035, I get an exception that states that it could not connect
              to a host. I have
              insured that the server at this port is running, and the EJB is located in it's
              JNDI tree.
              I am stumped and could really use someone's help. Please advice.
              Thanks, Joel
              

              Prasad Peddada <[email protected]> wrote:
              >Joel wrote:
              >> I am very new to clustering Weblogic servers, and I'm lost. Here is
              >what my config.xml
              >> file looks like:
              >>
              >> <?xml version="1.0" encoding="UTF-8"?>
              >> <Domain ConfigurationVersion="8.1.0.0" Name="mydomain">
              >> <Cluster MulticastAddress="237.0.0.1" MulticastPort="8035" Name="DomainCluster"/>
              >> <Server ListenAddress="" ListenPort="8031" Machine="Machine1"
              >> Name="DomainAdmin" NativeIOEnabled="true" ServerVersion="8.1.0.0"
              >StdoutEnabled="false">
              >> <SSL Enabled="true" HostnameVerificationIgnored="false"
              >> IdentityAndTrustLocations="KeyStores" ListenPort="8032"
              >Name="DomainAdmin"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAdmin"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> </Server>
              >> <Server IIOPEnabled="false" ListenPort="80" Machine="Machine1"
              >> Name="DomainProxy" NativeIOEnabled="true" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="443" Name="DomainProxy"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainProxy"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="100"/>
              >> </Server>
              >> <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              >> IIOPEnabled="true" ListenPort="8035" Machine="Machine1"
              >> Name="DomainAppServer1a" NativeIOEnabled="true"
              >> ServerVersion="8.1.1.0" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="8036" Name="DomainAppServer1a"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1a"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              >> </Server>
              >> <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              >> IIOPEnabled="false" ListenPort="8037" Machine="Machine1"
              >> Name="DomainAppServer1b" NativeIOEnabled="true" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="8038" Name="DomainAppServer1b"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1b"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              >> </Server>
              >> <MigratableTarget Cluster="DomainCluster"
              >> Name="DomainAppServer1a (migratable)"
              >> Notes="This is a system generated default migratable target
              >for a server.
              >> Do not delete manually." UserPreferredServer="DomainAppServer1a"/>
              >> <MigratableTarget Cluster="DomainCluster"
              >> Name="DomainAppServer1b (migratable)"
              >> Notes="This is a system generated default migratable target
              >for a server.
              >> Do not delete manually." UserPreferredServer="DomainAppServer1b"/>
              >> <UnixMachine Name="Machine1" PostBindGID="domain"
              >> PostBindGIDEnabled="true" PostBindUID="DOMAIN" PostBindUIDEnabled="true">
              >> <NodeManager ListenAddress="" ListenPort="8033" Name="Machine1"/>
              >> </UnixMachine>
              >> <JMSServer Name="DomainJMSServer1a" Store="DomainJMSFileStore1a"
              >Targets="DomainAppServer1a">
              >> <JMSTopic CreationTime="..."
              >> JNDIName="topic.someTopic" Name="someTopic" StoreEnabled="false"/>
              >> </JMSServer>
              >> <JMSServer Name="DomainJMSServer1b" Store="DomainJMSFileStore1b"
              >Targets="DomainAppServer1b"/>
              >> <DomainLogFilter Name="DomainLogFilter" SeverityLevel="1"/>
              >> <Security Name="Domain" PasswordPolicy="wl_default_password_policy"
              >> Realm="wl_default_realm" RealmSetup="true"/>
              >> <EmbeddedLDAP
              >> Credential="..." Name="Domain"/>
              >> <SecurityConfiguration
              >> Credential="..."
              >> Name="Domain" RealmBootStrapVersion="1"/>
              >> <Realm FileRealm="wl_default_file_realm" Name="wl_default_realm"/>
              >> <FileRealm Name="wl_default_file_realm"/>
              >> <PasswordPolicy Name="wl_default_password_policy"/>
              >> <JDBCConnectionPool ConnectionCreationRetryFrequencySeconds="60"
              >> DriverName="oracle.jdbc.driver.OracleDriver" MaxCapacity="5"
              >> Name="domainPOOL" Password="..."
              >> Properties="..." ShrinkFrequencySeconds="18000"
              >> Targets="DomainCluster" TestConnectionsOnCreate="true"
              >> TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
              >> TestFrequencySeconds="300" TestTableName="DUAL" URL="..."/>
              >> <JDBCTxDataSource JNDIName="domainSource" Name="domainSource"
              >> PoolName="domainPOOL" Targets="DomainCluster"/>
              >> <Application Name="MyDomain" Path="domain.ear"
              >> StagingMode="nostage" TwoPhase="true">
              >> <EJBComponent Name="domainejb" Targets="DomainCluster" URI="domainEjb.jar"/>
              >> </Application>
              >> </Domain>
              >>
              >> As you can, I have two servers configured in my DomainCluster. My
              >EJB, domainejb,
              >> is tied to
              >> this cluster. I can't seem to do a JNDI lookup of this EJB, or the
              >JMS Topic
              >> that I've created.
              >> When I attempt to do the lookup (from a client on the local machine)
              >using the
              >> URL
              >> t3://localhost:8031, I get a NameNotFound Exception. This makes sense,
              >because
              >> the
              >> Admin server isn't a part of the cluster. However, when I do the lookup
              >using
              >>
              >> t3://localhost:8035, I get an exception that states that it could not
              >connect
              >> to a host. I have
              >> insured that the server at this port is running, and the EJB is located
              >in it's
              >> JNDI tree.
              >>
              >> I am stumped and could really use someone's help. Please advice.
              >>
              >> Thanks, Joel
              >
              >Trying setting a listen address to specific ip instead of localhost
              >address. Have you tried view the JNDI tree of Managed Servers from console.
              >
              >Cheers,
              >
              >-- Prasad
              >
              Though some problems still remained, having the client use the weblogic.jar rather
              than the thin
              client jars (wljmsclient.jar and wlclient.jar) seemed to cure many of the issues.
              

  • Jms is not working properly in clustered environment

    Hi all,
    i am using the application server oc4j 10.1.3.1.0 enterprise edition . my application is standalone application(thick client)
    we are using the jndi.properties as follows ...
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=opmn:ormi://172.16.1.38:6005:group/Security,opmn:ormi://172.16.1.38:6006:deceval_group/Security
    java.naming.security.principal=oc4juser
    java.naming.security.credentials=oc4juser
    oracle.j2ee.rmi.loadBalance=lookup
    we have two application servers in cluster topology as u can see above we have used one instance from one application server and one from another.
    i have seen that for every instance there one jms server. at runtime it is taking one application servers services
    say opmn port 6005 but when the application is connecting to the another application server say opmn 6006
    here jms is not working properly when i send message
    As we have clustered environment message must be propagated all the applications who use above jndi.properties.
    if i keep use only one application server opmn say
    java.naming.provider.url=opmn:ormi://172.16.1.38:6005:group/Security
    then its is working excellently
    please can u provide any solution ASAP
    thanks in advance
    Manu

    Dear Aravindth
      (.*?) means -> Select all contents from where you start and end,
    For Ex. <month>(.*?)</month> then Select for start <month> and end last </month> tag.
    (?) Match zero or one occurrences. Equivalent to {0,1}.
    (*) Match zero or more occurrences. Equivalent to {0,}.
    (+) Match one or more occurrences. Equivalent to {1,}.
    (.) (Dot). Match any character except newline or another Unicode line terminator.
    (.*?) means -> Zero or more times Match any character except newline or another Unicode line terminator + Match zero or more occurrences. Equivalent to {0,}.+Match zero or one occurrences. Equivalent to {0,1}.
    Could you please refere the below cite :
    http://www.javascriptkit.com/jsref/regexp.shtml
    Thanks & Regards
    T.R.Harihara SudhaN

  • WLS/OSB DB Adapter - JNDI lookup failed

    Hello all.
    I've got a DB adapter service set up in a clustered environment, and it all works (and I've built proxy services, transformations etc around it), but I've just noticed that the log shows a warning regarding the JNDI lookup of the ConnectionFactory, as below.
    It's working, and the error is only a warning, but could this cause problems going forward, particularly with regards performance?
    Given that the ConnectionFactory name is 'com.whatever.myServiceDB', and the Endpoint URI of the service is 'jca://com.whatever.myServiceDB', what could be wrong? Has anyone seen/fixed this before? It's almost like the managed servers don't know about the JNDI name...but the DbAdapter deployent has 'All servers in the cluster' selected in its 'Targets' tab, so I'm not sure.
    Any pointers would be appreciated, I'm probably missing something obvious.
    Cheers.
    ####<Apr 15, 2010 10:53:10 AM BST> <Warning> <JCA_FRAMEWORK_AND_ADAPTER> <servername> <managed3_domainname> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1271325190453> <BEA-000000> <servicebus:/WSDL/MyProject/MyService [ MyService_ptt::merge(MessagesCollection) ] - JNDI lookup of 'com.whatever.myServiceDB' failed due to: String index out of range: -1>

    Thanks again.
    In case anyone runs into a similar problem and is wondering: a bit of mucking about reveals that the WLS ConnectionFactory config is fine with dots or slashes, and it seems to treat both the same when creating the JNDI tree.
    However, the WSDL (that you probably created in JDeveloper) has to have slashes for doing its lookup. So, for example, always use slashes rather than dots when setting your DB Adapter JNDI name in JDeveloper. I guess this is a bit different from usual class/package naming standards, so may catch someone else out too.
    Cheers.

  • Minimizing JNDI lookups

    Hi!
    We've implemented a simple EJBHome caching mechanism to reduce JNDI lookups. As many of you may know, a JNDI lookup is expensive in resource terms.
    Using the Oracle 9iAS JavaCache service is discarded because we need a vendor independant solution.
    Our implementation works fine in an OC4J standalone environment where each EJB is looked up and created in the same instance.
    But we don't know how it would perform in a clustered environment (Oracle 9iAS Enterprise) and we don't have an installation avalaible to try it and make the performance improvement announcement for our customers. (they are asking us to do it ASAP).
    So the key here is when the EJB load balance happens?, in the JNDI lookup or in the EJB create() method ?
    Thanks
    Franco Catrin L.
    TUXPAN

    I'm using a Singleton class to cache HomeInterfaces. The first time a
    HomeInterface is requested, the JNDI lookup is done, after that, all
    requests to that HomeInterface are handled by the cache. Works great, no
    problems. AFAIK there are no problems with storing the HomeInterface
    reference and reusing it.
    Hope that helps,
    Nils
    Tiffany wrote:
    >
    JNDI lookups are expensive timewise. Our question is ... would it be
    pratical to lookup all our EJB Home interfaces once at startup and store
    these references in a global class accessible to all clients? These home
    interfaces then become readily available factories for acquiring instances
    of remote interfaces. Is there anything wrong with this picture? Is this a
    problem because these home stubs are not reentrant and may be accessed
    concurrently by more than one client? Is there a problem with have one home
    reference create multiple remote references of an ejb?
    Any light that can be shed on this question wouls be appreciated.
    Thanks.
    tiffany
    San Diego--
    ============================
    [email protected]

  • Data Caching in a Clustered Environment

              I want to cache read-only reference/code table data that will run in a clustered
              WLS6 environment. It's a JSP application and I am storing a complete HTML Select
              Control per reference/code table data in the cache. The question is where to
              cache it? I was going to put it in the ServletContext (JSP "application" implicit
              object), but the ServletContext is not replicated. I considered using JNDI, but
              there are problems with duplicate name errors when another server who doesn't
              originally bind the object tries to lookup, change and rebind the object. I guess
              JMS Multicasting is an option, but I don't want to implement JMS just for an application
              data cache.
              Any suggestions for a simple reference/code table read-only caching strategy that
              will work in a clustered WLS6 environment?
              

    If the data is strictly read-only, and you do not have to worry about cache
              integrity, then look at WebLogic JSP cachetag:
              http://www.weblogic.com/docs51/classdocs/API_jsp.html#cachetag
              You can use it to cache both the output and the calculations results
              (variables calculated inside the cache tag).
              The scenario will be exactly the same for non-clustered and clustered
              cases - using multicast to broadcast small invalidation messages (so the
              data can be refreshed from the database) is ok, but replicating application
              data is not (and you definitely do not want to use JNDI for this purpose).
              BTW, the initial CacheTag implementation in 5.1 (supposedly) had a 'cluster'
              scope and I assume it was multicasting fresh data after cache miss - there
              is no such scope in 6.0 implementation.
              If you still want replication you can look at javagroups:
              http://sourceforge.net/projects/javagroups/
              (distributedhashtable example).
              Olsen <[email protected]> wrote:
              > Cameron,
              > Thanks for the reply. However, as I stated below, I am not interested in
              > JMS, nor an EJB solution to the problem. It really is not that complicated of
              > a concept and I know a solution or two (ServletContext, JNDI), but none that works
              > in a WLS6 clustered environment.
              > Any other ideas???
              > Thanks...
              > "Cameron Purdy" <[email protected]> wrote:
              >>Dimitri had a clever (as ever) solution using JMS to maintain cache
              >>integrity:
              >>
              >>explanation at
              >>http://dima.dhs.org/misc/readOnlyUpdates.html
              >>
              >>d/l from
              >>http://dima.dhs.org/misc/readOnlyUpdates.jar
              >>
              >>--
              >>Cameron Purdy
              >>Tangosol, Inc.
              >>http://www.tangosol.com
              >>+1.617.623.5782
              >>WebLogic Consulting Available
              >>
              >>
              >>"Olsen" <[email protected]> wrote in message
              >>news:[email protected]...
              >>>
              >>> I want to cache read-only reference/code table data that will run in
              >>a
              >>clustered
              >>> WLS6 environment. It's a JSP application and I am storing a complete
              >>HTML
              >>Select
              >>> Control per reference/code table data in the cache. The question is
              >>where
              >>to
              >>> cache it? I was going to put it in the ServletContext (JSP "application"
              >>implicit
              >>> object), but the ServletContext is not replicated. I considered using
              >>JNDI, but
              >>> there are problems with duplicate name errors when another server who
              >>doesn't
              >>> originally bind the object tries to lookup, change and rebind the object.
              >>I guess
              >>> JMS Multicasting is an option, but I don't want to implement JMS just
              >>for
              >>an application
              >>> data cache.
              >>> Any suggestions for a simple reference/code table read-only caching
              >>strategy that
              >>> will work in a clustered WLS6 environment?
              >>
              >>
              Dimitri
              

  • JNDI Lookup in JSP fails for EJB 3.0

    I am new to Java technology. I read the EJB FAQ, NetBeans docs and may forum discussions and I am still confused with the error I am having.
    Background:
    I have developed a persistance bean and related sessions beans (similar to the customer-cmp-ear application in the Java App Server samples). Now I am trying to access this bean using a JSP. After deploying the war file in the App Server and try to access the page, I get the following error.
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/ConsumerSessionLocal
    After reading many articles, I understood that I dont have to prepare any descriptors, or JAR files for EJB 3.0.
    Environment Details:
    Java App Server Ver 9.0
    NetBeans 5.5
    I normally build the war files using NetBeans.
    I use App Server Admin console to deploy the web applications using the above war file.
    EJB details:
    Persistance EJB : person.java
    Session Objects
    Consumer.java (this implements ConsumerSessionLocal, ConsumerSessionRemote). This Stateless bean accesses the methods in person.java.
    ConsumerSessionLocal.java - local interface
    ConsumerSessionRemote.java - remote interface
    SearchConsumer.jsp
    This JSP page is calling the ConsumerSessionLocal using the JNDI lookup through InitialContext.
    Here is the Code snippet:
    try {
    InitialContext ic = new InitialContext();
    Object o = ic.lookup("java:comp/env/ConsumerSessionLocal");
    ConsumerSessionLocal consSession = (ConsumerSessionLocal) o;
    I am able to see the jsp page in the browser, however, after a submit action, I get the Java Naming Exception error.
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ConsumerSessionLocal
    I would appreciate your help/any of your thoughts.
    Thanks in advance.
    -Ram

    I did not really solve it. Instead I used some of the tutorials that used JNDI lookup and modified those as my way forward. I did not really find out exactly what I was doing wrong.
    /Anders

  • Error when calling BPEL from ESB in clustered environment

    Hi
    We have recently installed SOA Suite in a clustered environment and have a serious issue.
    I am not able to call BPEL processes from my ESB services via WSIF (by using the 'browse target operation' in JDeveloper). The exception i get at runtime is this.
    "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found"
    When I instead call the BPEL process via SOAP (by using a SOAP invocation service i JDeveloper) it works fine.
    Everything works fine in development environment which not are clustered.
    Has anyone any excperience from using ESB in a clustered environment?
    Regards
    Kalle Viklund

    Hi
    ESB and BPEL resides in the same oc4j-instance. Though, esb-rt and orabpel are different applications in that oc4j-instance. And the lookup 'ejb/collaxa/system/DeliveryBean' only exists in the orabpel application.
    In the ESB Console I already have the same setting for the 'BPELSystem' as for the 'Defaultsystem'.
    Cluster name: esb_prod
    Virtual host: prod1.sth.nu
    Port: 80
    Topic location: ESBTopics/Topics/ESB_JAVA_DEFERRED
    Connection factory location: OracleOJMS/XATCF
    regards
    Kalle

  • JMS Wrappers can't cache JNDI lookups when using secured queues

    Hi All!
    We are working on a jms client, inside a webapp(servlets), using Weblogic 9.2 and Weblogic 10.3.
    As we want to use secured queues and keep being efficient we tryed to use Weblogic JMS Wrappers, that should work according to the docs:
    Enhanced Support for Using WebLogic JMS with EJBs and Servlets
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/j2ee.html
    But we are facing a problem:
    When we define a JMS Wrapper and try to cache JNDI lookups for the QueueConnectionFactory and Queue, as the docs recommend for efficiency, the connection to the queue is ignoring the user/pwd.
    The JMS Wrapper is using <res-auth>Application</res-auth>.
    We are creating the connection using createQueueConnection(user, pwd) from QueueConnectionFactory and after several tests it seems that the user and password are ingored unless a jndi lookup is made in the same thread, as if when there are not any thread credentials present user and password are ignored for the connection...
    so the question is:
    That behaviour goes against Weblogic JMS Wrapper documentation, doesn't it?
    Is there then any other way to access efficiently secured queues using a servlet as a client? (iit's not an option for us to use mdbs, or ejbs).
    If it helps, this seems related to this still opened spring-weblogic issue: SPR-2941 --> http://jira.springframework.org/browse/SPR-2941 and SPR-4720 --> http://jira.springframework.org/browse/SPR-4720
    Thanxs
    And here goes our DDs and code to reproduce:
    First in pretty format:
    web.xml --> http://pastebin.com/f5f85e8d4
    weblogic.xml --> http://pastebin.com/f2fbe10cc
    Client code --> http://pastebin.com/f586d32d9
    And now emmebded in the msg:
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app
      xmlns="http://www.bea.com/ns/weblogic/90"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
      http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
        <description>WebLogic Descriptor</description>
        <resource-description>
            <res-ref-name>jms/QCF</res-ref-name>
            <jndi-name>weblogic.jms.ConnectionFactory</jndi-name>
        </resource-description>
    </weblogic-web-app>weblogic.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
          <display-name> QCFWrapperCredentialsTest </display-name>
          <description> QCFWrapperCredentialsTest  </description>
          <servlet id="Servlet_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <servlet-class>QCFWrapperCredentialsTest</servlet-class>
             <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping id="ServletMapping_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <url-pattern>/Test</url-pattern>
          </servlet-mapping>
         <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>And our test client:
    import java.io.*;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.http.*;
    public class QCFWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
    }Edited by: user2525402 on Feb 9, 2010 7:14 PM

    Thanks Tom,
    Quite a useful response .-)
    Leaving aside the fact that weblogic behaviour with jms wrappers and secured queues seems to not be working as the docs says...
    Talking about workarounds:
    Both workarounds you suggest works, but as you already noted, creating a new JNDI context just to inject credentials into the threads is overkill when high performance is needed.
    I also found more information about the same issue here: http://sleeplessinslc.blogspot.com/2009/04/weblogic-jms-standalone-multi-threaded.html
    And he suggest the same workaround, injecting credentials
    So I tried the second approach, successfully, injecting credentials into the thread using the security API.
    This way, using JMS wrappers and injecting credentials into the thread we get the best performance available, caching resource using wrappers and using credentials in a somewhat efficient way.
    Now the test snippet looks like this:
    import java.io.*;
    import java.security.PrivilegedAction;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.security.auth.Subject;
    import javax.security.auth.login.LoginException;
    import javax.servlet.http.*;
    import weblogic.jndi.Environment;
    import weblogic.security.auth.Authenticate;
    public class JMSWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            final HttpServletRequest fReq=req;
            final HttpServletResponse fRes=res;
            PrivilegedAction action = new java.security.PrivilegedAction() {
                public java.lang.Object run() {
                    performRequest(fReq,fRes);
                    return null;
            try {
                Subject subject=createSingleSubject(serverT3URL,user,pwd);
                weblogic.security.Security.runAs(subject, action);
            } catch (Exception e) {
                e.printStackTrace();
        public void performRequest(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
        private Subject createSingleSubject(String providerUrl, String userName, String password) {
            Subject subject = new Subject();
            // Weblogic env class
            Environment env = new Environment();
            if(providerUrl!=null)
                env.setProviderUrl(providerUrl);
            env.setSecurityPrincipal(userName);
            env.setSecurityCredentials(password);
            try {
              // Weblogic Authenticate class will populate and Seal the subject
              Authenticate.authenticate(env, subject);
              return subject;
            catch (LoginException e) {
              throw new RuntimeException("Unable to Authenticate User", e);
            catch (Exception e) {
              throw new RuntimeException("Error authenticating user", e);
    }Thanks a lot for the help

  • JNDI lookup using a proxy server

    Hi,
    I'm trying to use a weblogic server as a proxy server for a cluster of
    weblogic servers. The static and dynamic content delivery works fine but
    when I try to do a JNDI lookup from an applet client, I get a name not
    resolved exception. I guess, it happens because the proxy server tries to
    resolve the name from it's JNDI tree, whereas I expect it to forward this
    request to one of the servers in the cluster. Is this possible? If it is, do
    I need to set up some parameters in the proxy server? If not, can I do this
    myself by writing a name resolution class which in turn will forward the
    request to one of the servers in the cluster?
    Any help would be greatly appreciated.
    thanks
    - sanjay

    when u say "cluster of weblogic servers"..u mean the weblogic`s inbuilt
    cluster..
    the reason i ask is weblogic`s cluster do provide JNDI clustering too by using
    cluster-wide naming tree..
    Sanjay Aggarwal wrote:
    Hi,
    I'm trying to use a weblogic server as a proxy server for a cluster of
    weblogic servers. The static and dynamic content delivery works fine but
    when I try to do a JNDI lookup from an applet client, I get a name not
    resolved exception. I guess, it happens because the proxy server tries to
    resolve the name from it's JNDI tree, whereas I expect it to forward this
    request to one of the servers in the cluster. Is this possible? If it is, do
    I need to set up some parameters in the proxy server? If not, can I do this
    myself by writing a name resolution class which in turn will forward the
    request to one of the servers in the cluster?
    Any help would be greatly appreciated.
    thanks
    - sanjay

  • How to create InitialContext for JNDI lookup in a cluster?

              I am new to clusters in WL7 and I wanted to know how a client would create an InitialContext
              object to perform a JNDI lookup for a remote object deployed across serveral servers
              in the cluster. Is the following correct?
              Physcial Servers in the cluster
              machine1:9001
              machine2:9001
              machine3:9001
              Code for creating InitialContext
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "machine1:9001,machine2:9001,machine3:9001");
              Context c = new InitialContext( p);
              Thanks,
              Raffi
              

    Hi Ivaylo,
    There's another alternative solution to your problem. You can have the screen 120 as a user-defined selection screen. i.e., instead of creating this screen through the screen painter, you can create it from within your ABAP Program. This way, you can directly use the SELECT-OPTIONS statement within your screen. You then will no longer have to bother about how to handle the data for the field.
    Especially in the case where your screen 120 has few elements, this approach, in my opinion, will be the best.
    Please let me know if you need any further clarifications on how to go about it if you choose to follow this approach.
    Regards,
    Anand Mandalika.

  • Doing a jndi lookup() for an EJB deployed on Glassfish v3

    Hello.
    I have deployed a Stateful Sesion EJB on a Glassfish v3 AppServer.
    It is running under 'localhost' on my laptop pc.
    I am also running a stand-alone java application on the same pc... it attempts to get a remote connection from the client-app to the Glassfish Server and then do a jndi lookup() to get a reference to my EJB.
    here is the client source code:
    public class LookupTest {
    static Properties props = null;
    public static void main(String[] args) {
    try {
    props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
         props.put(Context.PROVIDER_URL, "iiop://localhost:3700");
         Context ctx = new InitialContext(props);
         System.out.println( "the context is: " + ctx);
         System.out.println( "the environment contains: " + ctx.getEnvironment() );
         System.out.println( " ");
         // do a lookup.
         Object elementObj = ctx.lookup("SerialContextProvider");
         System.out.println(elementObj);
    } catch (NamingException e) {
    e.printStackTrace();
    When I run this app, there are no Errors or Exceptions. It appears that the connection succeeds. But there are no EJB references in the context that is created. The only item that seems to be present in the context is an item named "SerialContextProvider", as noted in the return value from a list("") method invocation. Why can i not see the EJB within the context? Is my code wrong ??
    Thanks,
    Andy Jerpe
    Edited by: user1169567 on Nov 28, 2010 12:12 PM

    Ok, but the communication seems to be OK over the wire because if I use netstat -a I can see the ESTABLISHED connection with the server in the right RMI port.
    TCP PORTAL35:1581 caapiranga:12405 ESTABLISHED
    and then when I stop the instance in the OAS, the client shows an exception telling that the connection was lost.
    An curious thing is that the ons.log doesn't log this connection ;/

  • Objects returned via JNDI Lookup

    All,
    I have had this nagging question in my head about JNDI lookups for some time
    now, but haven't had the time to do the proper research. The question is
    simple.
    The setup is simple as well. Suppose that we have a typical WLS setup, with
    WLS running in a JVM on a server host somewhere, with objects bound to its
    JNDI tree (we'll leave clustering out of the picture for simplicity's sake),
    and we also have a WLS client Java application. The client connects to WLS
    and performs various JNDI lookups on the server. Some of these objects
    implement java.io.Serializable, some do not.
    The question is, if the client uses JNDI to lookup an object that exsts in a
    separate JVM, and that object does not implement Serializable, how does this
    object come to be instantiated on the client?
    This leads to a second question: What exactly is getting returned from a
    JNDI lookup? A reference to an object or a copy of it? I can see that
    lookups within a single JVM would return a reference, but the cross-JVM
    lookup is less clear to me.
    Any and all help appreciated,
    -jc

    This leads to a second question: What exactly is getting returned from a
    JNDI lookup?From how I understand it, only Serializable objects are returned such as RMI
    stubs, which serve as proxies to EJB or other RMI servers registered in JNDI.
    - Thomas
    (ex-BONY too)
    Jonathan Castellani wrote:
    All,
    I have had this nagging question in my head about JNDI lookups for some time
    now, but haven't had the time to do the proper research. The question is
    simple.
    The setup is simple as well. Suppose that we have a typical WLS setup, with
    WLS running in a JVM on a server host somewhere, with objects bound to its
    JNDI tree (we'll leave clustering out of the picture for simplicity's sake),
    and we also have a WLS client Java application. The client connects to WLS
    and performs various JNDI lookups on the server. Some of these objects
    implement java.io.Serializable, some do not.
    The question is, if the client uses JNDI to lookup an object that exsts in a
    separate JVM, and that object does not implement Serializable, how does this
    object come to be instantiated on the client?
    This leads to a second question: What exactly is getting returned from a
    JNDI lookup? A reference to an object or a copy of it? I can see that
    lookups within a single JVM would return a reference, but the cross-JVM
    lookup is less clear to me.
    Any and all help appreciated,
    -jc

Maybe you are looking for

  • Change a new Apple ID

    Hi there: I have changed my Apple ID and psswd in iTunes and my iPAD, but when I go to the app store to purchase something, the Apple ID was still the old one. What should I do?

  • Connecting an iBook and an iMac

    Stupid question but I am afraid one I must ask. I am planning to get an iMac and iBook for my graphics degree, and want to be able to transfer work and files over quickly and with the minimum of ease. I have been recommended a Firewire cable or Ether

  • Increase Slide Size

    How do you enlargen the slide size? I am not referring to the file size but actually increasing the size of the slide on your screen. When I preview and publish the project, the slides only fill up 1/3 of the screen. I can't for the life of me figure

  • Why does Pages not support French quotation marks?

    Hello, I've got the following problem: I like using Pages to write my texts. But unfortunately *Pages doesn't support French quotation marks, e.g. « Example. »* what Microsoft Office supports since years. Pages does know the other quotation marks „Ex

  • IDOC and EDI

    Hi,   Please send me some useful information on IDOC'S and EDI with relevance to SD module and comman errors with this documents.